From a2a035c91eaad2b23968eca392789acea0fdaf26 Mon Sep 17 00:00:00 2001
From: krassowski <5832902+krassowski@users.noreply.github.com>
Date: Mon, 6 May 2024 13:46:49 +0100
Subject: [PATCH 1/2] Add code-server icon behind `USE_CODE_SERVER_ICON`
---
jupyter_vscode_proxy/__init__.py | 4 +++-
jupyter_vscode_proxy/icons/code-server.svg | 9 +++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 jupyter_vscode_proxy/icons/code-server.svg
diff --git a/jupyter_vscode_proxy/__init__.py b/jupyter_vscode_proxy/__init__.py
index 2ae6fd4..9e99b09 100644
--- a/jupyter_vscode_proxy/__init__.py
+++ b/jupyter_vscode_proxy/__init__.py
@@ -61,6 +61,8 @@ def _get_cmd(port: int) -> List[str]:
def setup_vscode() -> Dict[str, Any]:
executable = os.environ.get("CODE_EXECUTABLE", "code-server")
+ use_code_server_icon = os.environ.get("USE_CODE_SERVER_ICON", "false").lower()
+ icon = "code-server.svg" if use_code_server_icon == "true" else "vscode.svg"
return {
"command": _get_cmd_factory(executable),
"timeout": 300,
@@ -68,7 +70,7 @@ def setup_vscode() -> Dict[str, Any]:
"launcher_entry": {
"title": "VS Code",
"icon_path": os.path.join(
- os.path.dirname(os.path.abspath(__file__)), "icons", "vscode.svg"
+ os.path.dirname(os.path.abspath(__file__)), "icons", icon
),
},
}
diff --git a/jupyter_vscode_proxy/icons/code-server.svg b/jupyter_vscode_proxy/icons/code-server.svg
new file mode 100644
index 0000000..85b701d
--- /dev/null
+++ b/jupyter_vscode_proxy/icons/code-server.svg
@@ -0,0 +1,9 @@
+
\ No newline at end of file
From 9521f98c145bcbb3770c7d446762ac26baf8008c Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Mon, 6 May 2024 20:10:43 +0200
Subject: [PATCH 2/2] Update jupyter_vscode_proxy/__init__.py
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: MichaĆ Krassowski <5832902+krassowski@users.noreply.github.com>
---
jupyter_vscode_proxy/__init__.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/jupyter_vscode_proxy/__init__.py b/jupyter_vscode_proxy/__init__.py
index 9e99b09..eb5ae43 100644
--- a/jupyter_vscode_proxy/__init__.py
+++ b/jupyter_vscode_proxy/__init__.py
@@ -61,8 +61,7 @@ def _get_cmd(port: int) -> List[str]:
def setup_vscode() -> Dict[str, Any]:
executable = os.environ.get("CODE_EXECUTABLE", "code-server")
- use_code_server_icon = os.environ.get("USE_CODE_SERVER_ICON", "false").lower()
- icon = "code-server.svg" if use_code_server_icon == "true" else "vscode.svg"
+ icon = "code-server.svg" if executable == "code-server" else "vscode.svg"
return {
"command": _get_cmd_factory(executable),
"timeout": 300,