Spaces:
Running
on
Zero
Running
on
Zero
File size: 887 Bytes
2f4febc |
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 40 41 42 |
import sys
import argparse
from .. import WarpCore
from .. import templates
def template_init(args):
return ''''
'''.strip()
def init_template(args):
parser = argparse.ArgumentParser(description='WarpCore template init tool')
parser.add_argument('-t', '--template', type=str, default='WarpCore')
args = parser.parse_args(args)
if args.template == 'WarpCore':
template_cls = WarpCore
else:
try:
template_cls = __import__(args.template)
except ModuleNotFoundError:
template_cls = getattr(templates, args.template)
print(template_cls)
def main():
if len(sys.argv) < 2:
print('Usage: core <command>')
sys.exit(1)
if sys.argv[1] == 'init':
init_template(sys.argv[2:])
else:
print('Unknown command')
sys.exit(1)
if __name__ == '__main__':
main()
|