55import text_values as text_values # Long text values stored in separate file
66from dynamic_modal import DynamicModal
77from are_you_sure import YouSure
8- from settings_values import settings_values , custom_scripts , load_settings , update_scripts , settings_path
8+ from settings_values import *
99
1010# Create settings.json if not exists and/or load saved values
1111load_settings (e = None , update = False )
1212
1313# Create recent_computers.json
14- recent_computers_path = "assets/settings/recent_computers.json"
1514if os .path .exists (recent_computers_path ) == False :
1615 with open (recent_computers_path , "w" ) as file :
1716 print (f"{ recent_computers_path } created" )
1817 init_data = {"computers" :[]}
1918 json .dump (init_data , file , indent = 4 )
2019
21- list_path = "assets/settings/lists/computers.txt"
20+ computerlist_path = "assets/settings/lists/computers.txt"
2221
2322#Cleanup old files
2423printers_path = "assets/results/Printers"
5049 for filename in os .listdir (uptime_path ):
5150 pathlib .Path (f"{ uptime_path } /{ filename } " ).unlink ()
5251
53-
54-
5552# Program
5653def main (page : ft .Page ):
5754 #Setup PowerShell
5855 powershell = the_shell .Power_Shell ()
5956
6057 page .fonts = {
61- "Consola" : "assets/ fonts/Consola.ttf"
58+ "Consola" : "fonts/Consola.ttf"
6259 }
6360
6461 def min_max (e ):
@@ -78,7 +75,7 @@ def min_max(e):
7875 drag_window = ft .Container (
7976 content = ft .Row ([
8077 ft .Container (
81- content = ft .Image (src = "assets/ images/itremote.svg" , width = 32 ),
78+ content = ft .Image (src = "images/itremote.svg" , width = 32 ),
8279 padding = ft .padding .only (left = 10 , top = 3 )
8380 ),
8481 ft .WindowDragArea (ft .Container (
@@ -614,18 +611,18 @@ def check_computer_name():
614611 def check_list ():
615612
616613 try :
617- with open (list_path , "r" ) as file :
614+ with open (computerlist_path , "r" ) as file :
618615
619616 contents = file .read ()
620617 if contents == "" :
621618 show_message ("List is empty." )
622619 return False
623620 except FileNotFoundError as e :
624- with open (list_path , "x" ) as file :
621+ with open (computerlist_path , "x" ) as file :
625622 print ("Computer list file created." )
626623
627624 try :
628- with open (list_path , "r" ) as list :
625+ with open (computerlist_path , "r" ) as list :
629626 computers = list .read ()
630627 if computers == "" :
631628 show_message ("List is empty." )
@@ -637,7 +634,7 @@ def check_list():
637634 else :
638635 return True
639636 except FileNotFoundError as e :
640- with open (list_path , "x" ) as file :
637+ with open (computerlist_path , "x" ) as file :
641638 print ("Computer list file created." )
642639
643640 def find_day (date ):
@@ -2172,7 +2169,7 @@ def run_operation(computer):
21722169 # an array of them.
21732170 if computer == "list of computers" :
21742171 list_of_pcs = []
2175- list = open (list_path , "r" )
2172+ list = open (computerlist_path , "r" )
21762173 computers = list .readlines ()
21772174 for pc in computers :
21782175 list_of_pcs .append (pc .strip ("\\ n" ))
@@ -2850,7 +2847,7 @@ def clicked(e):
28502847
28512848 def open_errors (e ):
28522849 try :
2853- with open ("assets/settings/log.txt" , "r" ) as file :
2850+ with open (logging_path , "r" ) as file :
28542851 errors = file .readlines ()
28552852 list_of_errors = []
28562853
@@ -3429,7 +3426,7 @@ def on_github_hover(e):
34293426 width = 210
34303427 ),
34313428 ft .Container (
3432- content = ft .Image (src = "assets/ images/Github.png" , width = 70 ),
3429+ content = ft .Image (src = "images/Github.png" , width = 70 ),
34333430 url = "https://github.com/knightlygains/it-remote" ,
34343431 offset = ft .transform .Offset (2 , 2 ),
34353432 on_hover = on_github_hover ,
@@ -3446,7 +3443,7 @@ def on_github_hover(e):
34463443 ft .Row ([
34473444 ft .Container (
34483445 content = ft .Column ([
3449- ft .Image (src = "assets/ images/ko-fi.png" , width = 70 ),
3446+ ft .Image (src = "images/ko-fi.png" , width = 70 ),
34503447 ft .Text ("Ko-Fi" , weight = ft .FontWeight .BOLD )
34513448 ], horizontal_alignment = ft .CrossAxisAlignment .CENTER ),
34523449 margin = ft .margin .only (top = 20 ),
@@ -3456,7 +3453,7 @@ def on_github_hover(e):
34563453 ),
34573454 ft .Container (
34583455 content = ft .Column ([
3459- ft .Image (src = "assets/ images/patreon.png" , width = 70 ),
3456+ ft .Image (src = "images/patreon.png" , width = 70 ),
34603457 ft .Text ("Patreon" , weight = ft .FontWeight .BOLD )
34613458 ], horizontal_alignment = ft .CrossAxisAlignment .CENTER ),
34623459 margin = ft .margin .only (top = 20 ),
0 commit comments