From: Ralf S. <rs...@ru...> - 2011-08-11 10:52:27
|
On Thu, Aug 11, 2011 at 12:29:29PM +0200, Ewald Zietsman wrote: > Hi, > > > I'm trying to access a roundup server using its XML-RPC interface. I can > create a new issue but I want to also add a message body to the issue. How > can I achieve this? > > from python I'm trying something like the following: > > roundup_server.create('issue', 'title="A new message from python!"', > 'message="hello!"') > > but this obviously doesn't work. Any help will be greatly appreciated. the following works for me (directly typed into python interpreter): >>> import xmlrpclib >>> pw = 'secret' >>> user = 'admin' >>> url = 'http://%(user)s:%(pw)s@bee:8080/ttt/' >>> s = xmlrpclib.ServerProxy(url % locals (), allow_none=True) >>> msg = s.create ("msg", 'subject=hello', 'content=Hello world') >>> msg '211691' >>> issue = s.create ("issue", 'messages=%s'%msg, 'title=Hello', 'release=1', 'responsible=117') >>> issue '35353' You will have to change pw, user and url (hostname and port). Of course the parameters of your issue class may vary (release and responsible aren't attributes of issue in the standard roundup tracker) Hope that helps... Ralf -- Dr. Ralf Schlatterbeck Tel: +43/2243/26465-16 Open Source Consulting www: http://www.runtux.com Reichergasse 131, A-3411 Weidling email: of...@ru... osAlliance member email: rs...@os... |