forked from IndieSmiths/nodezator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
44 lines (30 loc) · 983 Bytes
/
main.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
40
41
42
43
44
import sys
import asyncio
NATIVE_FILE_EXTENSION = '.ndz'
if __name__ == "__main__":
### parse arguments received, looking for a filepath
### (or using None instead, a filepath wasn't provided)
## import argument parser
from argparse import ArgumentParser
## instantiate and configure it
parser = ArgumentParser(
description = " - Python Node Editor"
)
parser.add_argument(
'filepath',
type = str,
nargs = '?',
default = None,
help = (
"path of "
+ NATIVE_FILE_EXTENSION
+ " file to be loaded."
)
)
## parse arguments
args = parser.parse_args()
### finally call the main function, passing along
### the filepath argument received (which might be the
### default, None)
from nodezator.mainloop import run_app
asyncio.run(run_app(args.filepath))