Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc74822

Browse files
committed
remove unused create_python_launcher_batch
1 parent 2c4cd94 commit dc74822

File tree

1 file changed

+10
-36
lines changed

1 file changed

+10
-36
lines changed

make.py

+10-36
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ def _copy_items(source_dirs: list[Path], target_dir: Path, verbose: bool = False
124124
except Exception as e:
125125
print(f"Error copying {source_item} to {target_item}: {e}")
126126

127+
128+
def _parse_list_argument(arg_value: str | list[str], separator=" ") -> list[str]:
129+
"""Parse a separated list argument into a list of strings."""
130+
if arg_value is None:
131+
return []
132+
if isinstance(arg_value, str):
133+
return arg_value.split(separator)
134+
return list(arg_value)
135+
136+
127137
class WinPythonDistributionBuilder:
128138
"Builds a WinPython distribution."
129139

@@ -342,33 +352,6 @@ def create_batch_script(self, name: str, contents: str, replacements: list[tuple
342352
f.write(final_contents)
343353
print(f"Created batch script: {script_path}")
344354

345-
def create_python_launcher_batch(
346-
self,
347-
name: str,
348-
script_name: str,
349-
working_dir: str = None,
350-
options: str = None,
351-
command: str = None,
352-
):
353-
"""
354-
Creates a batch file to launch a Python script within the WinPython environment.
355-
356-
Args:
357-
name: The name of the batch file.
358-
script_name: The name of the Python script to execute.
359-
working_dir: Optional working directory for the script.
360-
options: Optional command-line options for the script.
361-
command: Optional command to execute python, defaults to python.exe or pythonw.exe
362-
"""
363-
options_str = f" {options}" if options else ""
364-
if command is None:
365-
command = '"%WINPYDIR%\\pythonw.exe"' if script_name.endswith(".pyw") else '"%WINPYDIR%\\python.exe"'
366-
change_dir_cmd = f"cd /D {working_dir}\n" if working_dir else ""
367-
script_name_str = f" {script_name}" if script_name else ""
368-
batch_content = f"""@echo off
369-
call "%~dp0env_for_icons.bat"
370-
{change_dir_cmd}{command}{script_name_str}{options_str} %*"""
371-
self.create_batch_script(name, batch_content)
372355

373356
def create_installer_7zip(self, installer_type: str = ".exe"):
374357
"""
@@ -568,15 +551,6 @@ def rebuild_winpython_package(source_dir: Path, target_dir: Path, architecture:
568551
utils.buildflit_wininst(source_dir, copy_to=target_dir, verbose=verbose)
569552

570553

571-
def _parse_list_argument(arg_value: str | list[str], separator=" ") -> list[str]:
572-
"""Parse a separated list argument into a list of strings."""
573-
if arg_value is None:
574-
return []
575-
if isinstance(arg_value, str):
576-
return arg_value.split(separator)
577-
return list(arg_value)
578-
579-
580554
def make_all(
581555
build_number: int,
582556
release_level: str,

0 commit comments

Comments
 (0)