From bf22fa153c44dc29c6414f41ee63f4c6a3850b15 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Enrico=20Tr=C3=B6ger?= Date: Tue, 20 Oct 2009 21:29:32 +0200 Subject: [PATCH] Properly handle and replace wildcards --- pywsdlgen/parser.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pywsdlgen/parser.py b/pywsdlgen/parser.py index 382c320..58cbf69 100644 --- a/pywsdlgen/parser.py +++ b/pywsdlgen/parser.py @@ -86,6 +86,11 @@ class Parser(object): ports = '' operations = '' + if self.name: + name = self.name + else: + name = self.class_name + for tag, args in self.tags.items(): parts = '' result = '' @@ -108,27 +113,25 @@ class Parser(object): else: messages += '''''' % (tag) - if args['return']: - messages += '''''' % \ - (tag, args['return']) + try: + arg_type = type_map[arg_types[arguments.index('return')]] + except (ValueError, KeyError): + arg_type = '***unknown***' + messages += '''''' % \ + (tag, arg_type) ports += '''''' % \ (tag, tag, tag) - operations += ''' - - - ''' % (tag) + operations += '' \ + '' \ + '' \ + '''' % { 'name': name, 'tag': tag, 'url': self.url } fp = open(self.template_file, 'r') template = fp.read() fp.close() - if self.name: - name = self.name - else: - name = self.class_name - s = Template(template).substitute( name=name, url=self.url, -- 2.11.4.GIT