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

Skip to content

Commit 5f8519e

Browse files
committed
further gemini inclusion
1 parent 5cf9433 commit 5f8519e

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

make.py

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,12 @@ def _create_launchers(self):
500500
"""Create launchers"""
501501
self._print_action("Creating launchers")
502502
# 2025-01-04: copy launchers premade per the Datalab-Python way
503-
portable_dir = Path(__file__).resolve().parent / "portable" / "launchers_final"
504-
for path in portable_dir.rglob('*.exe'):
505-
shutil.copy2(path, self.winpy_dir)
506-
print("new way !!!!!!!!!!!!!!!!!! ", path , " -> ",self.winpy_dir)
507-
for path in (Path(__file__).resolve().parent / "portable").rglob('licence*.*'):
508-
shutil.copy2(path, self.winpy_dir)
503+
launchers_source_dir = PORTABLE_DIR / "launchers_final"
504+
for item in launchers_source_dir.rglob('*.exe'):
505+
shutil.copy2(item, self.winpy_dir)
506+
print("new way !!!!!!!!!!!!!!!!!! ", item , " -> ",self.winpy_dir)
507+
for item in launchers_source_dir.rglob('licence*.*'):
508+
shutil.copy2(item, self.winpy_dir)
509509
self._print_action_done()
510510

511511

@@ -567,9 +567,9 @@ def _create_initial_batch_scripts(self):
567567
rem force default pyqt5 kit for Spyder if PyQt5 module is there
568568
if exist "%WINPYDIR%\\Lib\\site-packages\\PyQt5\\__init__.py" set QT_API=pyqt5
569569
"""
570-
571570
self.create_batch_script("env.bat", env_bat_content, replacements=batch_replacements)
572571

572+
573573
ps1_content = r"""### WinPython_PS_Prompt.ps1 ###
574574
$0 = $myInvocation.MyCommand.Definition
575575
$dp0 = [System.IO.Path]::GetDirectoryName($0)
@@ -615,11 +615,10 @@ def _create_initial_batch_scripts(self):
615615
Param([int]$x=$host.ui.rawui.windowsize.width,
616616
[int]$y=$host.ui.rawui.windowsize.heigth,
617617
[int]$buffer=$host.UI.RawUI.BufferSize.heigth)
618-
619618
$buffersize = new-object System.Management.Automation.Host.Size($x,$buffer)
620619
$host.UI.RawUI.BufferSize = $buffersize
621620
$size = New-Object System.Management.Automation.Host.Size($x,$y)
622-
$host.ui.rawui.WindowSize = $size
621+
$host.ui.rawui.WindowSize = $size
623622
}
624623
# Windows10 yelling at us with 150 40 6000
625624
# Set-WindowSize 195 40 6000
@@ -629,16 +628,15 @@ def _create_initial_batch_scripts(self):
629628
$host.ui.RawUI.ForegroundColor = "White"
630629
}
631630
"""
632-
633631
self.create_batch_script("WinPython_PS_Prompt.ps1", ps1_content, replacements=batch_replacements)
634632

635-
636633
cmd_ps_bat_content = r"""@echo off
637634
call "%~dp0env_for_icons.bat"
638635
Powershell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -noexit -File ""%~dp0WinPython_PS_Prompt.ps1""'}"
639636
"""
640637
self.create_batch_script("cmd_ps.bat", cmd_ps_bat_content, replacements=batch_replacements)
641638

639+
642640
env_for_icons_bat_content = r"""@echo off
643641
call "%~dp0env.bat"
644642
@@ -675,15 +673,12 @@ def _create_initial_batch_scripts(self):
675673
if not "%WINPYWORKDIR%"=="" if not exist "%WINPYWORKDIR%" mkdir "%WINPYWORKDIR%"
676674
if not "%WINPYWORKDIR1%"=="" if not exist "%WINPYWORKDIR1%" mkdir "%WINPYWORKDIR1%"
677675
678-
679676
rem Change of directory only if we are in a launcher directory
680677
if "%__CD__%scripts\"=="%~dp0" cd/D %WINPYWORKDIR1%
681678
if "%__CD__%"=="%~dp0" cd/D %WINPYWORKDIR1%
682679
683-
684680
if not exist "%HOME%\.spyder-py%WINPYVER:~0,1%" mkdir "%HOME%\.spyder-py%WINPYVER:~0,1%"
685681
if not exist "%HOME%\.spyder-py%WINPYVER:~0,1%\workingdir" echo %HOME%\Notebooks>"%HOME%\.spyder-py%WINPYVER:~0,1%\workingdir"
686-
687682
"""
688683
self.create_batch_script("env_for_icons.bat", env_for_icons_bat_content, replacements=batch_replacements)
689684

@@ -745,12 +740,12 @@ def main():
745740
import sys
746741
args = sys.argv[1:]
747742
file_name = args[0] if args else "..\\settings\\winpython.ini"
748-
743+
749744
my_lines = get_file(file_name).splitlines()
750745
segment = "environment"
751746
txt = ""
752747
env = os.environ.copy() # later_version: env = os.environ
753-
748+
754749
# default directories (from .bat)
755750
os.makedirs(Path(env['WINPYDIRBASE']) / 'settings' / 'Appdata' / 'Roaming', exist_ok=True)
756751
@@ -779,7 +774,7 @@ def main():
779774
env[data[0].strip()] = translate(data[1].strip(), env)
780775
if segment == "debug" and data[0].strip() == "state":
781776
txt += f"set WINPYDEBUG={data[1].strip()}&&"
782-
777+
783778
print(txt)
784779
785780
# set potential directory
@@ -812,7 +807,6 @@ def _create_standard_batch_scripts(self):
812807

813808

814809
self.create_batch_script("readme.txt", """These batch files are required to run WinPython icons.
815-
816810
These files should help the user writing his/her own
817811
specific batch file to call Python scripts inside WinPython.
818812
The environment variables are set-up in 'env_.bat' and 'env_for_icons.bat'.""",
@@ -991,6 +985,7 @@ def _run_complementary_batch_scripts(self, script_name="run_complement.bat"):
991985
self._print_action(f"Execution failed: {e}!")
992986
self._print_action_done()
993987

988+
994989
def make(
995990
self,
996991
remove_existing=True,
@@ -1024,16 +1019,12 @@ def make(
10241019
self._extract_python_archive()
10251020

10261021
self._print_action_done()
1027-
10281022
self.distribution = wppm.Distribution(
10291023
self.python_executable_dir,
10301024
verbose=self.verbose,
10311025
indent=True,
10321026
)
10331027

1034-
1035-
1036-
10371028
# Assert that WinPython version and real python version do match
10381029
self._print_action(
10391030
f"Python version{self.python_full_version.replace('.','')}"
@@ -1050,8 +1041,8 @@ def make(
10501041
self._create_standard_batch_scripts()
10511042
self._create_launchers()
10521043
utils.python_execmodule("ensurepip", self.distribution.target) # Ensure pip is installed for PyPy
1053-
10541044
self.distribution.patch_standard_packages("pip")
1045+
10551046
# Upgrade essential packages
10561047
essential_packages = ["pip", "setuptools", "wheel", "winpython"]
10571048
for package_name in essential_packages:
@@ -1074,6 +1065,7 @@ def make(
10741065
print(f"piping {' '.join(actions)}")
10751066
self._print_action(f"piping {' '.join(actions)}")
10761067
self.distribution.do_pip_action(actions)
1068+
10771069
self._run_complementary_batch_scripts()
10781070
self.distribution.patch_standard_packages()
10791071

@@ -1094,6 +1086,7 @@ def make(
10941086
)
10951087
open(fname, "w", encoding='utf-8').write(self.package_index_markdown)
10961088
# Copy to winpython/changelogs
1089+
10971090
shutil.copyfile(
10981091
fname,
10991092
str(Path(CHANGELOGS_DIR) / Path(fname).name),
@@ -1272,4 +1265,4 @@ def make_all(
12721265
source_dirs=r"D:\WinPython\basedir34\packages.win-amd64",
12731266
toolsdirs=r"D:\WinPython\basedir34\t.Slim",
12741267
docsdirs=r"D:\WinPython\basedir34\docs.Slim",
1275-
)
1268+
)

0 commit comments

Comments
 (0)