Re: [Twisted-Python] Must avatarId always be a string?

2013-01-13 Thread Itamar Turner-Trauring
It's possible that in some of the cases discussed above, what you want is a custom *Portal*. For example, if you want to try a sequence of logins, and choose the first that succeeds: class MultiPortal(object): def __init__(self, portals): self.portals = portals @inlineCallbacks

Re: [Twisted-Python] Must avatarId always be a string?

2013-01-13 Thread Itamar Turner-Trauring
On Sun, Jan 13, 2013 at 9:08 AM, Itamar Turner-Trauring < ita...@futurefoundries.com> wrote: > > @inlineCallbacks > def login(self, *args, **kwargs): > for portal in self.portals: > try: > return portal.login(*args, **kwargs) > except: >

Re: [Twisted-Python] Appropriate exception for AMP types receiving garbage?

2013-01-13 Thread Laurens Van Houtven
How about something like {_error: 1, _error_code: BAD_ARGUMENT_VALUE, ...}? I was writing something to constrain AMP Argument's in- and output values: https://github.com/lvh/txampext/blob/master/txampext/constrained.py ... and my users getting a real exception as opposed to a disconnected trans