Skip to content

Commit 02d5f86

Browse files
authored
Merge pull request #1503 from stonebig/master
remove useless complexity: "working_directory" program generator
2 parents 9f85cca + 719a36f commit 02d5f86

4 files changed

+8
-24
lines changed

make.py

-24
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@
3131
def find_7zip_executable() -> str:
3232
"""
3333
Locates the 7-Zip executable (7z.exe) in common installation directories.
34-
35-
Raises:
36-
RuntimeError: If 7-Zip executable is not found.
37-
38-
Returns:
39-
str: Path to the 7-Zip executable.
4034
"""
4135
program_files_dirs = [
4236
Path(r"C:\Program Files"),
@@ -116,11 +110,6 @@ def build_installer_7zip(
116110
def _copy_items(source_dirs: list[Path], target_dir: Path, verbose: bool = False):
117111
"""
118112
Copies items from source directories to the target directory.
119-
120-
Args:
121-
source_dirs: List of source directories to copy items from.
122-
target_dir: Target directory to copy items to.
123-
verbose: Enable verbose output.
124113
"""
125114
target_dir.mkdir(parents=True, exist_ok=True)
126115
for source_dir in source_dirs:
@@ -538,19 +527,6 @@ def _create_standard_batch_scripts(self):
538527
if self.distribution and (Path(self.distribution.target) / r"lib-python\3\idlelib").is_dir():
539528
batch_replacements.append((r"\Lib\idlelib", r"\lib-python\3\idlelib"))
540529

541-
for ini_patch_script in [
542-
("make_working_directory_be_not_winpython.bat", "[active_environment", "[inactive_environment", "[inactive_environment_per_user]", "[active_environment_per_user]"),
543-
("make_working_directory_be_winpython.bat", "[active_environment", "[inactive_environment"),
544-
("make_working_directory_and_userprofile_be_winpython.bat", "[active_environment", "[inactive_environment", "[inactive_environment_common]", "[active_environment_common]")
545-
]:
546-
name, patch1_start, patch1_end, *patch2 = ini_patch_script
547-
content = f"""call "%~dp0env_for_icons.bat"
548-
"%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\\settings\winpython.ini', '{patch1_start}', '{patch1_end}' )"
549-
"""
550-
if patch2:
551-
content += f""""%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\\settings\winpython.ini', '{patch2[0]}', '{patch2[1]}' )" """
552-
self.create_batch_script(name, content)
553-
554530
self._print_action_done()
555531

556532

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
call "%~dp0env_for_icons.bat"
2+
"%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\settings\winpython.ini', '[active_environment', '[inactive_environment' )"
3+
"%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\settings\winpython.ini', '[inactive_environment_common]', '[active_environment_common]' )"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
call "%~dp0env_for_icons.bat"
2+
"%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\settings\winpython.ini', '[active_environment', '[inactive_environment' )"
3+
"%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\settings\winpython.ini', '[inactive_environment_per_user]', '[active_environment_per_user]' )"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
call "%~dp0env_for_icons.bat"
2+
"%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\settings\winpython.ini', '[active_environment', '[inactive_environment' )"

0 commit comments

Comments
 (0)