tests/test_cmd.py
author Andrey Vlasovskikh <andrey.vlasovskikh@gmail.com>
Tue, 19 Oct 2010 17:45:55 +0400
changeset 126 7a5c5746d4f0
parent 96 82aaeccffbec
permissions -rw-r--r--
Explicit use of Python 2 for Arch Linux

#!/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()