File tree Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 33
44import requests
55
6- from smct import paths , registry , ui
6+ from smct import paths , ui
77from smct .logger import log
88
99# config.ini structure
2121
2222
2323def _check_for_missing_files ():
24+ if not os .path .exists (paths .CONFIG_PATH ):
25+ log ("creating default config" )
26+ _create_default_config_file ()
27+
2428 if not os .path .exists (paths .ASSETS_DIR_PATH ):
2529 os .mkdir (paths .ASSETS_DIR_PATH )
2630 log (f"Creating { paths .ASSETS_DIR_PATH } " )
@@ -60,17 +64,8 @@ def download_assets_file(image_name):
6064
6165
6266def init_config ():
63- if not os .path .exists (paths .CONFIG_PATH ):
64- log ("config.ini not found, creating default config" )
65- _create_default_config_file ()
66-
6767 _check_for_missing_files ()
6868
69- if get_start_with_windows_value ():
70- registry .add_to_autostart ()
71- else :
72- registry .remove_from_autostart ()
73-
7469 if get_first_start_value ():
7570 ui .init_root_window ()
7671 set_first_start_value (False )
Original file line number Diff line number Diff line change 11import logging
22import os
3- from smct import paths
3+ from smct . paths import LOG_PATH
44
5- LOGFILENAME = paths .LOG_PATH
65ENCODING = "utf-8"
76
87LOG = None
@@ -16,18 +15,18 @@ def log(text):
1615
1716
1817def clear_log_if_needed ():
19- if os .path .exists (LOGFILENAME ):
20- with open (LOGFILENAME , "r" , encoding = ENCODING ) as file :
18+ if os .path .exists (LOG_PATH ):
19+ with open (LOG_PATH , "r" , encoding = ENCODING ) as file :
2120 lines = file .readlines ()
2221 if len (lines ) > LOG_LINE_LIMIT :
23- with open (LOGFILENAME , "w" , encoding = ENCODING ) as file :
22+ with open (LOG_PATH , "w" , encoding = ENCODING ) as file :
2423 file .write ("" )
2524
2625
2726if STARTUP :
2827 clear_log_if_needed ()
2928 logging .basicConfig (
30- filename = LOGFILENAME ,
29+ filename = LOG_PATH ,
3130 level = logging .INFO ,
3231 format = "%(asctime)s - %(levelname)s - %(message)s" ,
3332 )
You can’t perform that action at this time.
0 commit comments