[Synopsis-changes] Synopsis/Synopsis/Synopsis Processor.py,1.10,1.11
Stefan Seefeld stefan at synopsis.fresco.orgThu Dec 4 22:21:11 UTC 2003
- Previous message: [Synopsis-changes] Synopsis/Synopsis/Synopsis/Formatters/HTML/Comments Javadoc.py,NONE,1.1 Qtdoc.py,NONE,1.1 QuoteHTML.py,NONE,1.1 Section.py,NONE,1.1 __init__.py,NONE,1.1 Formatter.py,1.23,1.24
- Next message: [Synopsis-changes] Synopsis/Synopsis/Synopsis/Formatters/HTML/Parts Heading.py,1.3,1.4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /cvs/synopsis/Synopsis/Synopsis
In directory frida:/tmp/cvs-serv3171/Synopsis
Modified Files:
Processor.py
Log Message:
pass 'verbose' and 'debug' down to child processors
Index: Processor.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/Processor.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -d -r1.10 -r1.11
--- Processor.py 22 Nov 2003 21:42:58 -0000 1.10
+++ Processor.py 4 Dec 2003 22:21:08 -0000 1.11
@@ -69,7 +69,7 @@ class Parametrized(object):
if i in self._parameters:
setattr(self, i, kwds[i])
else:
- raise TypeError, "No parameter '%s' in '%s'"%(i, self.__class__.__name__)
+ raise KeyError, "No parameter '%s' in '%s'"%(i, self.__class__.__name__)
class Processor(Parametrized):
@@ -126,7 +126,9 @@ class Composite(Processor):
def process(self, ast, **kwds):
"""apply a list of processors. The 'input' value is passed to the first
- processor only, the 'output' to the last. All other keywords are ignored."""
+ processor only, the 'output' to the last. 'verbose' and 'debug' are
+ passed down if explicitely given as named values.
+ All other keywords are ignored."""
if not self.processors:
return ast
@@ -137,27 +139,31 @@ class Composite(Processor):
my_kwds = {}
if self.input: my_kwds['input'] = self.input
if self.output: my_kwds['output'] = self.output
+ if kwds.has_key('verbose'): my_kwds['verbose'] = kwds['verbose']
+ if kwds.has_key('debug'): my_kwds['debug'] = kwds['debug']
return self.processors[0].process(ast, **my_kwds)
- # more than one processors...
+ # more than one processor...
# call the first, passing the 'input' parameter, if present
- if self.input:
- ast = self.processors[0].process(ast, input = self.input)
- else:
- ast = self.processors[0].process(ast)
+ my_kwds = {}
+ if self.input: my_kwds['input'] = self.input
+ if kwds.has_key('verbose'): my_kwds['verbose'] = kwds['verbose']
+ if kwds.has_key('debug'): my_kwds['debug'] = kwds['debug']
+ ast = self.processors[0].process(ast, **my_kwds)
# deal with all between the first and the last;
- # they don't get any params
+ # they only get 'verbose' and 'debug' flags
+ my_kwds = {}
+ if kwds.has_key('verbose'): my_kwds['verbose'] = kwds['verbose']
+ if kwds.has_key('debug'): my_kwds['debug'] = kwds['debug']
if len(self.processors) > 2:
for p in self.processors[1:-1]:
- ast = p.process(ast)
+ ast = p.process(ast, **my_kwds)
# call the last, passing the 'output' parameter, if present
- if self.output:
- ast = self.processors[-1].process(ast, output = self.output)
- else:
- ast = self.processors[-1].process(ast)
+ if self.output: my_kwds['output'] = self.output
+ ast = self.processors[-1].process(ast, **my_kwds)
return ast
- Previous message: [Synopsis-changes] Synopsis/Synopsis/Synopsis/Formatters/HTML/Comments Javadoc.py,NONE,1.1 Qtdoc.py,NONE,1.1 QuoteHTML.py,NONE,1.1 Section.py,NONE,1.1 __init__.py,NONE,1.1 Formatter.py,1.23,1.24
- Next message: [Synopsis-changes] Synopsis/Synopsis/Synopsis/Formatters/HTML/Parts Heading.py,1.3,1.4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Synopsis-changes mailing list