Merge lp:~rbalint/update-manager/fix-pep8-cosmic into lp:update-manager
- fix-pep8-cosmic
- Merge into main
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 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Murray | Approve | ||
Review via email: mp+355774@code.launchpad.net |
Commit message
Description of the change
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
1 | === modified file 'UpdateManager/ChangelogViewer.py' | |||
2 | --- UpdateManager/ChangelogViewer.py 2017-08-07 19:42:06 +0000 | |||
3 | +++ UpdateManager/ChangelogViewer.py 2018-09-27 14:23:26 +0000 | |||
4 | @@ -162,8 +162,8 @@ | |||
5 | 162 | # search for the next match in the buffer | 162 | # search for the next match in the buffer |
6 | 163 | for (start_str, end_list, url_prefix) in search_items: | 163 | for (start_str, end_list, url_prefix) in search_items: |
7 | 164 | # init | 164 | # init |
10 | 165 | iter = buffer.get_iter_at_offset(iter_end.get_offset() - | 165 | iter = buffer.get_iter_at_offset(iter_end.get_offset() \ |
11 | 166 | len(content)) | 166 | - len(content)) |
12 | 167 | while True: | 167 | while True: |
13 | 168 | ret = iter.forward_search(start_str, | 168 | ret = iter.forward_search(start_str, |
14 | 169 | Gtk.TextSearchFlags.VISIBLE_ONLY, | 169 | Gtk.TextSearchFlags.VISIBLE_ONLY, |
15 | 170 | 170 | ||
16 | === modified file 'UpdateManager/Core/MetaRelease.py' | |||
17 | --- UpdateManager/Core/MetaRelease.py 2018-08-29 07:37:52 +0000 | |||
18 | +++ UpdateManager/Core/MetaRelease.py 2018-09-27 14:23:26 +0000 | |||
19 | @@ -344,8 +344,8 @@ | |||
20 | 344 | # sometime there is a root owned meta-relase file | 344 | # sometime there is a root owned meta-relase file |
21 | 345 | # there, try to remove it so that we get it | 345 | # there, try to remove it so that we get it |
22 | 346 | # with proper permissions | 346 | # with proper permissions |
25 | 347 | if (os.path.exists(self.METARELEASE_FILE) and | 347 | if (os.path.exists(self.METARELEASE_FILE) \ |
26 | 348 | not os.access(self.METARELEASE_FILE, os.W_OK)): | 348 | and not os.access(self.METARELEASE_FILE, os.W_OK)): |
27 | 349 | try: | 349 | try: |
28 | 350 | os.unlink(self.METARELEASE_FILE) | 350 | os.unlink(self.METARELEASE_FILE) |
29 | 351 | except OSError as e: | 351 | except OSError as e: |
30 | @@ -381,8 +381,8 @@ | |||
31 | 381 | try: | 381 | try: |
32 | 382 | self.parse() | 382 | self.parse() |
33 | 383 | except Exception as e: | 383 | except Exception as e: |
36 | 384 | logging.exception("parse failed for '%s'" % | 384 | logging.exception("parse failed for '%s'" \ |
37 | 385 | self.METARELEASE_FILE) | 385 | % self.METARELEASE_FILE) |
38 | 386 | # no use keeping a broken file around | 386 | # no use keeping a broken file around |
39 | 387 | os.remove(self.METARELEASE_FILE) | 387 | os.remove(self.METARELEASE_FILE) |
40 | 388 | # we don't want to keep a meta-release file around when it | 388 | # we don't want to keep a meta-release file around when it |
41 | 389 | 389 | ||
42 | === modified file 'UpdateManager/Core/MyCache.py' | |||
43 | --- UpdateManager/Core/MyCache.py 2018-09-24 09:41:09 +0000 | |||
44 | +++ UpdateManager/Core/MyCache.py 2018-09-27 14:23:26 +0000 | |||
45 | @@ -84,8 +84,8 @@ | |||
46 | 84 | # on broken packages, try to fix via saveDistUpgrade() | 84 | # on broken packages, try to fix via saveDistUpgrade() |
47 | 85 | if self._depcache.broken_count > 0: | 85 | if self._depcache.broken_count > 0: |
48 | 86 | self.saveDistUpgrade() | 86 | self.saveDistUpgrade() |
51 | 87 | assert (self._depcache.broken_count == 0 and | 87 | assert (self._depcache.broken_count == 0 \ |
52 | 88 | self._depcache.del_count == 0) | 88 | and self._depcache.del_count == 0) |
53 | 89 | self.launchpad = None | 89 | self.launchpad = None |
54 | 90 | # generate versioned_kernel_pkgs_regexp for later use | 90 | # generate versioned_kernel_pkgs_regexp for later use |
55 | 91 | apt_versioned_kernel_pkgs = apt_pkg.config.value_list( | 91 | apt_versioned_kernel_pkgs = apt_pkg.config.value_list( |
56 | @@ -154,8 +154,8 @@ | |||
57 | 154 | continue | 154 | continue |
58 | 155 | match = True | 155 | match = True |
59 | 156 | for base_dep in dep_or: | 156 | for base_dep in dep_or: |
62 | 157 | if (base_dep.name != target.package.shortname or | 157 | if (base_dep.name != target.package.shortname \ |
63 | 158 | not apt_pkg.check_dep( | 158 | or not apt_pkg.check_dep( |
64 | 159 | target.version, base_dep.relation, base_dep.version)): | 159 | target.version, base_dep.relation, base_dep.version)): |
65 | 160 | match = False | 160 | match = False |
66 | 161 | if match: | 161 | if match: |
67 | @@ -170,8 +170,8 @@ | |||
68 | 170 | candidate = cpkg.candidate | 170 | candidate = cpkg.candidate |
69 | 171 | if candidate is not None: | 171 | if candidate is not None: |
70 | 172 | if (self._check_dependencies( | 172 | if (self._check_dependencies( |
73 | 173 | target, candidate.get_dependencies("Conflicts")) and | 173 | target, candidate.get_dependencies("Conflicts")) \ |
74 | 174 | self._check_dependencies( | 174 | and self._check_dependencies( |
75 | 175 | target, candidate.get_dependencies("Replaces"))): | 175 | target, candidate.get_dependencies("Replaces"))): |
76 | 176 | logging.info( | 176 | logging.info( |
77 | 177 | "%s Conflicts/Replaces %s; allowing removal" % ( | 177 | "%s Conflicts/Replaces %s; allowing removal" % ( |
78 | @@ -192,8 +192,8 @@ | |||
79 | 192 | wouldDelete -= 1 | 192 | wouldDelete -= 1 |
80 | 193 | if wouldDelete > 0: | 193 | if wouldDelete > 0: |
81 | 194 | self.clear() | 194 | self.clear() |
84 | 195 | assert (self._depcache.broken_count == 0 and | 195 | assert (self._depcache.broken_count == 0 \ |
85 | 196 | self._depcache.del_count == 0) | 196 | and self._depcache.del_count == 0) |
86 | 197 | else: | 197 | else: |
87 | 198 | assert self._depcache.broken_count == 0 | 198 | assert self._depcache.broken_count == 0 |
88 | 199 | #self._apply_dselect_upgrade() | 199 | #self._apply_dselect_upgrade() |
89 | @@ -259,7 +259,7 @@ | |||
90 | 259 | #print(changelog.read()) | 259 | #print(changelog.read()) |
91 | 260 | # do only get the lines that are new | 260 | # do only get the lines that are new |
92 | 261 | alllines = "" | 261 | alllines = "" |
94 | 262 | regexp = "^%s \((.*)\)(.*)$" % (re.escape(srcpkg)) | 262 | regexp = "^%s \\((.*)\\)(.*)$" % (re.escape(srcpkg)) |
95 | 263 | 263 | ||
96 | 264 | while True: | 264 | while True: |
97 | 265 | line = changelog.readline().decode("UTF-8", "replace") | 265 | line = changelog.readline().decode("UTF-8", "replace") |
98 | @@ -283,14 +283,14 @@ | |||
99 | 283 | # | 283 | # |
100 | 284 | # for NEWS.Debian we do require the changelogver > installed | 284 | # for NEWS.Debian we do require the changelogver > installed |
101 | 285 | if strict_versioning: | 285 | if strict_versioning: |
105 | 286 | if (installed and | 286 | if (installed \ |
106 | 287 | apt_pkg.version_compare(changelogver, | 287 | and apt_pkg.version_compare(changelogver, |
107 | 288 | installed) < 0): | 288 | installed) < 0): |
108 | 289 | break | 289 | break |
109 | 290 | else: | 290 | else: |
113 | 291 | if (installed and | 291 | if (installed \ |
114 | 292 | apt_pkg.version_compare(changelogver, | 292 | and apt_pkg.version_compare(changelogver, |
115 | 293 | installed) == 0): | 293 | installed) == 0): |
116 | 294 | break | 294 | break |
117 | 295 | alllines = alllines + line | 295 | alllines = alllines + line |
118 | 296 | return alllines | 296 | return alllines |
119 | 297 | 297 | ||
120 | === modified file 'UpdateManager/Core/UpdateList.py' | |||
121 | --- UpdateManager/Core/UpdateList.py 2018-09-27 10:58:57 +0000 | |||
122 | +++ UpdateManager/Core/UpdateList.py 2018-09-27 14:23:26 +0000 | |||
123 | @@ -102,9 +102,9 @@ | |||
124 | 102 | # This shouldn't really happen. If we land here often, it's a sign | 102 | # This shouldn't really happen. If we land here often, it's a sign |
125 | 103 | # that something has gone wrong. Unless all pkgs are None it's not | 103 | # that something has gone wrong. Unless all pkgs are None it's not |
126 | 104 | # a critical issue - a hit to the performance at most. | 104 | # a critical issue - a hit to the performance at most. |
130 | 105 | reason = ((not pkg or not pkg.candidate) and | 105 | reason = ((not pkg or not pkg.candidate) \ |
131 | 106 | "Package was None or didn't have a candidate." or | 106 | and "Package was None or didn't have a candidate." \ |
132 | 107 | "%s already in _deps." % pkg.name) | 107 | or "%s already in _deps." % pkg.name) |
133 | 108 | logging.debug("Useless call to _add_deps. %s" % reason) | 108 | logging.debug("Useless call to _add_deps. %s" % reason) |
134 | 109 | return | 109 | return |
135 | 110 | if len(self._deps) % 200 == 0 and callable(eventloop_callback): | 110 | if len(self._deps) % 200 == 0 and callable(eventloop_callback): |
136 | @@ -140,8 +140,8 @@ | |||
137 | 140 | 140 | ||
138 | 141 | def selection_is_inconsistent(self): | 141 | def selection_is_inconsistent(self): |
139 | 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()] |
142 | 143 | return (len(pkgs_installing) > 0 and | 143 | return (len(pkgs_installing) > 0 \ |
143 | 144 | len(pkgs_installing) < len(self.items)) | 144 | and len(pkgs_installing) < len(self.items)) |
144 | 145 | 145 | ||
145 | 146 | def get_total_size(self): | 146 | def get_total_size(self): |
146 | 147 | if self.to_remove: | 147 | if self.to_remove: |
147 | @@ -338,9 +338,9 @@ | |||
148 | 338 | inst_ver = pkg._pkg.current_ver | 338 | inst_ver = pkg._pkg.current_ver |
149 | 339 | for ver in pkg._pkg.version_list: | 339 | for ver in pkg._pkg.version_list: |
150 | 340 | # discard is < than installed ver | 340 | # discard is < than installed ver |
154 | 341 | if (inst_ver and | 341 | if (inst_ver \ |
155 | 342 | apt.apt_pkg.version_compare(ver.ver_str, | 342 | and apt.apt_pkg.version_compare(ver.ver_str, |
156 | 343 | inst_ver.ver_str) <= 0): | 343 | inst_ver.ver_str) <= 0): |
157 | 344 | continue | 344 | continue |
158 | 345 | # check if we have a match | 345 | # check if we have a match |
159 | 346 | for (verFileIter, index) in ver.file_list: | 346 | for (verFileIter, index) in ver.file_list: |
160 | @@ -507,14 +507,15 @@ | |||
161 | 507 | upgrade_pkgs.append(pkg) | 507 | upgrade_pkgs.append(pkg) |
162 | 508 | self.num_updates = self.num_updates + 1 | 508 | self.num_updates = self.num_updates + 1 |
163 | 509 | 509 | ||
166 | 510 | if pkg.is_upgradable and not (pkg.marked_upgrade or | 510 | if pkg.is_upgradable and not (pkg.marked_upgrade \ |
167 | 511 | pkg.marked_install): | 511 | or pkg.marked_install): |
168 | 512 | self.held_back.append(pkg.name) | 512 | self.held_back.append(pkg.name) |
169 | 513 | continue | 513 | continue |
174 | 514 | if (pkg.is_auto_removable and | 514 | if (pkg.is_auto_removable \ |
175 | 515 | (cache.versioned_kernel_pkgs_regexp and | 515 | and (cache.versioned_kernel_pkgs_regexp \ |
176 | 516 | cache.versioned_kernel_pkgs_regexp.match(pkg.name) and | 516 | and cache.versioned_kernel_pkgs_regexp.match(pkg.name) \ |
177 | 517 | not cache.running_kernel_pkgs_regexp.match(pkg.name))): | 517 | and not cache.running_kernel_pkgs_regexp.match( |
178 | 518 | pkg.name))): | ||
179 | 518 | kernel_autoremove_pkgs.append(pkg) | 519 | kernel_autoremove_pkgs.append(pkg) |
180 | 519 | 520 | ||
181 | 520 | # perform operations after the loop to not skip packages which | 521 | # perform operations after the loop to not skip packages which |
182 | 521 | 522 | ||
183 | === modified file 'UpdateManager/Core/utils.py' | |||
184 | --- UpdateManager/Core/utils.py 2018-06-25 09:15:45 +0000 | |||
185 | +++ UpdateManager/Core/utils.py 2018-09-27 14:23:26 +0000 | |||
186 | @@ -318,7 +318,7 @@ | |||
187 | 318 | if proxies: | 318 | if proxies: |
188 | 319 | # basic verification | 319 | # basic verification |
189 | 320 | for proxy in proxies.values(): | 320 | for proxy in proxies.values(): |
191 | 321 | if not re.match("https?://\w+", proxy): | 321 | if not re.match("https?://\\w+", proxy): |
192 | 322 | print("proxy '%s' looks invalid" % proxy, file=sys.stderr) | 322 | print("proxy '%s' looks invalid" % proxy, file=sys.stderr) |
193 | 323 | return | 323 | return |
194 | 324 | proxy_support = ProxyHandler(proxies) | 324 | proxy_support = ProxyHandler(proxies) |
195 | 325 | 325 | ||
196 | === modified file 'UpdateManager/Dialogs.py' | |||
197 | --- UpdateManager/Dialogs.py 2018-09-06 07:09:47 +0000 | |||
198 | +++ UpdateManager/Dialogs.py 2018-09-27 14:23:26 +0000 | |||
199 | @@ -368,8 +368,8 @@ | |||
200 | 368 | Dialog.start(self) | 368 | Dialog.start(self) |
201 | 369 | # Turn off close button | 369 | # Turn off close button |
202 | 370 | self.window_main.realize() | 370 | self.window_main.realize() |
205 | 371 | self.window_main.get_window().set_functions(Gdk.WMFunction.MOVE | | 371 | self.window_main.get_window().set_functions(Gdk.WMFunction.MOVE \ |
206 | 372 | Gdk.WMFunction.MINIMIZE) | 372 | | Gdk.WMFunction.MINIMIZE) |
207 | 373 | 373 | ||
208 | 374 | def restart(self, *args, **kwargs): | 374 | def restart(self, *args, **kwargs): |
209 | 375 | self._request_reboot_via_session_manager() | 375 | self._request_reboot_via_session_manager() |
210 | 376 | 376 | ||
211 | === modified file 'UpdateManager/UpdateManager.py' | |||
212 | --- UpdateManager/UpdateManager.py 2018-09-24 11:50:49 +0000 | |||
213 | +++ UpdateManager/UpdateManager.py 2018-09-27 14:23:26 +0000 | |||
214 | @@ -305,9 +305,9 @@ | |||
215 | 305 | 305 | ||
216 | 306 | # Check for new fresh release | 306 | # Check for new fresh release |
217 | 307 | settings = Gio.Settings.new("com.ubuntu.update-manager") | 307 | settings = Gio.Settings.new("com.ubuntu.update-manager") |
221 | 308 | if (self.meta_release.new_dist and | 308 | if (self.meta_release.new_dist \ |
222 | 309 | (self.options.check_dist_upgrades or | 309 | and (self.options.check_dist_upgrades \ |
223 | 310 | settings.get_boolean("check-dist-upgrades"))): | 310 | or settings.get_boolean("check-dist-upgrades"))): |
224 | 311 | return DistUpgradeDialog(self, self.meta_release) | 311 | return DistUpgradeDialog(self, self.meta_release) |
225 | 312 | 312 | ||
226 | 313 | return None | 313 | return None |
227 | 314 | 314 | ||
228 | === modified file 'UpdateManager/UpdatesAvailable.py' | |||
229 | --- UpdateManager/UpdatesAvailable.py 2018-09-24 09:41:09 +0000 | |||
230 | +++ UpdateManager/UpdatesAvailable.py 2018-09-27 14:23:26 +0000 | |||
231 | @@ -531,12 +531,12 @@ | |||
232 | 531 | # set descr | 531 | # set descr |
233 | 532 | data = model.get_value(iter, LIST_UPDATE_DATA) | 532 | data = model.get_value(iter, LIST_UPDATE_DATA) |
234 | 533 | item = data.item | 533 | item = data.item |
237 | 534 | if (item is None and data.group is not None and | 534 | if (item is None and data.group is not None \ |
238 | 535 | data.group.core_item is not None): | 535 | and data.group.core_item is not None): |
239 | 536 | item = data.group.core_item | 536 | item = data.group.core_item |
243 | 537 | if (item is None or item.pkg is None or | 537 | if (item is None or item.pkg is None \ |
244 | 538 | item.pkg.candidate is None or | 538 | or item.pkg.candidate is None \ |
245 | 539 | item.pkg.candidate.description is None): | 539 | or item.pkg.candidate.description is None): |
246 | 540 | changes_buffer = self.textview_changes.get_buffer() | 540 | changes_buffer = self.textview_changes.get_buffer() |
247 | 541 | changes_buffer.set_text("") | 541 | changes_buffer.set_text("") |
248 | 542 | desc_buffer = self.textview_descr.get_buffer() | 542 | desc_buffer = self.textview_descr.get_buffer() |
249 | @@ -724,8 +724,8 @@ | |||
250 | 724 | self.hbox_restart.set_visible(requires_restart) | 724 | self.hbox_restart.set_visible(requires_restart) |
251 | 725 | 725 | ||
252 | 726 | def _refresh_updates_count(self): | 726 | def _refresh_updates_count(self): |
255 | 727 | self.button_install.set_sensitive(self.cache.install_count + | 727 | self.button_install.set_sensitive(self.cache.install_count \ |
256 | 728 | self.cache.del_count) | 728 | + self.cache.del_count) |
257 | 729 | try: | 729 | try: |
258 | 730 | inst_count = self.cache.install_count + self.cache.del_count | 730 | inst_count = self.cache.install_count + self.cache.del_count |
259 | 731 | self.dl_size = self.cache.required_download | 731 | self.dl_size = self.cache.required_download |
260 | @@ -889,8 +889,8 @@ | |||
261 | 889 | self.vbox_alerts.show() | 889 | self.vbox_alerts.show() |
262 | 890 | self.connected = False | 890 | self.connected = False |
263 | 891 | # in doubt (STATE_UNKNOWN), assume connected | 891 | # in doubt (STATE_UNKNOWN), assume connected |
266 | 892 | elif (state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST or | 892 | elif (state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST \ |
267 | 893 | state == NetworkManagerHelper.NM_STATE_UNKNOWN): | 893 | or state == NetworkManagerHelper.NM_STATE_UNKNOWN): |
268 | 894 | self.updates_changed() | 894 | self.updates_changed() |
269 | 895 | self.hbox_offline.hide() | 895 | self.hbox_offline.hide() |
270 | 896 | self.connected = True | 896 | self.connected = True |
271 | @@ -1067,8 +1067,8 @@ | |||
272 | 1067 | 1067 | ||
273 | 1068 | self.treeview_update.set_model(self.store) | 1068 | self.treeview_update.set_model(self.store) |
274 | 1069 | self.pkg_cell_area.indent_toplevel = ( | 1069 | self.pkg_cell_area.indent_toplevel = ( |
277 | 1070 | bool(self.list.security_groups) or | 1070 | bool(self.list.security_groups) \ |
278 | 1071 | bool(self.list.kernel_autoremove_groups)) | 1071 | or bool(self.list.kernel_autoremove_groups)) |
279 | 1072 | self.update_close_button() | 1072 | self.update_close_button() |
280 | 1073 | self.update_count() | 1073 | self.update_count() |
281 | 1074 | self.setBusy(False) | 1074 | self.setBusy(False) |
282 | 1075 | 1075 | ||
283 | === modified file 'UpdateManager/backend/InstallBackendAptdaemon.py' | |||
284 | --- UpdateManager/backend/InstallBackendAptdaemon.py 2018-09-24 11:50:49 +0000 | |||
285 | +++ UpdateManager/backend/InstallBackendAptdaemon.py 2018-09-27 14:23:26 +0000 | |||
286 | @@ -113,8 +113,8 @@ | |||
287 | 113 | label_details.set_label(get_status_string_from_enum(status)) | 113 | label_details.set_label(get_status_string_from_enum(status)) |
288 | 114 | # Also resize the window if we switch from download details to | 114 | # Also resize the window if we switch from download details to |
289 | 115 | # the terminal window | 115 | # the terminal window |
292 | 116 | if (status == STATUS_COMMITTING and expander and | 116 | if status == STATUS_COMMITTING and expander \ |
293 | 117 | expander.terminal.get_visible()): | 117 | and expander.terminal.get_visible(): |
294 | 118 | self._resize_to_show_details(expander) | 118 | self._resize_to_show_details(expander) |
295 | 119 | 119 | ||
296 | 120 | @inline_callbacks | 120 | @inline_callbacks |
297 | 121 | 121 | ||
298 | === modified file 'UpdateManager/backend/__init__.py' | |||
299 | --- UpdateManager/backend/__init__.py 2018-09-11 13:51:21 +0000 | |||
300 | +++ UpdateManager/backend/__init__.py 2018-09-27 14:23:26 +0000 | |||
301 | @@ -40,17 +40,17 @@ | |||
302 | 40 | fresh_cache = Cache(rootdir=self.window_main.cache.rootdir) | 40 | fresh_cache = Cache(rootdir=self.window_main.cache.rootdir) |
303 | 41 | for pkg in self.window_main.cache: | 41 | for pkg in self.window_main.cache: |
304 | 42 | try: | 42 | try: |
307 | 43 | if pkg.marked_install and \ | 43 | if pkg.marked_install \ |
308 | 44 | not fresh_cache[pkg.name].is_installed: | 44 | and not fresh_cache[pkg.name].is_installed: |
309 | 45 | pkgname = pkg.name | 45 | pkgname = pkg.name |
310 | 46 | if pkg.is_auto_installed: | 46 | if pkg.is_auto_installed: |
311 | 47 | pkgname += "#auto" | 47 | pkgname += "#auto" |
312 | 48 | pkgs_install.append(pkgname) | 48 | pkgs_install.append(pkgname) |
315 | 49 | elif (pkg.marked_upgrade and | 49 | elif (pkg.marked_upgrade \ |
316 | 50 | fresh_cache[pkg.name].is_upgradable): | 50 | and fresh_cache[pkg.name].is_upgradable): |
317 | 51 | pkgs_upgrade.append(pkg.name) | 51 | pkgs_upgrade.append(pkg.name) |
320 | 52 | elif (pkg.marked_delete and | 52 | elif (pkg.marked_delete \ |
321 | 53 | fresh_cache[pkg.name].is_installed): | 53 | and fresh_cache[pkg.name].is_installed): |
322 | 54 | pkgs_remove.append(pkg.name) | 54 | pkgs_remove.append(pkg.name) |
323 | 55 | except KeyError: | 55 | except KeyError: |
324 | 56 | # pkg missing from fresh_cache can't be modified | 56 | # pkg missing from fresh_cache can't be modified |
325 | @@ -98,8 +98,8 @@ | |||
326 | 98 | def get_backend(*args, **kwargs): | 98 | def get_backend(*args, **kwargs): |
327 | 99 | """Select and return a package manager backend.""" | 99 | """Select and return a package manager backend.""" |
328 | 100 | # try aptdaemon | 100 | # try aptdaemon |
331 | 101 | if (os.path.exists("/usr/sbin/aptd") and | 101 | if (os.path.exists("/usr/sbin/aptd") \ |
332 | 102 | "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" not in os.environ): | 102 | and "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" not in os.environ): |
333 | 103 | # check if the gtkwidgets are installed as well | 103 | # check if the gtkwidgets are installed as well |
334 | 104 | try: | 104 | try: |
335 | 105 | from .InstallBackendAptdaemon import InstallBackendAptdaemon | 105 | from .InstallBackendAptdaemon import InstallBackendAptdaemon |
336 | @@ -108,8 +108,8 @@ | |||
337 | 108 | import logging | 108 | import logging |
338 | 109 | logging.exception("importing aptdaemon") | 109 | logging.exception("importing aptdaemon") |
339 | 110 | # try synaptic | 110 | # try synaptic |
342 | 111 | if (os.path.exists("/usr/sbin/synaptic") and | 111 | if (os.path.exists("/usr/sbin/synaptic") \ |
343 | 112 | "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ): | 112 | and "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" not in os.environ): |
344 | 113 | from .InstallBackendSynaptic import InstallBackendSynaptic | 113 | from .InstallBackendSynaptic import InstallBackendSynaptic |
345 | 114 | return InstallBackendSynaptic(*args, **kwargs) | 114 | return InstallBackendSynaptic(*args, **kwargs) |
346 | 115 | # nothing found, raise | 115 | # nothing found, raise |
347 | 116 | 116 | ||
348 | === modified file 'debian/changelog' | |||
349 | --- debian/changelog 2018-09-24 09:11:27 +0000 | |||
350 | +++ debian/changelog 2018-09-27 14:23:26 +0000 | |||
351 | @@ -1,3 +1,16 @@ | |||
352 | 1 | update-manager (1:18.10.9) cosmic; urgency=medium | ||
353 | 2 | |||
354 | 3 | * Allow unselecting updates and performing only removals (LP: #1792320) | ||
355 | 4 | * Stop trying apt_pkg.pkgsystem_(un)lock(), as a normal user it always fails | ||
356 | 5 | * Keep or delete packages after looping over all of them. | ||
357 | 6 | This prevents the resolver from changing the packages in the loop resulting | ||
358 | 7 | in not keeping some phased packages back from being upgraded. (LP: #1072136) | ||
359 | 8 | * Fix PEP 8 warnings | ||
360 | 9 | Also ignore "E502 the backslash is redundant between brackets" because the | ||
361 | 10 | additional brackets help readability. | ||
362 | 11 | |||
363 | 12 | -- Balint Reczey <rbalint@ubuntu.com> Thu, 27 Sep 2018 15:19:02 +0200 | ||
364 | 13 | |||
365 | 1 | update-manager (1:18.10.8) cosmic; urgency=medium | 14 | update-manager (1:18.10.8) cosmic; urgency=medium |
366 | 2 | 15 | ||
367 | 3 | * Print transaction error and let the user try again applying updates | 16 | * Print transaction error and let the user try again applying updates |
368 | 4 | 17 | ||
369 | === modified file 'debian/source_update-manager.py' | |||
370 | --- debian/source_update-manager.py 2017-08-07 20:54:58 +0000 | |||
371 | +++ debian/source_update-manager.py 2018-09-27 14:23:26 +0000 | |||
372 | @@ -27,9 +27,9 @@ | |||
373 | 27 | elif sp.returncode == 10: | 27 | elif sp.returncode == 10: |
374 | 28 | res = out.strip() | 28 | res = out.strip() |
375 | 29 | else: | 29 | else: |
379 | 30 | res = (b'Error: command ' + str(command).encode() + | 30 | res = (b'Error: command ' + str(command).encode() \ |
380 | 31 | b' failed with exit code ' + | 31 | + b' failed with exit code ' \ |
381 | 32 | str(sp.returncode).encode() + b': ' + out) | 32 | + str(sp.returncode).encode() + b': ' + out) |
382 | 33 | return res | 33 | return res |
383 | 34 | 34 | ||
384 | 35 | 35 | ||
385 | 36 | 36 | ||
386 | === modified file 'janitor/plugincore/manager.py' | |||
387 | --- janitor/plugincore/manager.py 2012-06-28 00:11:57 +0000 | |||
388 | +++ janitor/plugincore/manager.py 2018-09-27 14:23:26 +0000 | |||
389 | @@ -81,9 +81,9 @@ | |||
390 | 81 | """Find and instantiate all plugins in a module.""" | 81 | """Find and instantiate all plugins in a module.""" |
391 | 82 | def is_plugin(target): | 82 | def is_plugin(target): |
392 | 83 | # Don't return the base class itself. | 83 | # Don't return the base class itself. |
396 | 84 | return (inspect.isclass(target) and | 84 | return (inspect.isclass(target) \ |
397 | 85 | issubclass(target, Plugin) and | 85 | and issubclass(target, Plugin) \ |
398 | 86 | target is not Plugin) | 86 | and target is not Plugin) |
399 | 87 | plugin_classes = [ | 87 | plugin_classes = [ |
400 | 88 | member | 88 | member |
401 | 89 | for name, member in inspect.getmembers(module, is_plugin) | 89 | for name, member in inspect.getmembers(module, is_plugin) |
402 | @@ -177,9 +177,9 @@ | |||
403 | 177 | # condition. | 177 | # condition. |
404 | 178 | plugins = [ | 178 | plugins = [ |
405 | 179 | plugin for plugin in self._plugins | 179 | plugin for plugin in self._plugins |
409 | 180 | if (plugin.condition == condition or | 180 | if (plugin.condition == condition \ |
410 | 181 | condition in plugin.condition or | 181 | or condition in plugin.condition \ |
411 | 182 | condition == '*') | 182 | or condition == '*') |
412 | 183 | ] | 183 | ] |
413 | 184 | logging.debug("plugins for condition '{}' are '{}'".format( | 184 | logging.debug("plugins for condition '{}' are '{}'".format( |
414 | 185 | condition, plugins)) | 185 | condition, plugins)) |
415 | 186 | 186 | ||
416 | === modified file 'janitor/plugincore/plugins/dpkg_status_plugin.py' | |||
417 | --- janitor/plugincore/plugins/dpkg_status_plugin.py 2012-06-27 21:49:20 +0000 | |||
418 | +++ janitor/plugincore/plugins/dpkg_status_plugin.py 2018-09-27 14:23:26 +0000 | |||
419 | @@ -70,9 +70,9 @@ | |||
420 | 70 | while tagf.step(): | 70 | while tagf.step(): |
421 | 71 | statusline = tagf.section.get('Status') | 71 | statusline = tagf.section.get('Status') |
422 | 72 | (want, flag, status) = statusline.split() | 72 | (want, flag, status) = statusline.split() |
426 | 73 | if (want == 'purge' and | 73 | if want == 'purge' \ |
427 | 74 | flag == 'ok' and | 74 | and flag == 'ok' \ |
428 | 75 | status == 'not-installed'): | 75 | and status == 'not-installed': |
429 | 76 | # Then... | 76 | # Then... |
430 | 77 | n_cruft += 1 | 77 | n_cruft += 1 |
431 | 78 | logging.debug('DpkgStatusPlugin found {} cruft items'.format(n_cruft)) | 78 | logging.debug('DpkgStatusPlugin found {} cruft items'.format(n_cruft)) |
432 | 79 | 79 | ||
433 | === modified file 'janitor/plugincore/plugins/kdelibs4to5_plugin.py' | |||
434 | --- janitor/plugincore/plugins/kdelibs4to5_plugin.py 2012-06-27 21:49:20 +0000 | |||
435 | +++ janitor/plugincore/plugins/kdelibs4to5_plugin.py 2018-09-27 14:23:26 +0000 | |||
436 | @@ -43,8 +43,8 @@ | |||
437 | 43 | fromp = 'kdelibs4-dev' | 43 | fromp = 'kdelibs4-dev' |
438 | 44 | top = 'kdelibs5-dev' | 44 | top = 'kdelibs5-dev' |
439 | 45 | cache = self.app.apt_cache | 45 | cache = self.app.apt_cache |
442 | 46 | if (fromp in cache and cache[fromp].is_installed and | 46 | if (fromp in cache and cache[fromp].is_installed \ |
443 | 47 | top in cache and not cache[top].is_installed): | 47 | and top in cache and not cache[top].is_installed): |
444 | 48 | yield MissingPackageCruft( | 48 | yield MissingPackageCruft( |
445 | 49 | cache[top], | 49 | cache[top], |
446 | 50 | _('When upgrading, if kdelibs4-dev is installed, ' | 50 | _('When upgrading, if kdelibs4-dev is installed, ' |
447 | 51 | 51 | ||
448 | === modified file 'janitor/plugincore/plugins/langpack_manual_plugin.py' | |||
449 | --- janitor/plugincore/plugins/langpack_manual_plugin.py 2012-06-27 21:49:20 +0000 | |||
450 | +++ janitor/plugincore/plugins/langpack_manual_plugin.py 2018-09-27 14:23:26 +0000 | |||
451 | @@ -68,10 +68,10 @@ | |||
452 | 68 | # language-support-* - we fix this here | 68 | # language-support-* - we fix this here |
453 | 69 | cache = self.app.apt_cache | 69 | cache = self.app.apt_cache |
454 | 70 | for pkg in cache: | 70 | for pkg in cache: |
459 | 71 | if (pkg.name.startswith('language-pack-') and | 71 | if (pkg.name.startswith('language-pack-') \ |
460 | 72 | not pkg.name.endswith('-base') and | 72 | and not pkg.name.endswith('-base') \ |
461 | 73 | cache._depcache.IsAutoInstalled(pkg._pkg) and | 73 | and cache._depcache.IsAutoInstalled(pkg._pkg) \ |
462 | 74 | pkg.is_installed): | 74 | and pkg.is_installed): |
463 | 75 | # Then... | 75 | # Then... |
464 | 76 | logging.debug("setting '%s' to manual installed" % pkg.name) | 76 | logging.debug("setting '%s' to manual installed" % pkg.name) |
465 | 77 | yield ManualInstallCruft(pkg) | 77 | yield ManualInstallCruft(pkg) |
466 | 78 | 78 | ||
467 | === modified file 'janitor/plugincore/tests/test_documentation.py' | |||
468 | --- janitor/plugincore/tests/test_documentation.py 2017-08-07 20:54:58 +0000 | |||
469 | +++ janitor/plugincore/tests/test_documentation.py 2018-09-27 14:23:26 +0000 | |||
470 | @@ -34,10 +34,10 @@ | |||
471 | 34 | COMMASPACE = ', ' | 34 | COMMASPACE = ', ' |
472 | 35 | DOT = '.' | 35 | DOT = '.' |
473 | 36 | DOCTEST_FLAGS = ( | 36 | DOCTEST_FLAGS = ( |
478 | 37 | doctest.ELLIPSIS | | 37 | doctest.ELLIPSIS \ |
479 | 38 | doctest.NORMALIZE_WHITESPACE | | 38 | | doctest.NORMALIZE_WHITESPACE \ |
480 | 39 | doctest.REPORT_NDIFF | | 39 | | doctest.REPORT_NDIFF \ |
481 | 40 | doctest.IGNORE_EXCEPTION_DETAIL) | 40 | | doctest.IGNORE_EXCEPTION_DETAIL) |
482 | 41 | 41 | ||
483 | 42 | 42 | ||
484 | 43 | WHOAMI = 'janitor.plugincore' | 43 | WHOAMI = 'janitor.plugincore' |
485 | 44 | 44 | ||
486 | === modified file 'tests/test_hwe_support_status.py' | |||
487 | --- tests/test_hwe_support_status.py 2017-08-07 20:54:58 +0000 | |||
488 | +++ tests/test_hwe_support_status.py 2018-09-27 14:23:26 +0000 | |||
489 | @@ -38,14 +38,14 @@ | |||
490 | 38 | ) | 38 | ) |
491 | 39 | 39 | ||
492 | 40 | INSTALLED_UNSUPPORTED_HWE_PKG_NAMES = ( | 40 | INSTALLED_UNSUPPORTED_HWE_PKG_NAMES = ( |
495 | 41 | INSTALLED_UNSUPPORTED_HWE_KERNEL_PKG_NAMES + | 41 | INSTALLED_UNSUPPORTED_HWE_KERNEL_PKG_NAMES \ |
496 | 42 | INSTALLED_UNSUPPORTED_HWE_XORG_PKG_NAMES) | 42 | + INSTALLED_UNSUPPORTED_HWE_XORG_PKG_NAMES) |
497 | 43 | 43 | ||
498 | 44 | def setUp(self): | 44 | def setUp(self): |
499 | 45 | self.cache = [] | 45 | self.cache = [] |
503 | 46 | INSTALL = (self.INSTALLED_UNSUPPORTED_HWE_PKG_NAMES + | 46 | INSTALL = (self.INSTALLED_UNSUPPORTED_HWE_PKG_NAMES \ |
504 | 47 | self.INSTALLED_SUPPORTED_HWE_PKG_NAMES + | 47 | + self.INSTALLED_SUPPORTED_HWE_PKG_NAMES \ |
505 | 48 | self.INSTALLED_OTHER_PKG_NAMES) | 48 | + self.INSTALLED_OTHER_PKG_NAMES) |
506 | 49 | for name in INSTALL: | 49 | for name in INSTALL: |
507 | 50 | self.cache.append(make_mock_pkg(name)) | 50 | self.cache.append(make_mock_pkg(name)) |
508 | 51 | 51 | ||
509 | 52 | 52 | ||
510 | === modified file 'tests/test_pep8.py' | |||
511 | --- tests/test_pep8.py 2017-08-07 20:54:58 +0000 | |||
512 | +++ tests/test_pep8.py 2018-09-27 14:23:26 +0000 | |||
513 | @@ -6,7 +6,7 @@ | |||
514 | 6 | import unittest | 6 | import unittest |
515 | 7 | 7 | ||
516 | 8 | # pep8 is overdoing it a bit IMO | 8 | # pep8 is overdoing it a bit IMO |
518 | 9 | IGNORE_PEP8 = "E265,E402" | 9 | IGNORE_PEP8 = "E265,E402,E502" |
519 | 10 | IGNORE_FILES = ( | 10 | IGNORE_FILES = ( |
520 | 11 | ) | 11 | ) |
521 | 12 | 12 | ||
522 | 13 | 13 | ||
523 | === modified file 'tests/test_update_origin.py' | |||
524 | --- tests/test_update_origin.py 2017-09-11 10:39:17 +0000 | |||
525 | +++ tests/test_update_origin.py 2018-09-27 14:23:26 +0000 | |||
526 | @@ -90,10 +90,10 @@ | |||
527 | 90 | if o.archive == "xenial-security": | 90 | if o.archive == "xenial-security": |
528 | 91 | had_security = True | 91 | had_security = True |
529 | 92 | break | 92 | break |
534 | 93 | if (is_in_updates and | 93 | if (is_in_updates \ |
535 | 94 | not is_in_security and | 94 | and not is_in_security \ |
536 | 95 | had_security and | 95 | and had_security \ |
537 | 96 | len(pkg._pkg.version_list) > 2): | 96 | and len(pkg._pkg.version_list) > 2): |
538 | 97 | test_pkgs.add(pkg.name) | 97 | test_pkgs.add(pkg.name) |
539 | 98 | self.assertTrue(len(test_pkgs) > 0, | 98 | self.assertTrue(len(test_pkgs) > 0, |
540 | 99 | "no suitable test package found that has a version in " | 99 | "no suitable test package found that has a version in " |
541 | 100 | 100 | ||
542 | === modified file 'tests/test_utils.py' | |||
543 | --- tests/test_utils.py 2017-08-30 16:55:46 +0000 | |||
544 | +++ tests/test_utils.py 2018-09-27 14:23:26 +0000 | |||
545 | @@ -32,8 +32,8 @@ | |||
546 | 32 | mock.mock_open(read_data=data)) as mock_file: | 32 | mock.mock_open(read_data=data)) as mock_file: |
547 | 33 | assert open("/proc/1/stat").read() == data | 33 | assert open("/proc/1/stat").read() == data |
548 | 34 | mock_file.assert_called_with("/proc/1/stat") | 34 | mock_file.assert_called_with("/proc/1/stat") |
551 | 35 | self.assertTrue(utils.is_child_of_process_name("init") or | 35 | self.assertTrue(utils.is_child_of_process_name("init") \ |
552 | 36 | utils.is_child_of_process_name("systemd")) | 36 | or utils.is_child_of_process_name("systemd")) |
553 | 37 | self.assertFalse(utils.is_child_of_process_name("mvo")) | 37 | self.assertFalse(utils.is_child_of_process_name("mvo")) |
554 | 38 | 38 | ||
555 | 39 | def test_is_port_listening(self): | 39 | def test_is_port_listening(self): |