Mercurial > hg > CommandParser
view tests/simpleexample.py @ 13:6ffd095cf5dd
add TODO
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 17 May 2013 02:06:30 -0700 |
parents | e0a3148e67a8 |
children |
line wrap: on
line source
#!/usr/bin/env python class Foo(object): """silly class that does nothing""" def __init__(self): pass def foo(self, value): print "The value is %s" % value def bar(self, fleem, verbose=False): """ The good ole `bar` command - fleem: you know, that thing fleem - verbose: whether to print out more things or not """ if verbose: print "You gave fleem=%s" % fleem return fleem * 2 import commandparser parser = commandparser.CommandParser(Foo) parser.invoke()