-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassgenerator.py
More file actions
77 lines (60 loc) · 1.98 KB
/
classgenerator.py
File metadata and controls
77 lines (60 loc) · 1.98 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""main function for class generator, called at begining of program runtime.
"""
import sys
from parsing.inline import Inline
sys.path.insert(0,"C:\\Users\\Ben\\VsCode\\python")
# from parsing.inline import Inline
from utils.options import main as options_main
from generation.generator import class_generator
def main() -> int:
"""
Top level function for getting specs, parsing append generating class.
Returns:
int: success/failure signal
1 = success
0 = failure
"""
# parsed_inline = options_main()
# for items in parsed_inline:
# class_generator(items)
# return 1
generate_workflow()
# try:
# generate_workflow()
# except Exception:
# print("Error while trying to generate workflow for your project")
def generate_workflow():
try:
options = options_main()
except (NameError):
print("you did not provide a name for your project. this argument is required.")
return 0
# for file in options.inlines:
# # options.inlines += generate(file)
# print("")
# if options.config.exporting:
# []
# # export the files
status_report(options)
def status_report(workflow):
"""prints a summary of all work to be done in a session. including:
status | file name | type | members | packages | parents | notes
----------------------------------------------------------------
parsed | classA | cls | [...] | [...] | [...] | none
gen | classB | mdl | ... | error (see logs)
Args:
workflow ([type]): [description]
Returns:
1 - failure
0 - success
"""
header()
body(workflow['files'])
# need a python refresher first- isnt there some native way of doing this? with print?
def header():
print("status | file name | type | members | packages | parents | notes")
def body(files):
for f in files:
print(f)
if __name__ == '__main__':
main()