Merge lp:~rbalint/update-manager/fix-pep8-cosmic into lp:update-manager

Proposed by Balint Reczey
Status: Merged
Merged at revision: 2841
Proposed branch: lp:~rbalint/update-manager/fix-pep8-cosmic
Merge into: lp:update-manager
Diff against target: 555 lines (+112/-98)
21 files modified
UpdateManager/ChangelogViewer.py (+2/-2)
UpdateManager/Core/MetaRelease.py (+4/-4)
UpdateManager/Core/MyCache.py (+15/-15)
UpdateManager/Core/UpdateList.py (+15/-14)
UpdateManager/Core/utils.py (+1/-1)
UpdateManager/Dialogs.py (+2/-2)
UpdateManager/UpdateManager.py (+3/-3)
UpdateManager/UpdatesAvailable.py (+11/-11)
UpdateManager/backend/InstallBackendAptdaemon.py (+2/-2)
UpdateManager/backend/__init__.py (+10/-10)
debian/changelog (+13/-0)
debian/source_update-manager.py (+3/-3)
janitor/plugincore/manager.py (+6/-6)
janitor/plugincore/plugins/dpkg_status_plugin.py (+3/-3)
janitor/plugincore/plugins/kdelibs4to5_plugin.py (+2/-2)
janitor/plugincore/plugins/langpack_manual_plugin.py (+4/-4)
janitor/plugincore/tests/test_documentation.py (+4/-4)
tests/test_hwe_support_status.py (+5/-5)
tests/test_pep8.py (+1/-1)
tests/test_update_origin.py (+4/-4)
tests/test_utils.py (+2/-2)
To merge this branch: bzr merge lp:~rbalint/update-manager/fix-pep8-cosmic
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+355774@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UpdateManager/ChangelogViewer.py'
--- UpdateManager/ChangelogViewer.py 2017-08-07 19:42:06 +0000
+++ UpdateManager/ChangelogViewer.py 2018-09-27 14:23:26 +0000
@@ -162,8 +162,8 @@
162 # search for the next match in the buffer162 # search for the next match in the buffer
163 for (start_str, end_list, url_prefix) in search_items:163 for (start_str, end_list, url_prefix) in search_items:
164 # init164 # init
165 iter = buffer.get_iter_at_offset(iter_end.get_offset() -165 iter = buffer.get_iter_at_offset(iter_end.get_offset() \
166 len(content))166 - len(content))
167 while True:167 while True:
168 ret = iter.forward_search(start_str,168 ret = iter.forward_search(start_str,
169 Gtk.TextSearchFlags.VISIBLE_ONLY,169 Gtk.TextSearchFlags.VISIBLE_ONLY,
170170
=== modified file 'UpdateManager/Core/MetaRelease.py'
--- UpdateManager/Core/MetaRelease.py 2018-08-29 07:37:52 +0000
+++ UpdateManager/Core/MetaRelease.py 2018-09-27 14:23:26 +0000
@@ -344,8 +344,8 @@
344 # sometime there is a root owned meta-relase file344 # sometime there is a root owned meta-relase file
345 # there, try to remove it so that we get it345 # there, try to remove it so that we get it
346 # with proper permissions346 # with proper permissions
347 if (os.path.exists(self.METARELEASE_FILE) and347 if (os.path.exists(self.METARELEASE_FILE) \
348 not os.access(self.METARELEASE_FILE, os.W_OK)):348 and not os.access(self.METARELEASE_FILE, os.W_OK)):
349 try:349 try:
350 os.unlink(self.METARELEASE_FILE)350 os.unlink(self.METARELEASE_FILE)
351 except OSError as e:351 except OSError as e:
@@ -381,8 +381,8 @@
381 try:381 try:
382 self.parse()382 self.parse()
383 except Exception as e:383 except Exception as e:
384 logging.exception("parse failed for '%s'" %384 logging.exception("parse failed for '%s'" \
385 self.METARELEASE_FILE)385 % self.METARELEASE_FILE)
386 # no use keeping a broken file around386 # no use keeping a broken file around
387 os.remove(self.METARELEASE_FILE)387 os.remove(self.METARELEASE_FILE)
388 # we don't want to keep a meta-release file around when it388 # we don't want to keep a meta-release file around when it
389389
=== modified file 'UpdateManager/Core/MyCache.py'
--- UpdateManager/Core/MyCache.py 2018-09-24 09:41:09 +0000
+++ UpdateManager/Core/MyCache.py 2018-09-27 14:23:26 +0000
@@ -84,8 +84,8 @@
84 # on broken packages, try to fix via saveDistUpgrade()84 # on broken packages, try to fix via saveDistUpgrade()
85 if self._depcache.broken_count > 0:85 if self._depcache.broken_count > 0:
86 self.saveDistUpgrade()86 self.saveDistUpgrade()
87 assert (self._depcache.broken_count == 0 and87 assert (self._depcache.broken_count == 0 \
88 self._depcache.del_count == 0)88 and self._depcache.del_count == 0)
89 self.launchpad = None89 self.launchpad = None
90 # generate versioned_kernel_pkgs_regexp for later use90 # generate versioned_kernel_pkgs_regexp for later use
91 apt_versioned_kernel_pkgs = apt_pkg.config.value_list(91 apt_versioned_kernel_pkgs = apt_pkg.config.value_list(
@@ -154,8 +154,8 @@
154 continue154 continue
155 match = True155 match = True
156 for base_dep in dep_or:156 for base_dep in dep_or:
157 if (base_dep.name != target.package.shortname or157 if (base_dep.name != target.package.shortname \
158 not apt_pkg.check_dep(158 or not apt_pkg.check_dep(
159 target.version, base_dep.relation, base_dep.version)):159 target.version, base_dep.relation, base_dep.version)):
160 match = False160 match = False
161 if match:161 if match:
@@ -170,8 +170,8 @@
170 candidate = cpkg.candidate170 candidate = cpkg.candidate
171 if candidate is not None:171 if candidate is not None:
172 if (self._check_dependencies(172 if (self._check_dependencies(
173 target, candidate.get_dependencies("Conflicts")) and173 target, candidate.get_dependencies("Conflicts")) \
174 self._check_dependencies(174 and self._check_dependencies(
175 target, candidate.get_dependencies("Replaces"))):175 target, candidate.get_dependencies("Replaces"))):
176 logging.info(176 logging.info(
177 "%s Conflicts/Replaces %s; allowing removal" % (177 "%s Conflicts/Replaces %s; allowing removal" % (
@@ -192,8 +192,8 @@
192 wouldDelete -= 1192 wouldDelete -= 1
193 if wouldDelete > 0:193 if wouldDelete > 0:
194 self.clear()194 self.clear()
195 assert (self._depcache.broken_count == 0 and195 assert (self._depcache.broken_count == 0 \
196 self._depcache.del_count == 0)196 and self._depcache.del_count == 0)
197 else:197 else:
198 assert self._depcache.broken_count == 0198 assert self._depcache.broken_count == 0
199 #self._apply_dselect_upgrade()199 #self._apply_dselect_upgrade()
@@ -259,7 +259,7 @@
259 #print(changelog.read())259 #print(changelog.read())
260 # do only get the lines that are new260 # do only get the lines that are new
261 alllines = ""261 alllines = ""
262 regexp = "^%s \((.*)\)(.*)$" % (re.escape(srcpkg))262 regexp = "^%s \\((.*)\\)(.*)$" % (re.escape(srcpkg))
263263
264 while True:264 while True:
265 line = changelog.readline().decode("UTF-8", "replace")265 line = changelog.readline().decode("UTF-8", "replace")
@@ -283,14 +283,14 @@
283 #283 #
284 # for NEWS.Debian we do require the changelogver > installed284 # for NEWS.Debian we do require the changelogver > installed
285 if strict_versioning:285 if strict_versioning:
286 if (installed and286 if (installed \
287 apt_pkg.version_compare(changelogver,287 and apt_pkg.version_compare(changelogver,
288 installed) < 0):288 installed) < 0):
289 break289 break
290 else:290 else:
291 if (installed and291 if (installed \
292 apt_pkg.version_compare(changelogver,292 and apt_pkg.version_compare(changelogver,
293 installed) == 0):293 installed) == 0):
294 break294 break
295 alllines = alllines + line295 alllines = alllines + line
296 return alllines296 return alllines
297297
=== modified file 'UpdateManager/Core/UpdateList.py'
--- UpdateManager/Core/UpdateList.py 2018-09-27 10:58:57 +0000
+++ UpdateManager/Core/UpdateList.py 2018-09-27 14:23:26 +0000
@@ -102,9 +102,9 @@
102 # This shouldn't really happen. If we land here often, it's a sign102 # This shouldn't really happen. If we land here often, it's a sign
103 # that something has gone wrong. Unless all pkgs are None it's not103 # that something has gone wrong. Unless all pkgs are None it's not
104 # a critical issue - a hit to the performance at most.104 # a critical issue - a hit to the performance at most.
105 reason = ((not pkg or not pkg.candidate) and105 reason = ((not pkg or not pkg.candidate) \
106 "Package was None or didn't have a candidate." or106 and "Package was None or didn't have a candidate." \
107 "%s already in _deps." % pkg.name)107 or "%s already in _deps." % pkg.name)
108 logging.debug("Useless call to _add_deps. %s" % reason)108 logging.debug("Useless call to _add_deps. %s" % reason)
109 return109 return
110 if len(self._deps) % 200 == 0 and callable(eventloop_callback):110 if len(self._deps) % 200 == 0 and callable(eventloop_callback):
@@ -140,8 +140,8 @@
140140
141 def selection_is_inconsistent(self):141 def selection_is_inconsistent(self):
142 pkgs_installing = [item for item in self.items if item.is_selected()]142 pkgs_installing = [item for item in self.items if item.is_selected()]
143 return (len(pkgs_installing) > 0 and143 return (len(pkgs_installing) > 0 \
144 len(pkgs_installing) < len(self.items))144 and len(pkgs_installing) < len(self.items))
145145
146 def get_total_size(self):146 def get_total_size(self):
147 if self.to_remove:147 if self.to_remove:
@@ -338,9 +338,9 @@
338 inst_ver = pkg._pkg.current_ver338 inst_ver = pkg._pkg.current_ver
339 for ver in pkg._pkg.version_list:339 for ver in pkg._pkg.version_list:
340 # discard is < than installed ver340 # discard is < than installed ver
341 if (inst_ver and341 if (inst_ver \
342 apt.apt_pkg.version_compare(ver.ver_str,342 and apt.apt_pkg.version_compare(ver.ver_str,
343 inst_ver.ver_str) <= 0):343 inst_ver.ver_str) <= 0):
344 continue344 continue
345 # check if we have a match345 # check if we have a match
346 for (verFileIter, index) in ver.file_list:346 for (verFileIter, index) in ver.file_list:
@@ -507,14 +507,15 @@
507 upgrade_pkgs.append(pkg)507 upgrade_pkgs.append(pkg)
508 self.num_updates = self.num_updates + 1508 self.num_updates = self.num_updates + 1
509509
510 if pkg.is_upgradable and not (pkg.marked_upgrade or510 if pkg.is_upgradable and not (pkg.marked_upgrade \
511 pkg.marked_install):511 or pkg.marked_install):
512 self.held_back.append(pkg.name)512 self.held_back.append(pkg.name)
513 continue513 continue
514 if (pkg.is_auto_removable and514 if (pkg.is_auto_removable \
515 (cache.versioned_kernel_pkgs_regexp and515 and (cache.versioned_kernel_pkgs_regexp \
516 cache.versioned_kernel_pkgs_regexp.match(pkg.name) and516 and cache.versioned_kernel_pkgs_regexp.match(pkg.name) \
517 not cache.running_kernel_pkgs_regexp.match(pkg.name))):517 and not cache.running_kernel_pkgs_regexp.match(
518 pkg.name))):
518 kernel_autoremove_pkgs.append(pkg)519 kernel_autoremove_pkgs.append(pkg)
519520
520 # perform operations after the loop to not skip packages which521 # perform operations after the loop to not skip packages which
521522
=== modified file 'UpdateManager/Core/utils.py'
--- UpdateManager/Core/utils.py 2018-06-25 09:15:45 +0000
+++ UpdateManager/Core/utils.py 2018-09-27 14:23:26 +0000
@@ -318,7 +318,7 @@
318 if proxies:318 if proxies:
319 # basic verification319 # basic verification
320 for proxy in proxies.values():320 for proxy in proxies.values():
321 if not re.match("https?://\w+", proxy):321 if not re.match("https?://\\w+", proxy):
322 print("proxy '%s' looks invalid" % proxy, file=sys.stderr)322 print("proxy '%s' looks invalid" % proxy, file=sys.stderr)
323 return323 return
324 proxy_support = ProxyHandler(proxies)324 proxy_support = ProxyHandler(proxies)
325325
=== modified file 'UpdateManager/Dialogs.py'
--- UpdateManager/Dialogs.py 2018-09-06 07:09:47 +0000
+++ UpdateManager/Dialogs.py 2018-09-27 14:23:26 +0000
@@ -368,8 +368,8 @@
368 Dialog.start(self)368 Dialog.start(self)
369 # Turn off close button369 # Turn off close button
370 self.window_main.realize()370 self.window_main.realize()
371 self.window_main.get_window().set_functions(Gdk.WMFunction.MOVE |371 self.window_main.get_window().set_functions(Gdk.WMFunction.MOVE \
372 Gdk.WMFunction.MINIMIZE)372 | Gdk.WMFunction.MINIMIZE)
373373
374 def restart(self, *args, **kwargs):374 def restart(self, *args, **kwargs):
375 self._request_reboot_via_session_manager()375 self._request_reboot_via_session_manager()
376376
=== modified file 'UpdateManager/UpdateManager.py'
--- UpdateManager/UpdateManager.py 2018-09-24 11:50:49 +0000
+++ UpdateManager/UpdateManager.py 2018-09-27 14:23:26 +0000
@@ -305,9 +305,9 @@
305305
306 # Check for new fresh release306 # Check for new fresh release
307 settings = Gio.Settings.new("com.ubuntu.update-manager")307 settings = Gio.Settings.new("com.ubuntu.update-manager")
308 if (self.meta_release.new_dist and308 if (self.meta_release.new_dist \
309 (self.options.check_dist_upgrades or309 and (self.options.check_dist_upgrades \
310 settings.get_boolean("check-dist-upgrades"))):310 or settings.get_boolean("check-dist-upgrades"))):
311 return DistUpgradeDialog(self, self.meta_release)311 return DistUpgradeDialog(self, self.meta_release)
312312
313 return None313 return None
314314
=== modified file 'UpdateManager/UpdatesAvailable.py'
--- UpdateManager/UpdatesAvailable.py 2018-09-24 09:41:09 +0000
+++ UpdateManager/UpdatesAvailable.py 2018-09-27 14:23:26 +0000
@@ -531,12 +531,12 @@
531 # set descr531 # set descr
532 data = model.get_value(iter, LIST_UPDATE_DATA)532 data = model.get_value(iter, LIST_UPDATE_DATA)
533 item = data.item533 item = data.item
534 if (item is None and data.group is not None and534 if (item is None and data.group is not None \
535 data.group.core_item is not None):535 and data.group.core_item is not None):
536 item = data.group.core_item536 item = data.group.core_item
537 if (item is None or item.pkg is None or537 if (item is None or item.pkg is None \
538 item.pkg.candidate is None or538 or item.pkg.candidate is None \
539 item.pkg.candidate.description is None):539 or item.pkg.candidate.description is None):
540 changes_buffer = self.textview_changes.get_buffer()540 changes_buffer = self.textview_changes.get_buffer()
541 changes_buffer.set_text("")541 changes_buffer.set_text("")
542 desc_buffer = self.textview_descr.get_buffer()542 desc_buffer = self.textview_descr.get_buffer()
@@ -724,8 +724,8 @@
724 self.hbox_restart.set_visible(requires_restart)724 self.hbox_restart.set_visible(requires_restart)
725725
726 def _refresh_updates_count(self):726 def _refresh_updates_count(self):
727 self.button_install.set_sensitive(self.cache.install_count +727 self.button_install.set_sensitive(self.cache.install_count \
728 self.cache.del_count)728 + self.cache.del_count)
729 try:729 try:
730 inst_count = self.cache.install_count + self.cache.del_count730 inst_count = self.cache.install_count + self.cache.del_count
731 self.dl_size = self.cache.required_download731 self.dl_size = self.cache.required_download
@@ -889,8 +889,8 @@
889 self.vbox_alerts.show()889 self.vbox_alerts.show()
890 self.connected = False890 self.connected = False
891 # in doubt (STATE_UNKNOWN), assume connected891 # in doubt (STATE_UNKNOWN), assume connected
892 elif (state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST or892 elif (state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST \
893 state == NetworkManagerHelper.NM_STATE_UNKNOWN):893 or state == NetworkManagerHelper.NM_STATE_UNKNOWN):
894 self.updates_changed()894 self.updates_changed()
895 self.hbox_offline.hide()895 self.hbox_offline.hide()
896 self.connected = True896 self.connected = True
@@ -1067,8 +1067,8 @@
10671067
1068 self.treeview_update.set_model(self.store)1068 self.treeview_update.set_model(self.store)
1069 self.pkg_cell_area.indent_toplevel = (1069 self.pkg_cell_area.indent_toplevel = (
1070 bool(self.list.security_groups) or1070 bool(self.list.security_groups) \
1071 bool(self.list.kernel_autoremove_groups))1071 or bool(self.list.kernel_autoremove_groups))
1072 self.update_close_button()1072 self.update_close_button()
1073 self.update_count()1073 self.update_count()
1074 self.setBusy(False)1074 self.setBusy(False)
10751075
=== modified file 'UpdateManager/backend/InstallBackendAptdaemon.py'
--- UpdateManager/backend/InstallBackendAptdaemon.py 2018-09-24 11:50:49 +0000
+++ UpdateManager/backend/InstallBackendAptdaemon.py 2018-09-27 14:23:26 +0000
@@ -113,8 +113,8 @@
113 label_details.set_label(get_status_string_from_enum(status))113 label_details.set_label(get_status_string_from_enum(status))
114 # Also resize the window if we switch from download details to114 # Also resize the window if we switch from download details to
115 # the terminal window115 # the terminal window
116 if (status == STATUS_COMMITTING and expander and116 if status == STATUS_COMMITTING and expander \
117 expander.terminal.get_visible()):117 and expander.terminal.get_visible():
118 self._resize_to_show_details(expander)118 self._resize_to_show_details(expander)
119119
120 @inline_callbacks120 @inline_callbacks
121121
=== modified file 'UpdateManager/backend/__init__.py'
--- UpdateManager/backend/__init__.py 2018-09-11 13:51:21 +0000
+++ UpdateManager/backend/__init__.py 2018-09-27 14:23:26 +0000
@@ -40,17 +40,17 @@
40 fresh_cache = Cache(rootdir=self.window_main.cache.rootdir)40 fresh_cache = Cache(rootdir=self.window_main.cache.rootdir)
41 for pkg in self.window_main.cache:41 for pkg in self.window_main.cache:
42 try:42 try:
43 if pkg.marked_install and \43 if pkg.marked_install \
44 not fresh_cache[pkg.name].is_installed:44 and not fresh_cache[pkg.name].is_installed:
45 pkgname = pkg.name45 pkgname = pkg.name
46 if pkg.is_auto_installed:46 if pkg.is_auto_installed:
47 pkgname += "#auto"47 pkgname += "#auto"
48 pkgs_install.append(pkgname)48 pkgs_install.append(pkgname)
49 elif (pkg.marked_upgrade and49 elif (pkg.marked_upgrade \
50 fresh_cache[pkg.name].is_upgradable):50 and fresh_cache[pkg.name].is_upgradable):
51 pkgs_upgrade.append(pkg.name)51 pkgs_upgrade.append(pkg.name)
52 elif (pkg.marked_delete and52 elif (pkg.marked_delete \
53 fresh_cache[pkg.name].is_installed):53 and fresh_cache[pkg.name].is_installed):
54 pkgs_remove.append(pkg.name)54 pkgs_remove.append(pkg.name)
55 except KeyError:55 except KeyError:
56 # pkg missing from fresh_cache can't be modified56 # pkg missing from fresh_cache can't be modified
@@ -98,8 +98,8 @@
98def get_backend(*args, **kwargs):98def get_backend(*args, **kwargs):
99 """Select and return a package manager backend."""99 """Select and return a package manager backend."""
100 # try aptdaemon100 # try aptdaemon
101 if (os.path.exists("/usr/sbin/aptd") and101 if (os.path.exists("/usr/sbin/aptd") \
102 "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" not in os.environ):102 and "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" not in os.environ):
103 # check if the gtkwidgets are installed as well103 # check if the gtkwidgets are installed as well
104 try:104 try:
105 from .InstallBackendAptdaemon import InstallBackendAptdaemon105 from .InstallBackendAptdaemon import InstallBackendAptdaemon
@@ -108,8 +108,8 @@
108 import logging108 import logging
109 logging.exception("importing aptdaemon")109 logging.exception("importing aptdaemon")
110 # try synaptic110 # try synaptic
111 if (os.path.exists("/usr/sbin/synaptic") and111 if (os.path.exists("/usr/sbin/synaptic") \
112 "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ):112 and "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ):
113 from .InstallBackendSynaptic import InstallBackendSynaptic113 from .InstallBackendSynaptic import InstallBackendSynaptic
114 return InstallBackendSynaptic(*args, **kwargs)114 return InstallBackendSynaptic(*args, **kwargs)
115 # nothing found, raise115 # nothing found, raise
116116
=== modified file 'debian/changelog'
--- debian/changelog 2018-09-24 09:11:27 +0000
+++ debian/changelog 2018-09-27 14:23:26 +0000
@@ -1,3 +1,16 @@
1update-manager (1:18.10.9) cosmic; urgency=medium
2
3 * Allow unselecting updates and performing only removals (LP: #1792320)
4 * Stop trying apt_pkg.pkgsystem_(un)lock(), as a normal user it always fails
5 * Keep or delete packages after looping over all of them.
6 This prevents the resolver from changing the packages in the loop resulting
7 in not keeping some phased packages back from being upgraded. (LP: #1072136)
8 * Fix PEP 8 warnings
9 Also ignore "E502 the backslash is redundant between brackets" because the
10 additional brackets help readability.
11
12 -- Balint Reczey <rbalint@ubuntu.com> Thu, 27 Sep 2018 15:19:02 +0200
13
1update-manager (1:18.10.8) cosmic; urgency=medium14update-manager (1:18.10.8) cosmic; urgency=medium
215
3 * Print transaction error and let the user try again applying updates16 * Print transaction error and let the user try again applying updates
417
=== modified file 'debian/source_update-manager.py'
--- debian/source_update-manager.py 2017-08-07 20:54:58 +0000
+++ debian/source_update-manager.py 2018-09-27 14:23:26 +0000
@@ -27,9 +27,9 @@
27 elif sp.returncode == 10:27 elif sp.returncode == 10:
28 res = out.strip()28 res = out.strip()
29 else:29 else:
30 res = (b'Error: command ' + str(command).encode() +30 res = (b'Error: command ' + str(command).encode() \
31 b' failed with exit code ' +31 + b' failed with exit code ' \
32 str(sp.returncode).encode() + b': ' + out)32 + str(sp.returncode).encode() + b': ' + out)
33 return res33 return res
3434
3535
3636
=== modified file 'janitor/plugincore/manager.py'
--- janitor/plugincore/manager.py 2012-06-28 00:11:57 +0000
+++ janitor/plugincore/manager.py 2018-09-27 14:23:26 +0000
@@ -81,9 +81,9 @@
81 """Find and instantiate all plugins in a module."""81 """Find and instantiate all plugins in a module."""
82 def is_plugin(target):82 def is_plugin(target):
83 # Don't return the base class itself.83 # Don't return the base class itself.
84 return (inspect.isclass(target) and84 return (inspect.isclass(target) \
85 issubclass(target, Plugin) and85 and issubclass(target, Plugin) \
86 target is not Plugin)86 and target is not Plugin)
87 plugin_classes = [87 plugin_classes = [
88 member88 member
89 for name, member in inspect.getmembers(module, is_plugin)89 for name, member in inspect.getmembers(module, is_plugin)
@@ -177,9 +177,9 @@
177 # condition.177 # condition.
178 plugins = [178 plugins = [
179 plugin for plugin in self._plugins179 plugin for plugin in self._plugins
180 if (plugin.condition == condition or180 if (plugin.condition == condition \
181 condition in plugin.condition or181 or condition in plugin.condition \
182 condition == '*')182 or condition == '*')
183 ]183 ]
184 logging.debug("plugins for condition '{}' are '{}'".format(184 logging.debug("plugins for condition '{}' are '{}'".format(
185 condition, plugins))185 condition, plugins))
186186
=== modified file 'janitor/plugincore/plugins/dpkg_status_plugin.py'
--- janitor/plugincore/plugins/dpkg_status_plugin.py 2012-06-27 21:49:20 +0000
+++ janitor/plugincore/plugins/dpkg_status_plugin.py 2018-09-27 14:23:26 +0000
@@ -70,9 +70,9 @@
70 while tagf.step():70 while tagf.step():
71 statusline = tagf.section.get('Status')71 statusline = tagf.section.get('Status')
72 (want, flag, status) = statusline.split()72 (want, flag, status) = statusline.split()
73 if (want == 'purge' and73 if want == 'purge' \
74 flag == 'ok' and74 and flag == 'ok' \
75 status == 'not-installed'):75 and status == 'not-installed':
76 # Then...76 # Then...
77 n_cruft += 177 n_cruft += 1
78 logging.debug('DpkgStatusPlugin found {} cruft items'.format(n_cruft))78 logging.debug('DpkgStatusPlugin found {} cruft items'.format(n_cruft))
7979
=== modified file 'janitor/plugincore/plugins/kdelibs4to5_plugin.py'
--- janitor/plugincore/plugins/kdelibs4to5_plugin.py 2012-06-27 21:49:20 +0000
+++ janitor/plugincore/plugins/kdelibs4to5_plugin.py 2018-09-27 14:23:26 +0000
@@ -43,8 +43,8 @@
43 fromp = 'kdelibs4-dev'43 fromp = 'kdelibs4-dev'
44 top = 'kdelibs5-dev'44 top = 'kdelibs5-dev'
45 cache = self.app.apt_cache45 cache = self.app.apt_cache
46 if (fromp in cache and cache[fromp].is_installed and46 if (fromp in cache and cache[fromp].is_installed \
47 top in cache and not cache[top].is_installed):47 and top in cache and not cache[top].is_installed):
48 yield MissingPackageCruft(48 yield MissingPackageCruft(
49 cache[top],49 cache[top],
50 _('When upgrading, if kdelibs4-dev is installed, '50 _('When upgrading, if kdelibs4-dev is installed, '
5151
=== modified file 'janitor/plugincore/plugins/langpack_manual_plugin.py'
--- janitor/plugincore/plugins/langpack_manual_plugin.py 2012-06-27 21:49:20 +0000
+++ janitor/plugincore/plugins/langpack_manual_plugin.py 2018-09-27 14:23:26 +0000
@@ -68,10 +68,10 @@
68 # language-support-* - we fix this here68 # language-support-* - we fix this here
69 cache = self.app.apt_cache69 cache = self.app.apt_cache
70 for pkg in cache:70 for pkg in cache:
71 if (pkg.name.startswith('language-pack-') and71 if (pkg.name.startswith('language-pack-') \
72 not pkg.name.endswith('-base') and72 and not pkg.name.endswith('-base') \
73 cache._depcache.IsAutoInstalled(pkg._pkg) and73 and cache._depcache.IsAutoInstalled(pkg._pkg) \
74 pkg.is_installed):74 and pkg.is_installed):
75 # Then...75 # Then...
76 logging.debug("setting '%s' to manual installed" % pkg.name)76 logging.debug("setting '%s' to manual installed" % pkg.name)
77 yield ManualInstallCruft(pkg)77 yield ManualInstallCruft(pkg)
7878
=== modified file 'janitor/plugincore/tests/test_documentation.py'
--- janitor/plugincore/tests/test_documentation.py 2017-08-07 20:54:58 +0000
+++ janitor/plugincore/tests/test_documentation.py 2018-09-27 14:23:26 +0000
@@ -34,10 +34,10 @@
34COMMASPACE = ', '34COMMASPACE = ', '
35DOT = '.'35DOT = '.'
36DOCTEST_FLAGS = (36DOCTEST_FLAGS = (
37 doctest.ELLIPSIS |37 doctest.ELLIPSIS \
38 doctest.NORMALIZE_WHITESPACE |38 | doctest.NORMALIZE_WHITESPACE \
39 doctest.REPORT_NDIFF |39 | doctest.REPORT_NDIFF \
40 doctest.IGNORE_EXCEPTION_DETAIL)40 | doctest.IGNORE_EXCEPTION_DETAIL)
4141
4242
43WHOAMI = 'janitor.plugincore'43WHOAMI = 'janitor.plugincore'
4444
=== modified file 'tests/test_hwe_support_status.py'
--- tests/test_hwe_support_status.py 2017-08-07 20:54:58 +0000
+++ tests/test_hwe_support_status.py 2018-09-27 14:23:26 +0000
@@ -38,14 +38,14 @@
38 )38 )
3939
40 INSTALLED_UNSUPPORTED_HWE_PKG_NAMES = (40 INSTALLED_UNSUPPORTED_HWE_PKG_NAMES = (
41 INSTALLED_UNSUPPORTED_HWE_KERNEL_PKG_NAMES +41 INSTALLED_UNSUPPORTED_HWE_KERNEL_PKG_NAMES \
42 INSTALLED_UNSUPPORTED_HWE_XORG_PKG_NAMES)42 + INSTALLED_UNSUPPORTED_HWE_XORG_PKG_NAMES)
4343
44 def setUp(self):44 def setUp(self):
45 self.cache = []45 self.cache = []
46 INSTALL = (self.INSTALLED_UNSUPPORTED_HWE_PKG_NAMES +46 INSTALL = (self.INSTALLED_UNSUPPORTED_HWE_PKG_NAMES \
47 self.INSTALLED_SUPPORTED_HWE_PKG_NAMES +47 + self.INSTALLED_SUPPORTED_HWE_PKG_NAMES \
48 self.INSTALLED_OTHER_PKG_NAMES)48 + self.INSTALLED_OTHER_PKG_NAMES)
49 for name in INSTALL:49 for name in INSTALL:
50 self.cache.append(make_mock_pkg(name))50 self.cache.append(make_mock_pkg(name))
5151
5252
=== modified file 'tests/test_pep8.py'
--- tests/test_pep8.py 2017-08-07 20:54:58 +0000
+++ tests/test_pep8.py 2018-09-27 14:23:26 +0000
@@ -6,7 +6,7 @@
6import unittest6import unittest
77
8# pep8 is overdoing it a bit IMO8# pep8 is overdoing it a bit IMO
9IGNORE_PEP8 = "E265,E402"9IGNORE_PEP8 = "E265,E402,E502"
10IGNORE_FILES = (10IGNORE_FILES = (
11)11)
1212
1313
=== modified file 'tests/test_update_origin.py'
--- tests/test_update_origin.py 2017-09-11 10:39:17 +0000
+++ tests/test_update_origin.py 2018-09-27 14:23:26 +0000
@@ -90,10 +90,10 @@
90 if o.archive == "xenial-security":90 if o.archive == "xenial-security":
91 had_security = True91 had_security = True
92 break92 break
93 if (is_in_updates and93 if (is_in_updates \
94 not is_in_security and94 and not is_in_security \
95 had_security and95 and had_security \
96 len(pkg._pkg.version_list) > 2):96 and len(pkg._pkg.version_list) > 2):
97 test_pkgs.add(pkg.name)97 test_pkgs.add(pkg.name)
98 self.assertTrue(len(test_pkgs) > 0,98 self.assertTrue(len(test_pkgs) > 0,
99 "no suitable test package found that has a version in "99 "no suitable test package found that has a version in "
100100
=== modified file 'tests/test_utils.py'
--- tests/test_utils.py 2017-08-30 16:55:46 +0000
+++ tests/test_utils.py 2018-09-27 14:23:26 +0000
@@ -32,8 +32,8 @@
32 mock.mock_open(read_data=data)) as mock_file:32 mock.mock_open(read_data=data)) as mock_file:
33 assert open("/proc/1/stat").read() == data33 assert open("/proc/1/stat").read() == data
34 mock_file.assert_called_with("/proc/1/stat")34 mock_file.assert_called_with("/proc/1/stat")
35 self.assertTrue(utils.is_child_of_process_name("init") or35 self.assertTrue(utils.is_child_of_process_name("init") \
36 utils.is_child_of_process_name("systemd"))36 or utils.is_child_of_process_name("systemd"))
37 self.assertFalse(utils.is_child_of_process_name("mvo"))37 self.assertFalse(utils.is_child_of_process_name("mvo"))
3838
39 def test_is_port_listening(self):39 def test_is_port_listening(self):

Subscribers

People subscribed via source and target branches

to status/vote changes: