Skip to content

Commit 7885eda

Browse files
authored
Add icon (#134)
1 parent 279e05f commit 7885eda

File tree

3 files changed

+10581
-2
lines changed

3 files changed

+10581
-2
lines changed

bash_kernel/install.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
import os
33
import sys
44
import argparse
5+
import pathlib
6+
import shutil
57

68
from jupyter_client.kernelspec import KernelSpecManager
79
from IPython.utils.tempdir import TemporaryDirectory
10+
from .resources import _ICON_PATH
811

912
kernel_json = {"argv":[sys.executable,"-m","bash_kernel", "-f", "{connection_file}"],
1013
"display_name":"Bash",
@@ -18,8 +21,10 @@ def install_my_kernel_spec(user=True, prefix=None):
1821
os.chmod(td, 0o755) # Starts off as 700, not user readable
1922
with open(os.path.join(td, 'kernel.json'), 'w') as f:
2023
json.dump(kernel_json, f, sort_keys=True)
21-
# TODO: Copy resources once they're specified
22-
24+
shutil.copyfile(
25+
_ICON_PATH,
26+
pathlib.Path(td) / _ICON_PATH.name
27+
)
2328
print('Installing IPython kernel spec')
2429
KernelSpecManager().install_kernel_spec(td, 'bash', user=user, prefix=prefix)
2530

bash_kernel/resources/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pathlib
2+
3+
_ICON_PATH = pathlib.Path(__file__).resolve().parent / "logo-svg.svg"

0 commit comments

Comments
 (0)