@@ -636,12 +636,6 @@ def _create_initial_batch_scripts(self):
636636"""
637637 self .create_batch_script ("WinPython_PS_Prompt.ps1" , ps1_content , replacements = batch_replacements )
638638
639- cmd_ps_bat_content = r"""@echo off
640- call "%~dp0env_for_icons.bat"
641- Powershell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -noexit -File ""%~dp0WinPython_PS_Prompt.ps1""'}"
642- """
643- self .create_batch_script ("cmd_ps.bat" , cmd_ps_bat_content , replacements = batch_replacements )
644-
645639
646640 env_for_icons_bat_content = r"""@echo off
647641call "%~dp0env.bat"
@@ -703,34 +697,11 @@ def _create_standard_batch_scripts(self):
703697 if self .distribution and (Path (self .distribution .target ) / r"lib-python\3\idlelib" ).is_dir ():
704698 batch_replacements .append ((r"\Lib\idlelib" , r"\lib-python\3\idlelib" ))
705699
706-
707700 self .create_batch_script ("readme.txt" , """These batch files are required to run WinPython icons.
708701These files should help the user writing his/her own
709702The environment variables are set-up in 'env.bat' and 'env_for_icons.bat'.""" ,
710703 )
711704
712- self .create_batch_script (
713- "make_winpython_movable.bat" ,
714- r"""@echo off
715- call "%~dp0env.bat"
716- echo patch pip and current launchers for move
717-
718- "%WINPYDIR%\python.exe" -c "from winpython import wppm;dist=wppm.Distribution(r'%WINPYDIR%');dist.patch_standard_packages('pip', to_movable=True)"
719- pause""" ,
720- replacements = batch_replacements
721- )
722-
723- self .create_batch_script (
724- "make_winpython_fix.bat" ,
725- r"""@echo off
726- call "%~dp0env.bat"
727- echo patch pip and current launchers for non-move
728-
729- "%WINPYDIR%\python.exe" -c "from winpython import wppm;dist=wppm.Distribution(r'%WINPYDIR%');dist.patch_standard_packages('pip', to_movable=False)"
730- pause""" ,
731- replacements = batch_replacements
732- )
733-
734705 for ini_patch_script in [
735706 ("make_working_directory_be_not_winpython.bat" , "[active_environment" , "[inactive_environment" , "[inactive_environment_per_user]" , "[active_environment_per_user]" ),
736707 ("make_working_directory_be_winpython.bat" , "[active_environment" , "[inactive_environment" ),
@@ -744,119 +715,6 @@ def _create_standard_batch_scripts(self):
744715 content += f""""%PYTHON%" -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%~dp0..\\ settings\winpython.ini', '{ patch2 [0 ]} ', '{ patch2 [1 ]} ' )" """
745716 self .create_batch_script (name , content )
746717
747-
748- self .create_batch_script ("cmd.bat" , r"""@echo off
749- call "%~dp0env_for_icons.bat" %*
750- cmd.exe /k""" , replacements = batch_replacements )
751-
752- self .create_batch_script ("WinPython_Terminal.bat" , r"""@echo off
753- Powershell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -noexit -File ""%~dp0WinPython_PS_Prompt.ps1""'}"
754- exit""" , replacements = batch_replacements )
755-
756- self .create_batch_script ("python.bat" , r"""@echo off
757- call "%~dp0env_for_icons.bat" %*
758- "%WINPYDIR%\python.exe" %*""" , replacements = batch_replacements )
759-
760- self .create_batch_script (
761- "winpython.bat" ,
762- r"""@echo off
763- call "%~dp0env_for_icons.bat" %*
764- rem backward compatibility for non-ptpython users
765- if exist "%WINPYDIR%\scripts\ptpython.exe" (
766- "%WINPYDIR%\scripts\ptpython.exe" %*
767- ) else (
768- "%WINPYDIR%\python.exe" %*
769- )""" ,
770- replacements = batch_replacements
771- )
772-
773- self .create_batch_script (
774- "winidle.bat" ,
775- r"""@echo off
776- call "%~dp0env_for_icons.bat" %*
777- "%WINPYDIR%\python.exe" "%WINPYDIR%\Lib\idlelib\idle.pyw" %*""" ,
778- replacements = batch_replacements
779- )
780-
781- self .create_batch_script (
782- "winspyder.bat" ,
783- r"""@echo off
784- call "%~dp0env_for_icons.bat" %*
785- "%WINPYDIR%\scripts\spyder.exe" %* -w "%WINPYWORKDIR1%" """ ,
786- )
787-
788- self .create_batch_script (
789- "spyder_reset.bat" ,
790- r"""@echo off
791- call "%~dp0env_for_icons.bat"
792- "%WINPYDIR%\scripts\spyder.exe" --reset %*""" ,
793- )
794-
795- for jupyter_script in [
796- ("winipython_notebook.bat" , "jupyter-notebook.exe" ),
797- ("winjupyter_lab.bat" , "jupyter-lab.exe" ),
798- ("winqtconsole.bat" , "jupyter-qtconsole.exe" ),
799- ]:
800- name , exe = jupyter_script
801- self .create_batch_script (name , f"""@echo off
802- call "%~dp0env_for_icons.bat" %*
803- "%WINPYDIR%\\ scripts\\ { exe } " %*""" )
804-
805-
806- self .create_python_launcher_batch (
807- "register_python.bat" ,
808- r'"%WINPYDIR%\Lib\site-packages\winpython\register_python.py"' ,
809- working_dir = r'"%WINPYDIR%\Scripts"' ,
810- )
811-
812- self .create_python_launcher_batch (
813- "unregister_python.bat" ,
814- r'"%WINPYDIR%\Lib\site-packages\winpython\unregister_python.py"' ,
815- working_dir = r'"%WINPYDIR%\Scripts"' ,
816- )
817-
818- for register_all_script in [
819- ("register_python_for_all.bat" , "register_python.bat" ),
820- ("unregister_python_for_all.bat" , "unregister_python.bat" ),
821- ]:
822- name , base_script = register_all_script
823- self .create_batch_script (name , f"""@echo off
824- call "%~dp0env.bat"
825- call "%~dp0{ base_script } " --all""" )
826-
827-
828- self .create_batch_script ("wpcp.bat" , r"""@echo off
829- call "%~dp0env_for_icons.bat" %*
830- cmd.exe /k "echo wppm & wppm" """ , replacements = batch_replacements )
831-
832- self .create_batch_script (
833- "upgrade_pip.bat" ,
834- r"""@echo off
835- call "%~dp0env.bat"
836- echo this will upgrade pip with latest version, then patch it for WinPython portability ok ?
837- pause
838- "%WINPYDIR%\python.exe" -m pip install --upgrade pip
839- "%WINPYDIR%\python.exe" -c "from winpython import wppm;dist=wppm.Distribution(r'%WINPYDIR%');dist.patch_standard_packages('pip', to_movable=True)
840- pause""" ,
841- replacements = batch_replacements
842- )
843-
844- self .create_batch_script ("activate.bat" , r"""@echo off
845- call "%~dp0env.bat" %*""" , replacements = batch_replacements )
846-
847-
848- vscode_bat_content = r"""@echo off
849- call "%~dp0env_for_icons.bat"
850- if exist "%WINPYDIR%\..\t\vscode\code.exe" (
851- "%WINPYDIR%\..\t\vscode\code.exe" %*
852- ) else (
853- if exist "%LOCALAPPDATA%\Programs\Microsoft VS Code\code.exe" (
854- "%LOCALAPPDATA%\Programs\Microsoft VS Code\code.exe" %*
855- ) else (
856- "code.exe" %*
857- ))"""
858- self .create_batch_script ("winvscode.bat" , vscode_bat_content )
859-
860718 self ._print_action_done ()
861719
862720
0 commit comments