Re: general xmlrpc
Helge Hess <[email protected]>
| Newsgroups | gmane.comp.cms.opengroupware.xmlrpc.devel |
|---|---|
| Message-ID | <[email protected]> |
On 19. Feb 2005, at 01:59 Uhr, Chris H wrote:
> Create user? [Y/n]: Y
> Traceback (most recent call last):
> File
> "/home/chris123/Downloads/OGo_stuff/python_scripts/ogo_add_user.py",
> line 110, in ?
> returnCode = tool.run()
> File
> "/home/chris123/Downloads/OGo_stuff/python_scripts/ogo_add_user.py",
> line 97, in run
> result = self.addUserToSystem()
> File
> "/home/chris123/Downloads/OGo_stuff/python_scripts/ogo_add_user.py",
> line 76, in addUserToSystem
> print "==> created account %s with ID %s" % (result['login'],
> KeyError: 'companyId'
Thats weird. Can you send us the output if you insert this line prior
the breaking print in line 75:
---
print "===> CREATED DICT:", result, type(result)
---
before the call which breaks.
Thanks,
Helge
PS: this can be written better:
---
print "==> created account %s with ID %s" %
(result['login'],
result['companyId'])
---
as:
---
print "==> created account %(login)s with ID %(companyId)s" % result
---
Python format strings have builtin support for dicts :-)
--
http://docs.opengroupware.org/Members/helge/
OpenGroupware.org
--
OpenGroupware.org XML-RPC
[email protected]
http://mail.opengroupware.org/mailman/listinfo/xmlrpc