--- a/opster.py Sun Oct 11 14:19:47 2009 +0300
+++ b/opster.py Mon Nov 09 23:31:37 2009 +0200
@@ -220,13 +220,13 @@
--pid-file name of file to write process ID to
<BLANKLINE>
'''
- print '%s\n' % usage
+ write(usage + '\n')
doc = func.__doc__
if not doc:
doc = '(no help text available)'
- print '%s\n' % doc.strip()
+ write(doc.strip() + '\n')
if options:
- print ''.join(help_options(options))
+ write(''.join(help_options(options)))
def help_options(options):
yield 'options:\n\n'
@@ -284,7 +284,7 @@
# copy defaults to state
if isinstance(default, list):
state[pyname] = default[:]
- elif callable(default):
+ elif hasattr(default, '__call__'):
funlist.append(pyname)
state[pyname] = None
else: