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

« back to all changes in this revision

Viewing changes to examples/callback/bouncer_cberror.py

  • Committer: Bazaar Package Importer
  • Author(s): Carl Chenet, Carl Chenet, Jakub Wilk
  • Date: 2010-09-14 01:04:28 UTC
  • Revision ID: james.westby@ubuntu.com-20100914010428-02r7p1rzr7jvw94z
Tags: 1:3.9.1-2
[Carl Chenet]
* revert to 3.9.1-1 package because of the development status 
  of the 4.1 package is unsuitable for stable use
  DPMT svn #8557 revision (Closes: #589172) 
* added debian/source
* added debian/source/format
* package is now 3.0 (quilt) source format
* debian/control
  - Bump Standards-Version to 3.9.1

[Jakub Wilk]
* Add ‘XS-Python-Version: >= 2.5’ to prevent bytecompilation with python2.4
  (closes: #589053).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import Pyro.core
 
2
 
 
3
# a message bouncer. Raises an error in the callback function!
 
4
 
 
5
# it is subclassed form CallbackObjBase, 
 
6
# so the error is also thrown on the client.
 
7
 
 
8
# If you change this to the regular ObjBase,
 
9
# you'll see that the error is silently passed back
 
10
# to the server, and the client never knows about it.
 
11
 
 
12
class Bouncer(Pyro.core.CallbackObjBase):
 
13
        def __init__(self, name):
 
14
                Pyro.core.ObjBase.__init__(self)
 
15
                self.name=name
 
16
                self.count=0
 
17
        def process(self,message,callback):
 
18
                print 'This is',self.name
 
19
                print 'I\'ll throw an exception...'
 
20
                raise ValueError("Some error in the callback function")
 
21
                
 
22