--- a/test.py Thu Sep 03 22:06:14 2009 +0300
+++ b/test.py Thu Sep 03 22:14:59 2009 +0300
@@ -36,8 +36,6 @@
sys.exit(opts['exit'])
def ui_middleware(func):
- if func.__name__ == 'help_inner':
- return func
def extract_dict(source, *keys):
dest = {}
for k in keys:
@@ -45,7 +43,10 @@
return dest
def inner(*args, **kwargs):
- ui = UI(**extract_dict(kwargs, 'verbose', 'quiet'))
+ opts = extract_dict(kwargs, 'verbose', 'quiet')
+ if func.__name__ == 'help_inner':
+ return func(*args, **kwargs)
+ ui = UI(**opts)
return func(ui, *args, **kwargs)
return inner