Skip to content

Commit 50a88f5

Browse files
authored
remove redundant parentheses (#11259)
* remove redundant parentheses
1 parent 7669cbe commit 50a88f5

37 files changed

+99
-99
lines changed

calendar-server/cinnamon-calendar-server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def ext_color_prop_changed(self, extension, pspect, data=None):
6464
self.color = self.extension.get_color()
6565
self.emit("color-changed")
6666

67-
class Event():
67+
class Event:
6868
def __init__(self, uid, color, summary, all_day, start_timet, end_timet, mod_timet):
6969
self.__dict__.update(locals())
7070

@@ -293,7 +293,7 @@ def view_objects_removed(self, view, component_ids, calendar):
293293
self.handle_removed_objects(view, component_ids, calendar)
294294

295295
def handle_new_or_modified_objects(self, view, objects, calendar):
296-
if (calendar.view_cancellable.is_cancelled()):
296+
if calendar.view_cancellable.is_cancelled():
297297
return
298298

299299
self.hold()

docs/reference/cinnamon-js/gen_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def format_ext_link(match):
100100

101101
return line
102102

103-
class JSThing():
103+
class JSThing:
104104
def append_description(self, desc):
105105
self.description += desc.replace('<', '&lt;').replace('>', '&gt;')
106106

files/usr/bin/cinnamon-launcher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def idle_function(func):
4646
GLib.idle_add(func, *args)
4747
return wrapper
4848

49-
class Launcher():
49+
class Launcher:
5050

5151
def __init__(self):
5252
self.fb_pid = 0

files/usr/bin/cinnamon-spice-updater

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import sys
55
import argparse
66
import json
77

8-
class UpdateSpices():
8+
class UpdateSpices:
99
def __init__(self):
1010
parser = argparse.ArgumentParser(description='Cinnamon Spice Updater',
1111
epilog="spice-type should be 'applet', 'desklet', 'extension' or 'theme'.")
@@ -43,7 +43,7 @@ class UpdateSpices():
4343
self.updater.refresh_all_caches()
4444
updates = self.updater.get_updates()
4545

46-
if (len(updates) == 0):
46+
if len(updates) == 0:
4747
print("There are no Spice updates")
4848
return
4949

@@ -59,7 +59,7 @@ class UpdateSpices():
5959
self.updater.refresh_cache_for_type(spice_type)
6060
updates = self.updater.get_updates_of_type(spice_type)
6161

62-
if (len(updates) == 0):
62+
if len(updates) == 0:
6363
print("There are no %s updates" % spice_type)
6464
return
6565

files/usr/bin/cinnamon-xlet-makepot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def do_install(uuid, dir):
187187

188188
def do_remove(uuid):
189189
files_removed = 0
190-
if (os.path.exists(LOCALE_DIR)):
190+
if os.path.exists(LOCALE_DIR):
191191
locale_names = os.listdir(LOCALE_DIR)
192192
for locale_name in locale_names:
193193
lang_locale_dir = os.path.join(LOCALE_DIR, locale_name)

files/usr/share/cinnamon/applets/[email protected]/cancel-print-dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# i18n
1010
gettext.install("cinnamon", "/usr/share/locale")
1111

12-
class CancelPrintJob():
12+
class CancelPrintJob:
1313
def __init__(self):
1414
self.message_dialog = Gtk.MessageDialog(
1515
parent=Gtk.Window(),

files/usr/share/cinnamon/cinnamon-looking-glass/lookingglass_proxy.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def GetResults(self):
8181
return self._proxy.GetResults('()')
8282
except Exception:
8383
pass
84-
return (False, "")
84+
return False, ""
8585

8686
def AddResult(self, code):
8787
if self._proxy:
@@ -96,15 +96,15 @@ def GetErrorStack(self):
9696
return self._proxy.GetErrorStack('()')
9797
except Exception:
9898
pass
99-
return (False, "")
99+
return False, ""
100100

101101
def GetMemoryInfo(self):
102102
if self._proxy:
103103
try:
104104
return self._proxy.GetMemoryInfo('()')
105105
except Exception:
106106
pass
107-
return (False, 0, {})
107+
return False, 0, {}
108108

109109
def FullGc(self):
110110
if self._proxy:
@@ -119,15 +119,15 @@ def Inspect(self, code):
119119
return self._proxy.Inspect('(s)', code)
120120
except Exception:
121121
pass
122-
return (False, "")
122+
return False, ""
123123

124124
def GetLatestWindowList(self):
125125
if self._proxy:
126126
try:
127127
return self._proxy.GetLatestWindowList('()')
128128
except Exception:
129129
pass
130-
return (False, "")
130+
return False, ""
131131

132132
def StartInspector(self):
133133
if self._proxy:
@@ -142,12 +142,12 @@ def GetExtensionList(self):
142142
return self._proxy.GetExtensionList('()')
143143
except Exception:
144144
pass
145-
return (False, "")
145+
return False, ""
146146

147147
def ReloadExtension(self, uuid, xlet_type):
148148
if self._proxy:
149149
try:
150150
return self._proxy.ReloadExtension('(ss)', uuid, xlet_type)
151151
except Exception:
152152
pass
153-
return (False, "")
153+
return False, ""

files/usr/share/cinnamon/cinnamon-looking-glass/page_log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from gi.repository import Gtk
55
import pageutils
66

7-
class LogEntry():
7+
class LogEntry:
88
def __init__(self, category, time, message):
99
self.category = category
1010
self.time = int(time)

files/usr/share/cinnamon/cinnamon-menu-editor/cme/MenuEditor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def restoreMenu(self, menu):
100100

101101
def getMenus(self, parent):
102102
if parent is None:
103-
yield (self.tree.get_root_directory(), True)
103+
yield self.tree.get_root_directory(), True
104104
return
105105

106106
item_iter = parent.iter()
@@ -113,7 +113,7 @@ def getMenus(self, parent):
113113
item_type = item_iter.next()
114114
items.sort(key=util.menuSortKey)
115115
for item in items:
116-
yield (item, self.isVisible(item))
116+
yield item, self.isVisible(item)
117117

118118
def getContents(self, item):
119119
contents = []
@@ -152,7 +152,7 @@ def getItems(self, menu):
152152
item = item_iter.get_alias()
153153
elif item_type == CMenu.TreeItemType.SEPARATOR:
154154
item = item_iter.get_separator()
155-
yield (item, self.isVisible(item))
155+
yield item, self.isVisible(item)
156156
item_type = item_iter.next()
157157

158158
def canRevert(self, item):
@@ -249,12 +249,12 @@ def copyItem(self, item):
249249
file_path = item.get_desktop_file_path()
250250
copy_buffer = GLib.KeyFile()
251251
copy_buffer.load_from_file(file_path, util.KEY_FILE_FLAGS)
252-
return (copy_buffer, None)
252+
return copy_buffer, None
253253

254254
def cutItem(self, item):
255255
copy_buffer, file_id = self.copyItem(item)
256256
file_id = self.deleteItem(item)
257-
return (copy_buffer, file_id)
257+
return copy_buffer, file_id
258258

259259
def pasteItem(self, cut_copy_buffer, menu, file_id = None):
260260
try:

files/usr/share/cinnamon/cinnamon-screensaver-lock-dialog/cinnamon-screensaver-lock-dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self):
5656

5757
def lock_screen(self, data):
5858
message = self.entry.get_text()
59-
if (message != ""):
59+
if message != "":
6060
subprocess.call(["cinnamon-screensaver-command", "--lock", "--away-message", self.entry.get_text()])
6161
else:
6262
subprocess.call(["cinnamon-screensaver-command", "--lock"])

0 commit comments

Comments
 (0)