8000 Merge pull request #1410 from stonebig/master · LeeXyan/winpython@d8cfc47 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8cfc47

Browse files
authored
Merge pull request winpython#1410 from stonebig/master
remove all '.vbs' from build system
2 parents 5c2ff71 + bd52bd9 commit d8cfc47

File tree

2 files changed

+2
-69
lines changed

2 files changed

+2
-69
lines changed

make.py

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,6 @@ def _create_batch_scripts_initial(self):
878878
rem remove some potential last \
879879
if "%WINPYWORKDIR1:~-1%"=="\" set WINPYWORKDIR1=%WINPYWORKDIR1:~0,-1%
880880
881-
rem 2024-09-22 pythonify
882-
rem FOR /F "delims=" %%i IN ('cscript /nologo "%~dp0WinpythonIni.vbs"') DO set winpythontoexec=%%i
883881
FOR /F "delims=" %%i IN ('""%WINPYDIR%\python.exe" "%~dp0WinpythonIni.py""') DO set winpythontoexec=%%i
884882
885883
%winpythontoexec%set winpythontoexec=
@@ -904,71 +902,6 @@ def _create_batch_scripts_initial(self):
904902
do_changes=changes,
905903
)
906904

907-
self.create_batch_script(
908-
"Noshell.vbs",
909-
r"""
910-
'from http://superuser.com/questions/140047/how-to-run-a-batch-file-without-launching-a-command-window/390129
911-
If WScript.Arguments.Count >= 1 Then
912-
ReDim arr(WScript.Arguments.Count-1)
913-
For i = 0 To WScript.Arguments.Count-1
914-
Arg = WScript.Arguments(i)
915-
If InStr(Arg, " ") > 0 or InStr(Arg, "&") > 0 Then Arg = chr(34) & Arg & chr(34)
916-
arr(i) = Arg
917-
Next
918-
919-
RunCmd = Join(arr)
920-
CreateObject("Wscript.Shell").Run RunCmd, 0 , True
921-
End If
922-
""",
923-
)
924-
925-
self.create_batch_script(
926-
"WinPythonIni.vbs",
927-
r"""
928-
Set colArgs = WScript.Arguments
929-
If colArgs.Count> 0 Then
930-
Filename=colArgs(0)
931-
else
932-
Filename="..\settings\winpython.ini"
933-
end if
934-
my_lines = Split(GetFile(FileName) & vbNewLine , vbNewLine )
935-
segment = "environment"
936-
txt=""
937-
Set objWSH = CreateObject("WScript.Shell")
938-
For each l in my_lines
939-
if left(l, 1)="[" then
940-
segment=split(mid(l, 2, 999) & "]","]")(0)
941-
ElseIf left(l, 1) <> "#" and instr(l, "=")>0 then
942-
data = Split(l & "=", "=")
943-
if segment="debug" and trim(data(0))="state" then data(0)= "WINPYDEBUG"
944-
if segment="environment" or segment= "debug" then
945-
txt= txt & "set " & rtrim(data(0)) & "=" & translate(ltrim(data(1))) & "&& "
946-
objWSH.Environment("PROCESS").Item(rtrim(data(0))) = translate(ltrim(data(1)))
947-
end if
948-
if segment="debug" and trim(data(0))="state" then txt= txt & "set WINPYDEBUG=" & trim(data(1)) & "&&"
949-
End If
950-
Next
951-
wscript.echo txt
952-
953-
954-
Function GetFile(ByVal FileName)
955-
Set FS = CreateObject("Scripting.FileSystemObject")
956-
If Left(FileName,3)="..\" then FileName = FS.GetParentFolderName(FS.GetParentFolderName(Wscript.ScriptFullName)) & mid(FileName,3,9999)
957-
If Left(FileName,3)=".\" then FileName = FS.GetParentFolderName(FS.GetParentFolderName(Wscript.ScriptFullName)) & mid(FileName,3,9999)
958-
On Error Resume Next
959-
GetFile = FS.OpenTextFile(FileName).ReadAll
960-
End Function
961-
962-
Function translate(line)
963-
set dos = objWSH.Environment("PROCESS")
964-
tab = Split(line & "%", "%")
965-
for i = 1 to Ubound(tab) step 2
966-
if tab(i)& "" <> "" and dos.Item(tab(i)) & "" <> "" then tab(i) = dos.Item(tab(i))
967-
next
968-
translate = Join(tab, "")
969-
end function
970-
""",
971-
)
972905

973906
self.create_batch_script(
974907
"WinPythonIni.py", # Replaces winpython.vbs
@@ -1017,7 +950,7 @@ def main():
1017950
1018951
print(txt)
1019952
# later_version:
1020-
# p = subprocess.Popen(["start", "cmd", "/k", "set"], shell = True) # Needs to be shell since start isn't an executable, its a shell cmd
953+
# p = subprocess.Popen(["start", "cmd", "/k", "set"], shell = True)
1021954
# p.wait() # I can wait until finished (although it too finishes after start finishes)
1022955
1023956
if __name__ == "__main__":

winpython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
OTHER DEALINGS IN THE SOFTWARE.
2929
"""
3030

31-
__version__ = '11.0.20240915'
31+
__version__ = '11.1.20240922'
3232
__license__ = __doc__
3333
__project_url__ = 'http://winpython.github.io/'

0 commit comments

Comments
 (0)
0