Mercurial > hg > CommandParser
view tests/simpleexample.py @ 12:e0a3148e67a8
bug fix and a short overhaul of documentation
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 28 Jan 2013 19:54:36 -0800 |
parents | |
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()