-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathenv.py
More file actions
60 lines (40 loc) · 1.34 KB
/
env.py
File metadata and controls
60 lines (40 loc) · 1.34 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
import sys
import os
projectName = "example"
# noinspection PyPep8Naming
def _scriptsPath():
if sys.platform.startswith("win"):
return os.path.join('.', 'venv', "Scripts")
return os.path.join('.', 'venv', "bin")
# noinspection PyPep8Naming
def _pathSeparator():
if sys.platform.startswith("darwin"):
return ":"
return ";"
def pip():
return os.path.join(_scriptsPath(), 'pip')
def pyinstaller():
return os.path.join(_scriptsPath(), 'pyinstaller')
def nuitka():
if sys.platform.startswith("win"):
return os.path.join(_scriptsPath(), 'nuitka.bat')
return os.path.join(_scriptsPath(), 'nuitka')
def python():
return os.path.join(_scriptsPath(), 'python')
def pyside6_rcc():
return os.path.join(_scriptsPath(), 'pyside6-rcc')
# noinspection SpellCheckingInspection
def pyside6_lupdate():
return os.path.join(_scriptsPath(), 'pyside6-lupdate')
# noinspection SpellCheckingInspection
def pyside6_lrelease():
return os.path.join(_scriptsPath(), 'pyside6-lrelease')
# noinspection PyPep8Naming
def environment():
environ = os.environ.copy()
current = os.environ.get('PYTHONPATH', '')
workPath = os.path.dirname(os.path.abspath(__file__))
if current != '':
workPath = workPath + _pathSeparator() + current
environ["PYTHONPATH"] = workPath
return environ