Skip to content

Commit 025fad3

Browse files
hduelmemtwebster
authored andcommitted
remove redundant parentheses
1 parent 8fd7e46 commit 025fad3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

usr/lib/webapp-manager/common.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def wrapper(*args):
6060
ICONS_DIR = os.path.join(ICE_DIR, "icons")
6161
BROWSER_TYPE_FIREFOX, BROWSER_TYPE_FIREFOX_FLATPAK, BROWSER_TYPE_LIBREWOLF_FLATPAK, BROWSER_TYPE_CHROMIUM, BROWSER_TYPE_EPIPHANY, BROWSER_TYPE_FALKON = range(6)
6262

63-
class Browser():
63+
class Browser:
6464

6565
def __init__(self, browser_type, name, exec_path, test_path):
6666
self.browser_type = browser_type
@@ -70,7 +70,7 @@ def __init__(self, browser_type, name, exec_path, test_path):
7070

7171
# This is a data structure representing
7272
# the app menu item (path, name, icon..etc.)
73-
class WebAppLauncher():
73+
class WebAppLauncher:
7474

7575
def __init__(self, path, codename):
7676
self.path = path
@@ -128,7 +128,7 @@ def __init__(self, path, codename):
128128
# This is the backend.
129129
# It contains utility functions to load,
130130
# save and delete webapps.
131-
class WebAppManager():
131+
class WebAppManager:
132132

133133
def __init__(self):
134134
for directory in [ICE_DIR, APPS_DIR, PROFILES_DIR, FIREFOX_PROFILES_DIR, FIREFOX_FLATPAK_PROFILES_DIR, ICONS_DIR, EPIPHANY_PROFILES_DIR, FALKON_PROFILES_DIR]:
@@ -150,7 +150,7 @@ def get_webapps(self):
150150
print("Could not create webapp for path", path)
151151
traceback.print_exc()
152152

153-
return (webapps)
153+
return webapps
154154

155155
def get_supported_browsers(self):
156156
browsers = []
@@ -360,7 +360,7 @@ def normalize_url(url):
360360

361361
def download_image(root_url, link):
362362
image = None
363-
if ("://") not in link:
363+
if "://" not in link:
364364
if link.startswith("/"):
365365
link = root_url + link
366366
else:
@@ -420,7 +420,7 @@ def download_favicon(url):
420420
t = tempfile.NamedTemporaryFile(suffix=".png", delete=False)
421421
images.append(["Favicon Grabber", image, t.name])
422422
image.save(t.name)
423-
images = sorted(images, key = lambda x: (x[1].height), reverse=True)
423+
images = sorted(images, key = lambda x: x[1].height, reverse=True)
424424
if images:
425425
return images
426426
except Exception as e:
@@ -457,7 +457,7 @@ def download_favicon(url):
457457
except Exception as e:
458458
print(e)
459459

460-
images = sorted(images, key = lambda x: (x[1].height), reverse=True)
460+
images = sorted(images, key = lambda x: x[1].height, reverse=True)
461461
return images
462462

463463
if __name__ == "__main__":

usr/lib/webapp-manager/webapp-manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, application_id, flags):
4646

4747
def activate(self, application):
4848
windows = self.get_windows()
49-
if (len(windows) > 0):
49+
if len(windows) > 0:
5050
window = windows[0]
5151
window.present()
5252
window.show()
@@ -56,7 +56,7 @@ def activate(self, application):
5656
window.window.show()
5757

5858

59-
class WebAppManagerWindow():
59+
class WebAppManagerWindow:
6060

6161
def __init__(self, application):
6262

@@ -210,7 +210,7 @@ def __init__(self, application):
210210
print("No supported browsers were detected.")
211211
self.add_button.set_sensitive(False)
212212
self.add_button.set_tooltip_text(_("No supported browsers were detected."))
213-
if (num_browsers < 2):
213+
if num_browsers < 2:
214214
self.browser_label.hide()
215215
self.browser_combo.hide()
216216
self.browser_combo.connect("changed", self.on_browser_changed)
@@ -445,7 +445,7 @@ def on_browser_changed(self, widget):
445445

446446
def show_hide_browser_widgets(self):
447447
browser = self.browser_combo.get_model()[self.browser_combo.get_active()][BROWSER_OBJ]
448-
if (browser.browser_type == BROWSER_TYPE_FIREFOX):
448+
if browser.browser_type == BROWSER_TYPE_FIREFOX:
449449
self.isolated_label.hide()
450450
self.isolated_switch.hide()
451451
self.navbar_label.show()

0 commit comments

Comments
 (0)