-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathorcadev
executable file
·39 lines (29 loc) · 1.12 KB
/
orcadev
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/env python3
import os
import sys
MAJOR, MINOR = 3, 8
if __name__ != "__main__":
print("why are you importing the orca command-line tool as a Python module, you absolute goofball")
exit(1)
# NOTE: You can test our actual Python version support with this tool:
# https://github.com/netromdk/vermin
if sys.version_info.major < MAJOR or sys.version_info.minor < MINOR:
print("Your Python version is too old.")
print("Orca requires version {}.{}, but you have version {}.{}.".format(MAJOR, MINOR, sys.version_info.major, sys.version_info.minor))
exit(1)
# If you modify this, be sure to modify the version in scripts/dev.py as well.
def get_source_root():
dir = os.getcwd()
while True:
try:
os.stat(os.path.join(dir, ".orcasource"))
return dir
except FileNotFoundError:
pass
newdir = os.path.dirname(dir)
if newdir == dir:
raise Exception(f"Directory {os.getcwd()} does not seem to be part of the Orca source code.")
dir = newdir
source_dir = get_source_root()
sys.path.append(source_dir)
import scripts.orcadev