Skip to content

Commit 313ed70

Browse files
committed
Updates for PythonForWindows
Added downloading PowerShell icon. Removed NII stuff.
1 parent e6093f2 commit 313ed70

File tree

3 files changed

+12
-37
lines changed

3 files changed

+12
-37
lines changed

PythonForWindows/PythonForWindows.ps1

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Param(
99
[Switch]$InstallGit,
1010
[Switch]$InstallDotnetInteractive,
1111
[Switch]$InstallNBExtensions,
12-
[Switch]$InstallNIIExtensions,
1312
[Switch]$UsePipKernel,
1413
[Switch]$InstallPwsh7ForPipKernel,
1514
[Switch]$CleanupDownloadFiles,
@@ -20,12 +19,6 @@ Push-Location $WorkingFolder
2019
chcp 65001
2120
$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::GetEncoding('utf-8')
2221

23-
if (($null -eq (Invoke-Command -ScriptBlock {$ErrorActionPreference="silentlycontinue"; git --version} -ErrorAction SilentlyContinue)) -and (-not($InstallGit))) {
24-
if ($InstallNIIExtensions) {
25-
throw 'You need git command or InstallGit option for InstallNIIExtensions option.'
26-
}
27-
}
28-
2922
$psBoundParameters.Keys | ForEach-Object {
3023
if ($($PSBoundParameters.$_.GetType().Name) -eq 'SwitchParameter') {
3124
$paramStrings += " -$_"
@@ -181,26 +174,6 @@ if ($InstallNBExtensions) {
181174
python -m pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
182175
python -m jupyter contrib nbextension install $pyTypeOpt
183176
}
184-
if ($InstallNIIExtensions) {
185-
python -m pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_run_through
186-
python -m pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_wrapper
187-
python -m pip install git+https://github.com/NII-cloud-operation/Jupyter-multi_outputs
188-
python -m pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_index
189-
python -m pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_notebook_diff
190-
python -m pip install git+https://github.com/NII-cloud-operation/sidestickies
191-
python -m pip install git+https://github.com/NII-cloud-operation/nbsearch
192-
python -m pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_nblineage
193-
if ($InstallNBExtensions) {
194-
python -m jupyter nbextension install --py lc_run_through $pyTypeOpt
195-
python -m jupyter nbextension install --py lc_wrapper $pyTypeOpt
196-
python -m jupyter nbextension install --py lc_multi_outputs $pyTypeOpt
197-
python -m jupyter nbextension install --py notebook_index $pyTypeOpt
198-
python -m jupyter nbextension install --py lc_notebook_diff $pyTypeOpt
199-
python -m jupyter nbextension install --py nbtags $pyTypeOpt
200-
python -m jupyter nbextension install --py nbsearch $pyTypeOpt
201-
python -m jupyter nbextension install --py nblineage $pyTypeOpt
202-
}
203-
}
204177
if ($UsePipKernel) {
205178
python -m pip install powershell_kernel
206179
python -m powershell_kernel.install $pyTypeOpt
@@ -226,6 +199,12 @@ else {
226199
$installPath = Join-Path $packagePath 'powershell5_kernel'
227200
Expand-Archive -Path (Join-Path $WorkingFolder 'PowerShell5.zip') -DestinationPath $installPath -Force
228201
New-Item -ItemType Directory -Path (Join-Path $kernelPath '\powershell5\') -Force
202+
Invoke-WebRequest -UseBasicParsing -Verbose -Uri 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_64.png' -OutFile (Join-Path $kernelPath '\powershell5\logo-64x64.png')
203+
Add-Type -AssemblyName System.Drawing
204+
$image = [System.Drawing.Image]::FromFile((Join-Path $kernelPath '\powershell5\logo-64x64.png'))
205+
$bitmap32 = New-Object System.Drawing.Bitmap(32, 32)
206+
[System.Drawing.Graphics]::FromImage($bitmap32).DrawImage($image, 0, 0, 32, 32)
207+
$bitmap32.Save((Join-Path $kernelPath '\powershell5\logo-32x32.png'), [System.Drawing.Imaging.ImageFormat]::Png)
229208
@"
230209
{
231210
"argv": [
@@ -246,6 +225,12 @@ if ($InstallPwsh7SDK) {
246225
$installPath = Join-Path $packagePath 'powershellSDK_kernel'
247226
Expand-Archive -Path (Join-Path $WorkingFolder 'PowerShellSDK.zip') -DestinationPath $installPath -Force
248227
New-Item -ItemType Directory -Path (Join-Path $kernelPath '\powershellSDK\') -Force
228+
Invoke-WebRequest -UseBasicParsing -Verbose -Uri 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_black_64.png' -OutFile (Join-Path $kernelPath '\powershellSDK\logo-64x64.png')
229+
Add-Type -AssemblyName System.Drawing
230+
$image = [System.Drawing.Image]::FromFile((Join-Path $kernelPath '\powershellSDK\logo-64x64.png'))
231+
$bitmap32 = New-Object System.Drawing.Bitmap(32, 32)
232+
[System.Drawing.Graphics]::FromImage($bitmap32).DrawImage($image, 0, 0, 32, 32)
233+
$bitmap32.Save((Join-Path $kernelPath '\powershellSDK\logo-32x32.png'), [System.Drawing.Imaging.ImageFormat]::Png)
249234
@"
250235
{
251236
"argv": [

PythonForWindows/README-JP.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
- [Jupyter Nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions) (オプション)
1212
- [Jupyter Nbextensions Configurator](https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator) (オプション)
1313
- [Git for Windows](https://gitforwindows.org/) (オプション)
14-
- [NII Extensions for Jupyter Notebook](https://github.com/NII-cloud-operation) (オプション)
1514
- [.Net Interactive](https://github.com/dotnet/interactive) (オプション)
1615

1716
## インストール方法
@@ -32,10 +31,6 @@ Python for Windowsのバージョンを指定します。
3231
このスイッチオプションを指定すると、 [Jupyter Nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions)[Jupyter Nbextensions Configurator](https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator)をインストールします。
3332
例: .\WinPython.ps1 -InstallNBExtensions
3433

35-
- InstallNIIExtensions
36-
このスイッチオプションを指定すると、[NII Extensions for Jupyter Notebook](https://github.com/NII-cloud-operation)をインストールします。
37-
例: .\WinPython.ps1 -InstallNIIExtensions
38-
3934
- InstallGit
4035
このスイッチオプションを指定すると、[Git for Windows](https://gitforwindows.org/)をインストールします。
4136
例: .\WinPython.ps1 -InstallGit

PythonForWindows/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Using [Powershell](https://github.com/PowerShell/PowerShell) on [Jupyter Noteboo
1111
- [Jupyter Nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions) (Optional)
1212
- [Jupyter Nbextensions Configurator](https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator) (Optional)
1313
- [Git for Windows](https://gitforwindows.org/) (Optional)
14-
- [NII Extensions for Jupyter Notebook](https://github.com/NII-cloud-operation) (Optional)
1514
- [.Net Interactive](https://github.com/dotnet/interactive) (Optional)
1615

1716
## Installations
@@ -32,10 +31,6 @@ e.g.: .\WinPython.ps1 -UsePipKernel
3231
This switch option will install [Jupyter Nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions) and [Jupyter Nbextensions Configurator](https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator).
3332
e.g.: .\WinPython.ps1 -InstallNBExtensions
3433

35-
- InstallNIIExtensions
36-
This switch option will install [NII Extensions for Jupyter Notebook](https://github.com/NII-cloud-operation). then requires the git for installation or add "-InstallGit" option.
37-
e.g.: .\WinPython.ps1 -InstallNIIExtensions
38-
3934
- InstallGit
4035
This switch option will install [Git for Windows](https://gitforwindows.org/).
4136
e.g.: .\WinPython.ps1 -InstallGit

0 commit comments

Comments
 (0)