Skip to content

Commit 9ba14e2

Browse files
authored
Ver2.5.4a
Ver2.5.4a
1 parent 318be88 commit 9ba14e2

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

network_sketcher.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,20 @@ def __init__(self):
4242
self.click_value_3rd = ''
4343
self.click_value_VPN = ''
4444
self.root = TkinterDnD.Tk()
45-
self.root.title("Network Sketcher ver 2.5.4")
45+
self.root.title("Network Sketcher ver 2.5.4a")
4646
self.root.geometry("510x200+100+100")
47-
icon = tk.PhotoImage(file='ns_logo.png')
47+
48+
def resource_path(relative_path):
49+
try:
50+
base_path = sys._MEIPASS
51+
except Exception:
52+
base_path = os.path.abspath(".")
53+
54+
return os.path.join(base_path, relative_path)
55+
56+
file_path = resource_path('ns_logo.png')
57+
58+
icon = tk.PhotoImage(file=file_path)
4859
self.root.iconphoto(True, icon)
4960

5061
# Notebook

ns_extensions.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,16 @@ def export_ai_context_file(self, dummy):
106106
content_to_append += '** show_waypoint_interface' + '\n' + str(network_sketcher_cli.ns_cli_run.cli_show(self, excel_maseter_file, ['show', 'waypoint_interface'])) + '\n'+ '\n'
107107

108108
#add commands's guide
109-
with open('./ns_extensions_cmd_list.txt', 'r', encoding='utf-8') as f:
109+
def resource_path(relative_path):
110+
try:
111+
base_path = sys._MEIPASS
112+
except Exception:
113+
base_path = os.path.abspath(".")
114+
115+
return os.path.join(base_path, relative_path)
116+
117+
file_path = resource_path('ns_extensions_cmd_list.txt')
118+
with open(file_path, 'r', encoding='utf-8') as f:
110119
content_to_append += f.read()
111120

112121

0 commit comments

Comments
 (0)