view tests/simpleexample.py @ 17:77fa5ce8072d default tip

bump version
author Jeff Hammel <k0scist@gmail.com>
date Sun, 19 Feb 2017 21:05:55 -0800
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()