summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ffda162)
raw | patch | inline | side by side (parent: ffda162)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 9 Apr 2010 09:49:06 +0000 (09:49 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 9 Apr 2010 09:49:06 +0000 (09:49 +0000) |
- Allow encoding of parameters as "Binary" (this is encoded as base64 in
xmlrpc). Example:
s.create("file", "name=bla", "type=application/octet-stream",
xmlrpclib.Binary("content=\0"))
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4477 57a73879-2fb5-44c3-a270-3262357dd7e2
xmlrpc). Example:
s.create("file", "name=bla", "type=application/octet-stream",
xmlrpclib.Binary("content=\0"))
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4477 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/xmlrpc.py | patch | blob | history |
diff --git a/roundup/xmlrpc.py b/roundup/xmlrpc.py
index 88ddb34f84930b871b51a745e6eac0c8d85f743a..111a0b72442b87b849db159829dea112a1f919c2 100644 (file)
--- a/roundup/xmlrpc.py
+++ b/roundup/xmlrpc.py
from roundup.date import Date, Range, Interval
from roundup import actions
from SimpleXMLRPCServer import *
+from xmlrpclib import Binary
def translate(value):
"""Translate value to becomes valid for XMLRPC transmission."""
props = {}
for arg in args:
- if arg.find('=') == -1:
- raise UsageError, 'argument "%s" not propname=value'%arg
+ if isinstance(arg, Binary):
+ arg = arg.data
try :
key, value = arg.split('=', 1)
except ValueError :
raise UsageError, 'argument "%s" not propname=value'%arg
- if isinstance (key, unicode) :
- try :
+ if isinstance(key, unicode):
+ try:
key = key.encode ('ascii')
except UnicodeEncodeError:
raise UsageError, 'argument %r is no valid ascii keyword'%key
- if isinstance (value, unicode) :
- value = value.encode ('utf-8')
+ if isinstance(value, unicode):
+ value = value.encode('utf-8')
if value:
try:
props[key] = hyperdb.rawToHyperdb(db, cl, itemid,