t2 py from opster import command command usage name -p --pptx -x --xsl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#############################
# t2.py:
#############################
from opster import command
a = 0
@command(usage="%name [-p|--pptx] [-x|--xslx] [-w|--wrdx] [-a|--abstract]")
def main(pptx=('p', False, 'should we generate pptx related code'),
xslx=('x', False, 'should we generate xslx related code'),
wrdx=('w', False, 'should we generate wrdx related code'),
abstract=('a', False, 'should we generate abstract ifaces')):
"""
Code generation tool. Run without params to regenerate all the code
"""
global a
a = 42
#############################
# tests.py:
#############################
import t2
def test_one():
t2.main()
assert t2.a == 42, "WTF???"
# run this with nosetests -s