test_cmd.py
author Alexander Solovyov <piranha@piranha.org.ua>
Sun, 27 Sep 2009 23:24:44 +0300
changeset 94 0178aca18a6d
parent 91 a0f2747f4a3d
permissions -rwxr-xr-x
backward incompatible change: require argv=sys.argv[1:] for @wrapped command to parse command line

#!/usr/bin/env python

import opster

config_opts=[('c', 'config', 'webshops.ini', 'config file to use')]

@opster.command(config_opts)
def initdb(config):
    """Initialize database"""
    pass

@opster.command(config_opts)
def runserver(listen=('l', 'localhost', 'ip to listen on'),
              port=('p', 5000, 'port to listen on'),
              **opts):
    """Run development server"""
    print locals()

if __name__ == '__main__':
    opster.dispatch()