Roundup Tracker - Issues

Message3608

Author stefan
Recipients ajaksu2, lu_zero, richard, stefan, tobias-herp
Date 2009-02-27.18:14:34
Message-id <49A82D80.5050206@codesourcery.com>
In-reply-to <1235611143.13.0.558762941913.issue2550509@psf.upfronthosting.co.za>
I have just added support for actions to the XMLRPC interface, and added 
an easy mechanism for users to write actions that are executable through 
both, XMLRPC as well as CGI:
(http://svn.roundup-tracker.org/viewvc/roundup?view=rev&revision=4175)

roundup.cgi.actions provides a new class 'Bridge', that translates all 
form variables into a dictionary, which then gets passed as (single) 
argument to handle(). Thus, the following user action will do the 
obvious thing::

   from roundup.cgi.actions import Bridge

   class Echo(Bridge):

       def handle(self, args):

           if self.cgi:
               self.client.ok_message.append(str(args))
           else:
               return args

   def init(instance):

       instance.registerAction("echo", Echo)

Thus, in order for an action class to be executable like this, it needs:

* derive from roundup.cgi.actions.Bridge
* use a signature like the above, i.e. a single argument being a dictionary.

Users can provide XMLRPC-only actions by simply deriving from 
roundup.cgi.actions.Action.
In all other cases, registerAction() will register it as a conventional 
(cgi) action.

I would appreciate any feedback on this. Is this a useful interface ? 
Are there things that need to be modified or added (or removed !) for it 
to be more broadly useful ?

Also note that as of now, the XMLRPC interface is accessible through the 
web frontends (roundup.cgi, apache.py, and roundup-server), as well as 
through the standalone roundup-xmlrpc-server. This should make remote 
access (administration, in particular) easier.

Thanks,
		Stefan
History
Date User Action Args
2009-02-27 18:14:35stefansetrecipients: + stefan, richard, tobias-herp, lu_zero, ajaksu2
2009-02-27 18:14:35stefanlinkissue2550509 messages
2009-02-27 18:14:34stefancreate