Skip to content

Commit ed34780

Browse files
committed
log to central logfile rather than csv-specific log
1 parent 0e5e983 commit ed34780

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

main.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ def init_gui():
4545
[sg.OK(), sg.Cancel()]
4646
]
4747
# Testing
48-
layout = [
49-
[sg.Text('Input CSV', size=(10, 1)), sg.Input(default_text='/Users/dlutsch/Desktop/sample2.csv', key='-INPUT-', change_submits=True),
50-
sg.FileBrowse(key='-INPUT_BROWSE-', file_types=(("CSV Files", "*.csv"),))],
51-
[sg.Text('PDF Output', size=(10, 1)), sg.Input(default_text='/Users/dlutsch/Desktop/pdf', key='-PDF_DIR-', change_submits=True),
52-
sg.FolderBrowse(key='-INPUT_BROWSE-')],
53-
[sg.Text('Chromedriver', size=(10, 1)), sg.Input(default_text='/Users/dlutsch/chromedriver',key='-DRIVER-', change_submits=True),
54-
sg.FileBrowse(key='-DRIVER_BROWSE-', file_types=(("EXE Files", "*.exe"),))],
55-
[sg.Text('Run in Background', size=(15, 1)), sg.Radio('True', "BGRADIO", default=True, key='-HEADLESS-'),
56-
sg.Radio('False', "BGRADIO")],
57-
[sg.MLine(key='-OUTPUT-' + sg.WRITE_ONLY_KEY, size=(70, 20))],
58-
[sg.OK(), sg.Cancel()]
59-
]
48+
# layout = [
49+
# [sg.Text('Input CSV', size=(10, 1)), sg.Input(default_text='/Users/dlutsch/Desktop/sample2.csv', key='-INPUT-', change_submits=True),
50+
# sg.FileBrowse(key='-INPUT_BROWSE-', file_types=(("CSV Files", "*.csv"),))],
51+
# [sg.Text('PDF Output', size=(10, 1)), sg.Input(default_text='/Users/dlutsch/Desktop/pdf', key='-PDF_DIR-', change_submits=True),
52+
# sg.FolderBrowse(key='-INPUT_BROWSE-')],
53+
# [sg.Text('Chromedriver', size=(10, 1)), sg.Input(default_text='/Users/dlutsch/chromedriver',key='-DRIVER-', change_submits=True),
54+
# sg.FileBrowse(key='-DRIVER_BROWSE-', file_types=(("EXE Files", "*.exe"),))],
55+
# [sg.Text('Run in Background', size=(15, 1)), sg.Radio('True', "BGRADIO", default=True, key='-HEADLESS-'),
56+
# sg.Radio('False', "BGRADIO")],
57+
# [sg.MLine(key='-OUTPUT-' + sg.WRITE_ONLY_KEY, size=(70, 20))],
58+
# [sg.OK(), sg.Cancel()]
59+
# ]
6060

6161
return sg.Window('Harris County Property Tax Downloader', layout)
6262

@@ -77,11 +77,11 @@ def emit(self, record):
7777
window.Refresh()
7878

7979

80-
def config_logging(log_file):
80+
def config_logging():
8181
logging.basicConfig(
8282
level=logging.INFO,
8383
format='%(asctime)s, [%(levelname)s], %(message)s',
84-
filename=log_file+".log",
84+
filename='hc-proptax.log',
8585
filemode='w')
8686

8787
ch = Handler()
@@ -102,7 +102,7 @@ def config_logging(log_file):
102102
pdf_dir = values['-PDF_DIR-']
103103
window['-OUTPUT-' + sg.WRITE_ONLY_KEY].update("")
104104
output_file = get_output_filepath(values['-INPUT-'])
105-
config_logging(output_file)
105+
config_logging()
106106
logging.info(f'OUTPUT FILE: {output_file}')
107107
window.Refresh()
108108

0 commit comments

Comments
 (0)