|
7 | 7 | winpython_inidefault=r''' |
8 | 8 | [debug] |
9 | 9 | state = disabled |
| 10 | +[env.bat] |
| 11 | +#PYTHONPATHz = %WINPYDIR%;%WINPYDIR%\Lib;%WINPYDIR%\DLLs |
| 12 | +#see https://github.com/winpython/winpython/issues/839 |
| 13 | +#USERPROFILE = %HOME% |
| 14 | +#PYTHONUTF8=1 creates issues in "movable" patching |
| 15 | +SPYDER_CONFDIR = %HOME%\settings\.spyder-py3 |
| 16 | +JUPYTER_DATA_DIR = %HOME% |
| 17 | +JUPYTER_CONFIG_DIR = %WINPYDIR%\etc\jupyter |
| 18 | +JUPYTER_CONFIG_PATH = %WINPYDIR%\etc\jupyter |
10 | 19 | [inactive_environment_per_user] |
11 | 20 | ## <?> changing this segment to [active_environment_per_user] makes this segment of lines active or not |
12 | 21 | HOME = %HOMEDRIVE%%HOMEPATH%\Documents\WinPython%WINPYVER%\settings |
@@ -39,7 +48,7 @@ def get_file(file_name): |
39 | 48 | with open(file_name, 'r') as file: |
40 | 49 | return file.read() |
41 | 50 | except FileNotFoundError: |
42 | | - if file_name[-3:] == 'ini': |
| 51 | + if file_name.endswith("winpython.ini"): |
43 | 52 | os.makedirs(Path(file_name).parent, exist_ok=True) |
44 | 53 | with open(file_name, 'w') as file: |
45 | 54 | file.write(winpython_inidefault) |
@@ -77,19 +86,20 @@ def main(): |
77 | 86 | if not (p / 'qt.conf').is_file(): |
78 | 87 | with open(p / 'qt.conf', 'w') as file: |
79 | 88 | file.write(qt_conf) |
80 | | - |
| 89 | + prefix , postfix = "set ", "&& " |
| 90 | + #prefix , postfix = "set ", "\n" |
81 | 91 | for l in my_lines: |
82 | 92 | if l.startswith("["): |
83 | 93 | segment = l[1:].split("]")[0] |
84 | 94 | elif not l.startswith("#") and "=" in l: |
85 | 95 | data = l.split("=", 1) |
86 | 96 | if segment == "debug" and data[0].strip() == "state": |
87 | 97 | data[0] = "WINPYDEBUG" |
88 | | - if segment in ["environment", "debug", "active_environment_per_user", "active_environment_common"]: |
89 | | - txt += f"set {data[0].strip()}={translate(data[1].strip(), env)}&& " |
| 98 | + if segment in ["env.bat", "environment", "debug", "active_environment_per_user", "active_environment_common"]: |
| 99 | + txt += f"{prefix}{data[0].strip()}={translate(data[1].strip(), env)}{postfix}" |
90 | 100 | env[data[0].strip()] = translate(data[1].strip(), env) |
91 | 101 | if segment == "debug" and data[0].strip() == "state": |
92 | | - txt += f"set WINPYDEBUG={data[1].strip()}&&" |
| 102 | + txt += f"{prefix}WINPYDEBUG={data[1].strip()}{postfix}" |
93 | 103 |
|
94 | 104 | print(txt) |
95 | 105 |
|
|
0 commit comments