8000 Merge pull request #188 from stonebig/master · Aikes/winpython@9fe12db · GitHub
[go: up one dir, main page]

Skip to content

Commit 9fe12db

Browse files
committed
Merge pull request winpython#188 from stonebig/master
keep nbextensions in Winpython directory
2 parents cd6c9c4 + d22f17e commit 9fe12db

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

make.py

Lines changed: 11 additions & 1 deletion
10000
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ def create_launcher(self, name, icon, command=None,
340340
('BETTERCOMMAND', bettercommand),
341341
('BETTERWORKDIR', betterworkdir),
342342
('BETTERPARAMETERS', betterargs),
343+
('JUPYTER_DATA_DIR', '$EXEDIR\%s' % 'settings'),
343344
('Icon', icon_fname),
344345
('OutFile', name)]
345346

@@ -627,7 +628,11 @@ def _create_batch_scripts_initial(self):
627628
set PATH=""" + path + """
628629
629630
rem force default pyqt5 kit for Spyder if PyQt5 module is there
630-
if exist %WINPYDIR%\Lib\site-packages\PyQt5 set QT_API=pyqt5""")
631+
if exist %WINPYDIR%\Lib\site-packages\PyQt5 set QT_API=pyqt5
632+
633+
rem keep nbextensions in Winpython directory, rather then %APPDATA% default
634+
set JUPYTER_DATA_DIR=%WINPYDIR%\..\settings
635+
""")
631636

632637
def _create_batch_scripts(self):
633638
"""Create batch scripts"""
@@ -717,6 +722,11 @@ def _create_batch_scripts(self):
717722
self.create_python_batch('pyqt5_demo.bat', 'qtdemo.py',
718723
workdir=r'Lib\site-packages\PyQt5\examples\qtdemo')
719724

725+
self.create_batch_script('ipython_notebook.bat', r"""@echo off
726+
call %~dp0env.bat
727+
cd %WINPYDIR%\Scripts
728+
%WINPYDIR%\scripts\jupyter-notebook.exe --notebook-dir=%WINPYDIR%\..\notebooks %*
729+
""")
720730

721731
# pre-run mingw batch
722732
print('now pre-running extra mingw')

portable/launcher.nsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Licensed under the terms of the MIT License
3535
!define BETTERWORKDIR ""
3636
!define BETTERPARAMETERS ""
3737

38+
; jupyter workaround to stay in one directory
39+
!define JUPYTER_DATA_DIR ""
40+
3841
Icon ""
3942
OutFile ""
4043
;================================================================
@@ -124,6 +127,12 @@ System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("QT_API", "pyqt5").r0'
124127

125128
end_QT_API_settings:
126129

130+
; jupyter
131+
StrCmp "${JUPYTER_DATA_DIR}" "" end_jupyter_data_setting
132+
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("JUPYTER_DATA_DIR", "${JUPYTER_DATA_DIR}").r0'
133+
134+
end_jupyter_data_setting:
135+
127136
;================================================================
128137
; Settings directory
129138
IfFileExists "$EXEDIR\settings\*.*" 0 end_settings

winpython/wppm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,12 @@ def handle_specific_packages(self, package):
520520
if package.name.lower() == 'pyqt5':
521521
# see http://code.activestate.com/lists/python-list/666469/
522522
tmp_string = r'''@echo off
523+
if "%WINPYDIR%"=="" call %~dp0..\..\scripts\env.bat
523524
python -m PyQt5.uic.pyuic %1 %2 %3 %4 %5 %6 %7 %8 %9'''
524525

525526
else:
526527
tmp_string = r'''@echo off
528+
if "%WINPYDIR%"=="" call %~dp0..\..\scripts\env.bat
527529
python "%WINPYDIR%\Lib\site-packages\package.name\uic\pyuic.py" %1 %2 %3 %4 %5 %6 %7 %8 %9'''
528530

529531
self.create_file(package, 'pyuic%s.bat' % package.name[-1],

0 commit comments

Comments
 (0)
0