From 8f1e5e33690f7da772c3d65b8ad6c68557880a86 Mon Sep 17 00:00:00 2001 From: David Yang Date: Thu, 7 Apr 2022 18:42:11 +0800 Subject: [PATCH] Cleaning up deepsource complaints Functional changes requested by deepsource not included. --- docs/source/conf.py | 17 ----------------- guake/about.py | 4 ---- guake/guake_app.py | 3 +-- guake/main.py | 2 +- guake/simplegladeapp.py | 2 -- guake/terminal.py | 5 ----- guake/theme.py | 12 ------------ 7 files changed, 2 insertions(+), 43 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 34ff23d90..f85351e1a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,9 +12,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import os -import sys - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -258,17 +255,3 @@ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False - -# html_theme_options = { -# 'canonical_url': 'http://guake.readthedocs.io/en/latest/', -# 'logo_only': False, -# 'display_version': True, -# 'prev_next_buttons_location': 'bottom', -# 'style_external_links': False, -# 'vcs_pageview_mode': '', -# # Toc options -# 'collapse_navigation': True, -# 'sticky_navigation': True, -# 'navigation_depth': 4, -# 'titles_only': False -# } diff --git a/guake/about.py b/guake/about.py index 84cac5603..d3e6f6071 100644 --- a/guake/about.py +++ b/guake/about.py @@ -39,10 +39,6 @@ def __init__(self): dialog = self.get_widget("aboutdialog") # images - # ipath = pixmapfile('guake-notification.png') - # img = gtk.gdk.pixbuf_new_from_file(ipath) - - # img = pixmapfile('guake-notification.png') image = Gtk.Image() image.set_from_file(pixmapfile("guake-notification.png")) pixbuf = image.get_pixbuf() diff --git a/guake/guake_app.py b/guake/guake_app.py index 6a9be59bc..7b687e534 100644 --- a/guake/guake_app.py +++ b/guake/guake_app.py @@ -1290,8 +1290,7 @@ def search_on_web(self, *args): search_query = guake_clipboard.wait_for_text() search_query = quote_plus(search_query) if search_query: - # TODO: search provider should be selectable (someone might - # prefer bing.com, the internet is a strange place ¯\_(ツ)_/¯ ) + # TODO: search provider should be selectable. search_url = f"https://www.google.com/search?q={search_query}&safe=off" Gtk.show_uri(self.window.get_screen(), search_url, get_server_time(self.window)) return True diff --git a/guake/main.py b/guake/main.py index 79ade7610..e667a28b0 100644 --- a/guake/main.py +++ b/guake/main.py @@ -615,7 +615,7 @@ def main(): log.info("Calling startup script: %s", startup_script) with subprocess.Popen( [startup_script], - shell=True, + shell=False, stdin=None, stdout=None, stderr=None, diff --git a/guake/simplegladeapp.py b/guake/simplegladeapp.py index 22d45a273..5e149a536 100644 --- a/guake/simplegladeapp.py +++ b/guake/simplegladeapp.py @@ -69,8 +69,6 @@ def __init__(self, path, root=None, domain=None): else: self.main_widget = None - # self.glade = self.create_glade(self.glade_path, root, domain) - self.normalize_names() # Widgets are loaded and can be refered as self.widget_name diff --git a/guake/terminal.py b/guake/terminal.py index 2a6b559b7..451d3d91a 100644 --- a/guake/terminal.py +++ b/guake/terminal.py @@ -109,8 +109,6 @@ def __init__(self, guake): self.matched_value = "" self.font_scale_index = 0 self._pid = None - # self.custom_bgcolor = None - # self.custom_fgcolor = None self.found_link = None self.uuid = uuid.uuid4() @@ -313,8 +311,6 @@ def is_file_on_local_server(self, text) -> Tuple[Optional[Path], Optional[int], py_func = m.group(2).strip() def find_lineno(text, pt, lineno, py_func): - # print("text={!r}, pt={!r}, lineno={!r}, py_func={!r}".format(text, - # pt, lineno, py_func)) if lineno: return lineno if not py_func: @@ -519,7 +515,6 @@ def decrease_font_size(self): def kill(self): pid = self.pid threading.Thread(target=self.delete_shell, args=(pid,)).start() - # start_new_thread(self.delete_shell, (pid,)) def delete_shell(self, pid): """Kill the shell with SIGHUP diff --git a/guake/theme.py b/guake/theme.py index 3795b049d..2e2202c5b 100644 --- a/guake/theme.py +++ b/guake/theme.py @@ -79,18 +79,6 @@ def patch_gtk_theme(style_context, settings): def rgba_to_hex(color): return f"#{''.join(f'{int(i*255):02x}' for i in (color.red, color.green, color.blue))}" - # for n in [ - # "inverted_bg_color", - # "inverted_fg_color", - # "selected_bg_color", - # "selected_fg_color", - # "theme_inverted_bg_color", - # "theme_inverted_fg_color", - # "theme_selected_bg_color", - # "theme_selected_fg_color", - # ]: - # s = style_context.lookup_color(n) - # print(n, s, rgba_to_hex(s[1])) selected_fg_color = rgba_to_hex(style_context.lookup_color("theme_selected_fg_color")[1]) selected_bg_color = rgba_to_hex(style_context.lookup_color("theme_selected_bg_color")[1]) log.debug(