diff --git a/EDMCLogging.py b/EDMCLogging.py index 49b1aa40..15a7b4f6 100644 --- a/EDMCLogging.py +++ b/EDMCLogging.py @@ -338,8 +338,6 @@ class EDMCContextFilter(logging.Filter): # try: frame_info = inspect.getframeinfo(frame) - # raise(IndexError) # TODO: Remove, only for testing - except Exception: # Separate from the print below to guarantee we see at least this much. print('EDMCLogging:EDMCContextFilter:caller_attributes(): Failed in `inspect.getframinfo(frame)`') diff --git a/EDMCSystemProfiler.py b/EDMCSystemProfiler.py index 873282b8..a5d97ce4 100644 --- a/EDMCSystemProfiler.py +++ b/EDMCSystemProfiler.py @@ -38,17 +38,17 @@ from monitor import monitor from EDMCLogging import get_main_logger -def get_sys_report(config: config.AbstractConfig) -> str: +def get_sys_report(active_config: config.AbstractConfig) -> str: """Gather system information about Elite, the Host Computer, and EDMC.""" # Calculate Requested Information plt = platform.uname() locale.setlocale(locale.LC_ALL, "") lcl = locale.getlocale() - monitor.currentdir = config.get_str( - "journaldir", default=config.default_journal_dir + monitor.currentdir = active_config.get_str( + "journaldir", default=active_config.default_journal_dir ) if not monitor.currentdir: - monitor.currentdir = config.default_journal_dir + monitor.currentdir = active_config.default_journal_dir try: logfile = monitor.journal_newest_filename(monitor.currentdir) if logfile is None: @@ -108,21 +108,21 @@ def copy_sys_report(root: tk.Tk, report: str) -> None: messagebox.showinfo("System Profiler", "System Report copied to Clipboard", parent=root) -def main() -> None: +def main(active_config: config.AbstractConfig) -> None: """Entry Point for the System Profiler.""" # Now Let's Begin root: tk.Tk = tk.Tk() root.withdraw() # Hide the window initially to calculate the dimensions try: icon_image = tk.PhotoImage( - file=path.join(cur_config.respath_path, "io.edcd.EDMarketConnector.png") + file=path.join(active_config.respath_path, "io.edcd.EDMarketConnector.png") ) root.iconphoto(True, icon_image) except tk.TclError: - root.iconbitmap(path.join(cur_config.respath_path, "EDMarketConnector.ico")) + root.iconbitmap(path.join(active_config.respath_path, "EDMarketConnector.ico")) - sys_report = get_sys_report(cur_config) + sys_report = get_sys_report(active_config) # Set up styling style = ttk.Style(root) @@ -182,7 +182,8 @@ if __name__ == "__main__": # Args: Only work if not frozen parser = argparse.ArgumentParser( prog=appname, - description="Prints diagnostic and debugging information about the current EDMC configuration.", + description="Prints diagnostic and debugging information " + "about the current EDMC configuration.", ) parser.add_argument( "--out-console", @@ -203,4 +204,4 @@ if __name__ == "__main__": print(sys_report) sys.exit(0) - main() + main(cur_config) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 28e83686..98496c0a 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -840,8 +840,7 @@ class AppWindow: r' if downgrading between major versions with significant changes.\r\n\r\n' 'Do you want to open GitHub to download the latest release?' ) - update_msg = update_msg.replace('\\n', '\n') - update_msg = update_msg.replace('\\r', '\r') + update_msg = update_msg.replace('\\n', '\n').replace('\\r', '\r') stable_popup = tk.messagebox.askyesno(title=title, message=update_msg) if stable_popup: webbrowser.open("https://github.com/EDCD/eDMarketConnector/releases/latest") @@ -2064,17 +2063,15 @@ def validate_providers(): # LANG: Popup-text about Reset Providers popup_text = tr.tl(r'One or more of your URL Providers were invalid, and have been reset:\r\n\r\n') - for provider in reset_providers: + for provider, (old_prov, new_prov) in reset_providers.items(): # LANG: Text About What Provider Was Reset - popup_text += tr.tl(r'{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n') - popup_text = popup_text.format( + popup_text += tr.tl(r'{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n').format( PROVIDER=provider, - OLDPROV=reset_providers[provider][0], - NEWPROV=reset_providers[provider][1] + OLDPROV=old_prov, + NEWPROV=new_prov ) # And now we do need these to be actual \r\n - popup_text = popup_text.replace('\\n', '\n') - popup_text = popup_text.replace('\\r', '\r') + popup_text = popup_text.replace('\\n', '\n').replace('\\r', '\r') tk.messagebox.showinfo( # LANG: Popup window title for Reset Providers @@ -2246,8 +2243,7 @@ sys.path: {sys.path}''' detail = tr.tl( # LANG: EDMC Critical Error Details r"Here's what EDMC Detected:\r\n\r\n{ERR}\r\n\r\nDo you want to file a Bug Report on GitHub?" ).format(ERR=err) - detail = detail.replace('\\n', '\n') - detail = detail.replace('\\r', '\r') + detail = detail.replace('\\n', '\n').replace('\\r', '\r') msg = tk.messagebox.askyesno( title=title, message=message, detail=detail, icon=tkinter.messagebox.ERROR, type=tkinter.messagebox.YESNO, parent=root @@ -2278,8 +2274,7 @@ sys.path: {sys.path}''' DISABLED='.disabled' ) # And now we do need these to be actual \r\n - popup_text = popup_text.replace('\\n', '\n') - popup_text = popup_text.replace('\\r', '\r') + popup_text = popup_text.replace('\\n', '\n').replace('\\r', '\r') tk.messagebox.showinfo( # LANG: Popup window title for list of 'broken' plugins that failed to load @@ -2309,8 +2304,7 @@ sys.path: {sys.path}''' DISABLED='.disabled' ) # And now we do need these to be actual \r\n - popup_text = popup_text.replace('\\n', '\n') - popup_text = popup_text.replace('\\r', '\r') + popup_text = popup_text.replace('\\n', '\n').replace('\\r', '\r') tk.messagebox.showinfo( # LANG: Popup window title for list of 'enabled' plugins that don't work with Python 3.x diff --git a/prefs.py b/prefs.py index 95f29e7f..f694f617 100644 --- a/prefs.py +++ b/prefs.py @@ -829,7 +829,8 @@ class PreferencesDialog(tk.Toplevel): appearance_frame, # LANG: Appearance - Help/hint text for UI scaling selection text=tr.tl('100 means Default{CR}Restart Required for{CR}changes to take effect!') - ).grid(column=3, padx=self.PADX, pady=self.PADY, sticky=tk.E, row=cur_row) + ) # E1111 + self.ui_scaling_defaultis.grid(column=3, padx=self.PADX, pady=self.PADY, sticky=tk.E, row=cur_row) # Transparency slider ttk.Separator(appearance_frame, orient=tk.HORIZONTAL).grid( @@ -1310,10 +1311,10 @@ class PreferencesDialog(tk.Toplevel): self._destroy() # Send to the Post Config if we updated the update branch or need to restart post_flags = { - 'Update': True if self.curr_update_track != self.update_paths.get() else False, + 'Update': self.curr_update_track != self.update_paths.get(), # Just needs bool not true if else false 'Track': self.update_paths.get(), 'Parent': self, - 'Restart_Req': True if self.req_restart else False + 'Restart_Req': self.req_restart # Sipmle Bool Needed } if self.callback: self.callback(**post_flags)