~ubuntu-branches/debian/sid/pyro/sid

« back to all changes in this revision

Viewing changes to examples/testmobile/imports/server/server.py

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz, Bernd Zeimetz, Sandro Tosi
  • Date: 2008-03-23 12:58:43 UTC
  • mfrom: (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080323125843-8zrvz1whkwzdyjxk
Tags: 3.7-2
[ Bernd Zeimetz ]
* debian/control:
  - Adding Homepage field, removing pseudo-field from description
  - Rename XS-Vcs-* fields to Vcs-* (dpkg supports them now)
  - Updating my email address.

[ Sandro Tosi ]
* debian/control
  - uniforming Vcs-Browser field
  - bump Standards-Version to 3.7.3
  - bump versioned build-dep on python-central to at least 0.6
* debian/copyright
  - converted to UTF-8
  - renamed copyright section to license
  - indented upstream author and license with 4 spaces
  - added copyright notice
* debian/pyro-doc.doc-base
  - updated section
  - removed empty tailing lines
* debian/pyro-gui.install
  - removed python-central directory (moved to debian/rules)
* debian/pyro.install
  - removed python-central directory (moved to debian/rules)
* debian/rules
  - updated due to new python-central directories structure (Closes:
    #472039)
  - integrate files under python-central directory into dh_install call
  - moved dh_install calls to install target

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
 
 
3
#
 
4
#       The server that doesn't use the Name Server.
 
5
#
 
6
 
 
7
import sys, os
 
8
import Pyro.core
 
9
from Pyro.errors import PyroError
 
10
 
 
11
import answers.answer
 
12
 
 
13
if not Pyro.config.PYRO_MOBILE_CODE:
 
14
        print "\nWARNING: PYRO_MOBILE_CODE not enabled\n"
 
15
if Pyro.config.PYRO_XML_PICKLE=='gnosis' and Pyro.config.PYRO_GNOSIS_PARANOIA>=0:
 
16
        print "\nWARNING: Using gnosis xml pickle but PYRO_GNOSIS_PARANOIA needs to be -1\n"
 
17
 
 
18
class Test(Pyro.core.ObjBase):
 
19
        def __init__(self):
 
20
                Pyro.core.ObjBase.__init__(self)
 
21
        def method(self, argument):
 
22
                print "some method called on test class, arg=",argument
 
23
                # returning an answer object
 
24
                result=answers.answer.Answer("some answer")
 
25
                print "returning",result
 
26
                return result
 
27
 
 
28
Pyro.core.initServer()
 
29
daemon = Pyro.core.Daemon()
 
30
objectName='testmobile.imports'
 
31
uri=daemon.connect(Test(),objectName)
 
32
 
 
33
# enter the service loop.
 
34
print 'Server is ready for customers. I am not using the Name Server.'
 
35
print 'Object name is:',objectName
 
36
print 'The URI is: ',uri
 
37
 
 
38
daemon.requestLoop()
 
39