Skip to content

Commit

Permalink
Close debug window, refactoring, more debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasedv committed Mar 9, 2020
1 parent 2e47fd8 commit c2936b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Modules/download_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def __init__(self, working_dir: str, program_path: str, commands: list, info='',
self.potential_error_log = ''
# Raw logs from program. TODO: Maybe add some info here when initializing, plus return code perhaps?
self.debug_log = []
self.debug_log.append(' '.join(commands) + '\n')
self.done = False

self.program_log = deque(maxlen=3)
Expand All @@ -67,6 +68,7 @@ def program_state_changed(self, new_state):
else:
self.status = 'Finished'
self.progress = '100%'

self.eta = ''
self.filesize = ''
self.speed = ''
Expand Down
11 changes: 6 additions & 5 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,10 +839,7 @@ def queue_download(self):

else:
if options['state']:
if self.settings.get_active_setting(parameter):
option = self.settings.get_active_setting(parameter)
else:
option = ''
option = self.settings.get_active_setting(parameter)
add = format_in_list(options['command'], option)
command += add

Expand Down Expand Up @@ -985,6 +982,10 @@ def do_proper_shutdown():
"""Ensures that the settings are saved properly before exiting!"""

nonlocal self
for item in self.tab1.process_list.iter_items():
if item._open_window is not None:
item._open_window.close()

self.hide()
self.file_handler.force_save = True
self.file_handler.save_settings(self.settings.settings_data)
Expand Down Expand Up @@ -1041,7 +1042,7 @@ def do_proper_shutdown():

warning = QMessageBox.warning(None,
f'Corruption of {file}!',
''.join([str(e), '\nRestore to defaults?']),
f'{e}\nRestore to defaults?',
buttons=QMessageBox.Yes | QMessageBox.No)

if warning == QMessageBox.Yes:
Expand Down
2 changes: 2 additions & 0 deletions utils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def get_active_setting(self, parameter):
if '{}' in param['command']:
active = param['active option']
return param['options'][active]
else:
return ''

@property
def parameters(self) -> dict:
Expand Down

0 comments on commit c2936b7

Please sign in to comment.