-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsolarchive.py
executable file
·39 lines (33 loc) · 975 Bytes
/
solarchive.py
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
29
30
31
32
33
34
35
36
37
38
39
#! /usr/bin/python2
from pprint import pprint
import click
from solarchive.lifepath import Lifepath
from solarchive.application import app
from solarchive.apiv10.app import api_bp
@click.group()
def cli():
"""The Eclipse Phase Companion Software"""
@cli.command()
@click.option("--step", default=-1, help='Show this step on debug')
@click.option("--debug", is_flag=True, help="Only print the last step")
def lifepath(debug, step):
"""Create a character with the lifepath system"""
path = Lifepath()
path.start_path()
if debug:
if step > 1:
pprint(path.char.get(step, {}))
else:
pprint(path.char)
else:
click.echo(path.char)
@cli.command()
@click.option("--debug", is_flag=True, help="Start server with debug mode")
def web(debug):
app.register_blueprint(api_bp, url_prefix="/api/v1.0")
if debug:
app.run(debug=True)
else:
app.run()
if __name__ == '__main__':
cli()