Fixed catching unnececcary exceptions
Exception Abort can't be thrown, so it is useless.
Catching SystemExit and KeyboardInterrupt makes little sense as the thread can
be terminated by KeyboardInterrupt before or after entering the wrapped command
processing function. So one have to handle these exceptions in his main function
anyway.
Catching any exception in order to print a message and re-raise it changes the
standard behaviour and might seem confusing.
#!/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()