summaryrefslogtreecommitdiffstats
path: root/bindings/lang_python.py
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2008-04-29 12:09:03 +0000
committerFrederic Peters <fpeters@entrouvert.com>2008-04-29 12:09:03 +0000
commitfee93704e014a6fe7fa825aa3bcf01e4d1d43f2e (patch)
tree83e57468895de7756126c99756521e468a7519ac /bindings/lang_python.py
parent2a7d065cc3fb42e7f9517f52b215de5b4bf434b9 (diff)
downloadlasso-fee93704e014a6fe7fa825aa3bcf01e4d1d43f2e.tar.gz
lasso-fee93704e014a6fe7fa825aa3bcf01e4d1d43f2e.tar.xz
lasso-fee93704e014a6fe7fa825aa3bcf01e4d1d43f2e.zip
[project @ fpeters@0d.be-20080404131647-lb7jty8pp3tjcmny]
added handling of other constructors, and backward compatibility for lasso.DiscoDescription_newWithBriefSoapHttpDescription Original author: Frederic Peters <fpeters@0d.be> Date: 2008-04-04 15:16:47.595000+02:00
Diffstat (limited to 'bindings/lang_python.py')
-rw-r--r--bindings/lang_python.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bindings/lang_python.py b/bindings/lang_python.py
index 687f351d..4c2331f5 100644
--- a/bindings/lang_python.py
+++ b/bindings/lang_python.py
@@ -211,6 +211,7 @@ MiscTextNode.text_child = MiscTextNode.textChild
NodeList = list
StringList = list
StringDict = dict
+DiscoDescription_newWithBriefSoapHttpDescription = DiscoDescription.newWithBriefSoapHttpDescription
'''
def generate_constants(self, fd):
@@ -272,7 +273,8 @@ StringDict = dict
print >> fd, ''
for m in self.binding_data.functions:
- if m.name == method_prefix + 'new_from_dump':
+ if m.name.startswith(method_prefix + 'new_'):
+ constructor_name = utils.format_as_camelcase(m.name[len(method_prefix):])
c_args = []
py_args = []
for o in m.args:
@@ -289,15 +291,13 @@ StringDict = dict
c_args = ', '.join(c_args)
py_args = ', ' + ', '.join(py_args)
print >> fd, ' @classmethod'
- print >> fd, ' def newFromDump(cls%s):' % py_args
+ print >> fd, ' def %s(cls%s):' % (constructor_name, py_args)
print >> fd, ' obj = cls.__new__(cls)'
print >> fd, ' obj._cptr = _lasso.%s(%s)' % (m.name[6:], c_args)
print >> fd, ' if obj._cptr is None:'
- print >> fd, ' raise "XXX"'
+ print >> fd, ' raise RuntimeError(\'lasso failed to create object\')'
print >> fd, ' return obj'
print >> fd, ''
- elif m.name == method_prefix + 'new_full':
- pass
# create properties for members
for m in clss.members: