@@ -124,6 +124,16 @@ def _copy_items(source_dirs: list[Path], target_dir: Path, verbose: bool = False
124
124
except Exception as e :
125
125
print (f"Error copying { source_item } to { target_item } : { e } " )
126
126
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
+
127
137
class WinPythonDistributionBuilder :
128
138
"Builds a WinPython distribution."
129
139
@@ -342,33 +352,6 @@ def create_batch_script(self, name: str, contents: str, replacements: list[tuple
342
352
f .write (final_contents )
343
353
print (f"Created batch script: { script_path } " )
344
354
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 )
372
355
373
356
def create_installer_7zip (self , installer_type : str = ".exe" ):
374
357
"""
@@ -568,15 +551,6 @@ def rebuild_winpython_package(source_dir: Path, target_dir: Path, architecture:
568
551
utils .buildflit_wininst (source_dir , copy_to = target_dir , verbose = verbose )
569
552
570
553
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
-
580
554
def make_all (
581
555
build_number : int ,
582
556
release_level : str ,
0 commit comments