Skip to content

Commit 3a64004

Browse files
committed
fix: using os.sep instead if codes
1 parent 2c001d3 commit 3a64004

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ dist
77
*egg-info
88
.coverage
99
*.pyc
10-
htmlcov
10+
htmlcov
11+
env

proxmox_pci_switcher/proxmox_pci_switcher.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,9 @@ def cmd_switch_vm(name, config=DEFAULT_LINUX_PATH):
181181
default=DEFAULT_LINUX_PATH,
182182
)
183183
def gui():
184-
_gui_main = "/ui/main.py"
185-
if os.name == "nt":
186-
_gui_main = "\\ui\\main.py"
187-
188184
# Dynamic ui load
189185
SourceFileLoader(
190-
"ui", f"{os.path.dirname(os.path.realpath(__file__))}{_gui_main}"
186+
"ui", f"{os.path.dirname(os.path.realpath(__file__))}{os.sep}ui{os.sep}main.py"
191187
).load_module()
192188

193189

proxmox_pci_switcher/ui/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from kivymd.uix.snackbar import Snackbar
66
from kivy.clock import Clock
77
from kivy import Logger
8+
import os
89

910
from proxmox_pci_switcher import (
1011
DEFAULT_LINUX_PATH,
@@ -103,7 +104,7 @@ def on_start(self, *args):
103104
self.main_list_load()
104105

105106
self.title = "Proxmox PCI Switcher"
106-
self.icon = "logo.png"
107+
self.icon = f"{os.path.dirname(os.path.realpath(__file__))}{os.sep}logo.png"
107108

108109
if not self._clock_init:
109110
self._clock_init = True

0 commit comments

Comments
 (0)