Merge ~cjwatson/launchpad:pyupgrade-py3-snappy into launchpad:master
- Git
- lp:~cjwatson/launchpad
- pyupgrade-py3-snappy
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | b777676333c9f8a6a0819737086535bf51008c52 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:pyupgrade-py3-snappy |
Merge into: | launchpad:master |
Diff against target: |
1190 lines (+115/-126) 40 files modified
.git-blame-ignore-revs (+2/-0) .pre-commit-config.yaml (+1/-0) lib/lp/snappy/adapters/buildarch.py (+7/-9) lib/lp/snappy/browser/snap.py (+22/-27) lib/lp/snappy/browser/snapbuild.py (+1/-1) lib/lp/snappy/browser/snaplisting.py (+2/-2) lib/lp/snappy/browser/snapsubscription.py (+2/-2) lib/lp/snappy/browser/tests/test_hassnaps.py (+1/-1) lib/lp/snappy/browser/tests/test_snap.py (+7/-7) lib/lp/snappy/browser/tests/test_snapbuild.py (+1/-1) lib/lp/snappy/browser/tests/test_snapsubscription.py (+1/-1) lib/lp/snappy/browser/widgets/snaparchive.py (+1/-1) lib/lp/snappy/browser/widgets/snapbuildchannels.py (+2/-2) lib/lp/snappy/browser/widgets/storechannels.py (+2/-2) lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py (+1/-1) lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py (+1/-1) lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py (+1/-1) lib/lp/snappy/interfaces/snap.py (+12/-15) lib/lp/snappy/interfaces/snapbase.py (+1/-2) lib/lp/snappy/interfaces/snapstoreclient.py (+1/-1) lib/lp/snappy/mail/snapbuild.py (+3/-4) lib/lp/snappy/model/snap.py (+1/-1) lib/lp/snappy/model/snapbase.py (+2/-3) lib/lp/snappy/model/snapbuild.py (+3/-3) lib/lp/snappy/model/snapbuildbehaviour.py (+1/-2) lib/lp/snappy/model/snapbuildjob.py (+4/-4) lib/lp/snappy/model/snapjob.py (+2/-2) lib/lp/snappy/model/snappyseries.py (+2/-2) lib/lp/snappy/model/snapstoreclient.py (+1/-1) lib/lp/snappy/model/snapsubscription.py (+1/-1) lib/lp/snappy/tests/test_snap.py (+7/-7) lib/lp/snappy/tests/test_snapbase.py (+1/-1) lib/lp/snappy/tests/test_snapbuild.py (+4/-4) lib/lp/snappy/tests/test_snapbuildbehaviour.py (+3/-3) lib/lp/snappy/tests/test_snapbuildjob.py (+2/-2) lib/lp/snappy/tests/test_snappyseries.py (+4/-4) lib/lp/snappy/tests/test_snapstoreclient.py (+2/-2) lib/lp/snappy/tests/test_snapvocabularies.py (+1/-1) lib/lp/snappy/validators/tests/test_channels.py (+1/-1) lib/lp/snappy/vocabularies.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+413834@code.launchpad.net |
Commit message
lp.snappy: Apply "pyupgrade --py3-plus"
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs | |||
2 | index 0177d98..c6458be 100644 | |||
3 | --- a/.git-blame-ignore-revs | |||
4 | +++ b/.git-blame-ignore-revs | |||
5 | @@ -40,3 +40,5 @@ fbed83f22424df8fa5647349493f78937a520db5 | |||
6 | 40 | 46f47b6eb925ce6d784c7a0ed47653da7a974110 | 40 | 46f47b6eb925ce6d784c7a0ed47653da7a974110 |
7 | 41 | # apply pyupgrade --py3-plus to lp.services.[n-z]* | 41 | # apply pyupgrade --py3-plus to lp.services.[n-z]* |
8 | 42 | f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb4465 | 42 | f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb4465 |
9 | 43 | # apply pyupgrade --py3-plus to lp.snappy | ||
10 | 44 | 2cda038936743a2f9271953c23b9fcc98968db63 | ||
11 | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml | |||
12 | index d633860..d70d934 100644 | |||
13 | --- a/.pre-commit-config.yaml | |||
14 | +++ b/.pre-commit-config.yaml | |||
15 | @@ -55,6 +55,7 @@ repos: | |||
16 | 55 | |registry | 55 | |registry |
17 | 56 | |scripts | 56 | |scripts |
18 | 57 | |services | 57 | |services |
19 | 58 | |snappy | ||
20 | 58 | )/ | 59 | )/ |
21 | 59 | - repo: https://github.com/PyCQA/isort | 60 | - repo: https://github.com/PyCQA/isort |
22 | 60 | rev: 5.9.2 | 61 | rev: 5.9.2 |
23 | diff --git a/lib/lp/snappy/adapters/buildarch.py b/lib/lp/snappy/adapters/buildarch.py | |||
24 | index e9b01cf..fe8680b 100644 | |||
25 | --- a/lib/lp/snappy/adapters/buildarch.py | |||
26 | +++ b/lib/lp/snappy/adapters/buildarch.py | |||
27 | @@ -7,8 +7,6 @@ __all__ = [ | |||
28 | 7 | 7 | ||
29 | 8 | from collections import Counter | 8 | from collections import Counter |
30 | 9 | 9 | ||
31 | 10 | import six | ||
32 | 11 | |||
33 | 12 | from lp.services.helpers import english_list | 10 | from lp.services.helpers import english_list |
34 | 13 | 11 | ||
35 | 14 | 12 | ||
36 | @@ -20,7 +18,7 @@ class MissingPropertyError(SnapArchitecturesParserError): | |||
37 | 20 | """Error for when an expected property is not present in the YAML.""" | 18 | """Error for when an expected property is not present in the YAML.""" |
38 | 21 | 19 | ||
39 | 22 | def __init__(self, prop): | 20 | def __init__(self, prop): |
41 | 23 | super(MissingPropertyError, self).__init__( | 21 | super().__init__( |
42 | 24 | "Architecture specification is missing the {!r} property".format( | 22 | "Architecture specification is missing the {!r} property".format( |
43 | 25 | prop)) | 23 | prop)) |
44 | 26 | self.property = prop | 24 | self.property = prop |
45 | @@ -30,7 +28,7 @@ class IncompatibleArchitecturesStyleError(SnapArchitecturesParserError): | |||
46 | 30 | """Error for when architectures mix incompatible styles.""" | 28 | """Error for when architectures mix incompatible styles.""" |
47 | 31 | 29 | ||
48 | 32 | def __init__(self): | 30 | def __init__(self): |
50 | 33 | super(IncompatibleArchitecturesStyleError, self).__init__( | 31 | super().__init__( |
51 | 34 | "'architectures' must either be a list of strings or dicts, not " | 32 | "'architectures' must either be a list of strings or dicts, not " |
52 | 35 | "both") | 33 | "both") |
53 | 36 | 34 | ||
54 | @@ -39,7 +37,7 @@ class DuplicateBuildOnError(SnapArchitecturesParserError): | |||
55 | 39 | """Error for when multiple `build-on`s include the same architecture.""" | 37 | """Error for when multiple `build-on`s include the same architecture.""" |
56 | 40 | 38 | ||
57 | 41 | def __init__(self, duplicates): | 39 | def __init__(self, duplicates): |
59 | 42 | super(DuplicateBuildOnError, self).__init__( | 40 | super().__init__( |
60 | 43 | "{} {} present in the 'build-on' of multiple items".format( | 41 | "{} {} present in the 'build-on' of multiple items".format( |
61 | 44 | english_list(duplicates), | 42 | english_list(duplicates), |
62 | 45 | "is" if len(duplicates) == 1 else "are")) | 43 | "is" if len(duplicates) == 1 else "are")) |
63 | @@ -49,7 +47,7 @@ class UnsupportedBuildOnError(SnapArchitecturesParserError): | |||
64 | 49 | """Error for when a requested architecture is not supported.""" | 47 | """Error for when a requested architecture is not supported.""" |
65 | 50 | 48 | ||
66 | 51 | def __init__(self, build_on): | 49 | def __init__(self, build_on): |
68 | 52 | super(UnsupportedBuildOnError, self).__init__( | 50 | super().__init__( |
69 | 53 | "build-on specifies no supported architectures: {!r}".format( | 51 | "build-on specifies no supported architectures: {!r}".format( |
70 | 54 | build_on)) | 52 | build_on)) |
71 | 55 | self.build_on = build_on | 53 | self.build_on = build_on |
72 | @@ -69,10 +67,10 @@ class SnapArchitecture: | |||
73 | 69 | snapcraft.yaml. | 67 | snapcraft.yaml. |
74 | 70 | """ | 68 | """ |
75 | 71 | self.build_on = ( | 69 | self.build_on = ( |
77 | 72 | [build_on] if isinstance(build_on, six.string_types) else build_on) | 70 | [build_on] if isinstance(build_on, str) else build_on) |
78 | 73 | if run_on: | 71 | if run_on: |
79 | 74 | self.run_on = ( | 72 | self.run_on = ( |
81 | 75 | [run_on] if isinstance(run_on, six.string_types) else run_on) | 73 | [run_on] if isinstance(run_on, str) else run_on) |
82 | 76 | else: | 74 | else: |
83 | 77 | self.run_on = self.build_on | 75 | self.run_on = self.build_on |
84 | 78 | self.build_error = build_error | 76 | self.build_error = build_error |
85 | @@ -131,7 +129,7 @@ def determine_architectures_to_build(snapcraft_data, supported_arches): | |||
86 | 131 | if architectures_list: | 129 | if architectures_list: |
87 | 132 | # First, determine what style we're parsing. Is it a list of | 130 | # First, determine what style we're parsing. Is it a list of |
88 | 133 | # strings or a list of dicts? | 131 | # strings or a list of dicts? |
90 | 134 | if all(isinstance(a, six.string_types) for a in architectures_list): | 132 | if all(isinstance(a, str) for a in architectures_list): |
91 | 135 | # If a list of strings (old style), then that's only a single | 133 | # If a list of strings (old style), then that's only a single |
92 | 136 | # item. | 134 | # item. |
93 | 137 | architectures = [SnapArchitecture(build_on=architectures_list)] | 135 | architectures = [SnapArchitecture(build_on=architectures_list)] |
94 | diff --git a/lib/lp/snappy/browser/snap.py b/lib/lp/snappy/browser/snap.py | |||
95 | index 6055137..0fc63ca 100644 | |||
96 | --- a/lib/lp/snappy/browser/snap.py | |||
97 | +++ b/lib/lp/snappy/browser/snap.py | |||
98 | @@ -20,7 +20,6 @@ from lazr.restful.interface import ( | |||
99 | 20 | copy_field, | 20 | copy_field, |
100 | 21 | use_template, | 21 | use_template, |
101 | 22 | ) | 22 | ) |
102 | 23 | import six | ||
103 | 24 | from six.moves.urllib.parse import urlencode | 23 | from six.moves.urllib.parse import urlencode |
104 | 25 | from zope.component import getUtility | 24 | from zope.component import getUtility |
105 | 26 | from zope.error.interfaces import IErrorReportingUtility | 25 | from zope.error.interfaces import IErrorReportingUtility |
106 | @@ -184,9 +183,9 @@ class SnapFormMixin: | |||
107 | 184 | widget = self.widgets.get('vcs') | 183 | widget = self.widgets.get('vcs') |
108 | 185 | if widget is not None: | 184 | if widget is not None: |
109 | 186 | current_value = widget._getFormValue() | 185 | current_value = widget._getFormValue() |
111 | 187 | self.vcs_bzr_radio, self.vcs_git_radio = [ | 186 | self.vcs_bzr_radio, self.vcs_git_radio = ( |
112 | 188 | render_radio_widget_part(widget, value, current_value) | 187 | render_radio_widget_part(widget, value, current_value) |
114 | 189 | for value in (VCSType.BZR, VCSType.GIT)] | 188 | for value in (VCSType.BZR, VCSType.GIT)) |
115 | 190 | 189 | ||
116 | 191 | 190 | ||
117 | 192 | class SnapInformationTypeMixin: | 191 | class SnapInformationTypeMixin: |
118 | @@ -565,7 +564,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin, | |||
119 | 565 | 564 | ||
120 | 566 | def initialize(self): | 565 | def initialize(self): |
121 | 567 | """See `LaunchpadView`.""" | 566 | """See `LaunchpadView`.""" |
123 | 568 | super(SnapAddView, self).initialize() | 567 | super().initialize() |
124 | 569 | 568 | ||
125 | 570 | # Once initialized, if the private_snap flag is disabled, it | 569 | # Once initialized, if the private_snap flag is disabled, it |
126 | 571 | # prevents snap creation for private contexts. | 570 | # prevents snap creation for private contexts. |
127 | @@ -580,7 +579,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin, | |||
128 | 580 | 579 | ||
129 | 581 | def setUpFields(self): | 580 | def setUpFields(self): |
130 | 582 | """See `LaunchpadFormView`.""" | 581 | """See `LaunchpadFormView`.""" |
132 | 583 | super(SnapAddView, self).setUpFields() | 582 | super().setUpFields() |
133 | 584 | self.form_fields += self.createEnabledProcessors( | 583 | self.form_fields += self.createEnabledProcessors( |
134 | 585 | getUtility(IProcessorSet).getAll(), | 584 | getUtility(IProcessorSet).getAll(), |
135 | 586 | "The architectures that this snap package builds for. Some " | 585 | "The architectures that this snap package builds for. Some " |
136 | @@ -589,7 +588,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin, | |||
137 | 589 | 588 | ||
138 | 590 | def setUpWidgets(self): | 589 | def setUpWidgets(self): |
139 | 591 | """See `LaunchpadFormView`.""" | 590 | """See `LaunchpadFormView`.""" |
141 | 592 | super(SnapAddView, self).setUpWidgets() | 591 | super().setUpWidgets() |
142 | 593 | self.widgets['processors'].widget_class = 'processors' | 592 | self.widgets['processors'].widget_class = 'processors' |
143 | 594 | if self.is_project_context: | 593 | if self.is_project_context: |
144 | 595 | # If we are on Project:+new-snap page, we know which information | 594 | # If we are on Project:+new-snap page, we know which information |
145 | @@ -654,23 +653,23 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin, | |||
146 | 654 | def validate_widgets(self, data, names=None): | 653 | def validate_widgets(self, data, names=None): |
147 | 655 | """See `LaunchpadFormView`.""" | 654 | """See `LaunchpadFormView`.""" |
148 | 656 | if self.widgets.get('vcs') is not None: | 655 | if self.widgets.get('vcs') is not None: |
150 | 657 | super(SnapAddView, self).validate_widgets(data, ['vcs']) | 656 | super().validate_widgets(data, ['vcs']) |
151 | 658 | self.validateVCSWidgets(SnapAddView, data) | 657 | self.validateVCSWidgets(SnapAddView, data) |
152 | 659 | if self.widgets.get('auto_build') is not None: | 658 | if self.widgets.get('auto_build') is not None: |
153 | 660 | # Set widgets as required or optional depending on the | 659 | # Set widgets as required or optional depending on the |
154 | 661 | # auto_build field. | 660 | # auto_build field. |
156 | 662 | super(SnapAddView, self).validate_widgets(data, ['auto_build']) | 661 | super().validate_widgets(data, ['auto_build']) |
157 | 663 | auto_build = data.get('auto_build', False) | 662 | auto_build = data.get('auto_build', False) |
158 | 664 | self.widgets['auto_build_archive'].context.required = auto_build | 663 | self.widgets['auto_build_archive'].context.required = auto_build |
159 | 665 | self.widgets['auto_build_pocket'].context.required = auto_build | 664 | self.widgets['auto_build_pocket'].context.required = auto_build |
160 | 666 | if self.widgets.get('store_upload') is not None: | 665 | if self.widgets.get('store_upload') is not None: |
161 | 667 | # Set widgets as required or optional depending on the | 666 | # Set widgets as required or optional depending on the |
162 | 668 | # store_upload field. | 667 | # store_upload field. |
164 | 669 | super(SnapAddView, self).validate_widgets(data, ['store_upload']) | 668 | super().validate_widgets(data, ['store_upload']) |
165 | 670 | store_upload = data.get('store_upload', False) | 669 | store_upload = data.get('store_upload', False) |
166 | 671 | self.widgets['store_name'].context.required = store_upload | 670 | self.widgets['store_name'].context.required = store_upload |
167 | 672 | self.widgets['store_channels'].context.required = store_upload | 671 | self.widgets['store_channels'].context.required = store_upload |
169 | 673 | super(SnapAddView, self).validate_widgets(data, names=names) | 672 | super().validate_widgets(data, names=names) |
170 | 674 | 673 | ||
171 | 675 | @action('Create snap package', name='create') | 674 | @action('Create snap package', name='create') |
172 | 676 | def create_action(self, action, data): | 675 | def create_action(self, action, data): |
173 | @@ -709,7 +708,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin, | |||
174 | 709 | self.next_url = canonical_url(snap) | 708 | self.next_url = canonical_url(snap) |
175 | 710 | 709 | ||
176 | 711 | def validate(self, data): | 710 | def validate(self, data): |
178 | 712 | super(SnapAddView, self).validate(data) | 711 | super().validate(data) |
179 | 713 | owner = data.get('owner', None) | 712 | owner = data.get('owner', None) |
180 | 714 | name = data.get('name', None) | 713 | name = data.get('name', None) |
181 | 715 | if owner and name: | 714 | if owner and name: |
182 | @@ -732,7 +731,7 @@ class BaseSnapEditView(SnapAuthorizeMixin, SnapInformationTypeMixin, | |||
183 | 732 | 731 | ||
184 | 733 | def setUpWidgets(self, context=None): | 732 | def setUpWidgets(self, context=None): |
185 | 734 | """See `LaunchpadFormView`.""" | 733 | """See `LaunchpadFormView`.""" |
187 | 735 | super(BaseSnapEditView, self).setUpWidgets() | 734 | super().setUpWidgets() |
188 | 736 | self.setUpVCSWidgets() | 735 | self.setUpVCSWidgets() |
189 | 737 | 736 | ||
190 | 738 | @property | 737 | @property |
191 | @@ -742,28 +741,26 @@ class BaseSnapEditView(SnapAuthorizeMixin, SnapInformationTypeMixin, | |||
192 | 742 | def validate_widgets(self, data, names=None): | 741 | def validate_widgets(self, data, names=None): |
193 | 743 | """See `LaunchpadFormView`.""" | 742 | """See `LaunchpadFormView`.""" |
194 | 744 | if self.widgets.get('vcs') is not None: | 743 | if self.widgets.get('vcs') is not None: |
196 | 745 | super(BaseSnapEditView, self).validate_widgets(data, ['vcs']) | 744 | super().validate_widgets(data, ['vcs']) |
197 | 746 | self.validateVCSWidgets(BaseSnapEditView, data) | 745 | self.validateVCSWidgets(BaseSnapEditView, data) |
198 | 747 | if self.widgets.get('auto_build') is not None: | 746 | if self.widgets.get('auto_build') is not None: |
199 | 748 | # Set widgets as required or optional depending on the | 747 | # Set widgets as required or optional depending on the |
200 | 749 | # auto_build field. | 748 | # auto_build field. |
203 | 750 | super(BaseSnapEditView, self).validate_widgets( | 749 | super().validate_widgets(data, ['auto_build']) |
202 | 751 | data, ['auto_build']) | ||
204 | 752 | auto_build = data.get('auto_build', False) | 750 | auto_build = data.get('auto_build', False) |
205 | 753 | self.widgets['auto_build_archive'].context.required = auto_build | 751 | self.widgets['auto_build_archive'].context.required = auto_build |
206 | 754 | self.widgets['auto_build_pocket'].context.required = auto_build | 752 | self.widgets['auto_build_pocket'].context.required = auto_build |
207 | 755 | if self.widgets.get('store_upload') is not None: | 753 | if self.widgets.get('store_upload') is not None: |
208 | 756 | # Set widgets as required or optional depending on the | 754 | # Set widgets as required or optional depending on the |
209 | 757 | # store_upload field. | 755 | # store_upload field. |
212 | 758 | super(BaseSnapEditView, self).validate_widgets( | 756 | super().validate_widgets(data, ['store_upload']) |
211 | 759 | data, ['store_upload']) | ||
213 | 760 | store_upload = data.get('store_upload', False) | 757 | store_upload = data.get('store_upload', False) |
214 | 761 | self.widgets['store_name'].context.required = store_upload | 758 | self.widgets['store_name'].context.required = store_upload |
215 | 762 | self.widgets['store_channels'].context.required = store_upload | 759 | self.widgets['store_channels'].context.required = store_upload |
217 | 763 | super(BaseSnapEditView, self).validate_widgets(data, names=names) | 760 | super().validate_widgets(data, names=names) |
218 | 764 | 761 | ||
219 | 765 | def validate(self, data): | 762 | def validate(self, data): |
221 | 766 | super(BaseSnapEditView, self).validate(data) | 763 | super().validate(data) |
222 | 767 | info_type = data.get('information_type', self.context.information_type) | 764 | info_type = data.get('information_type', self.context.information_type) |
223 | 768 | editing_info_type = 'information_type' in data | 765 | editing_info_type = 'information_type' in data |
224 | 769 | private = info_type in PRIVATE_INFORMATION_TYPES | 766 | private = info_type in PRIVATE_INFORMATION_TYPES |
225 | @@ -876,8 +873,7 @@ class SnapAdminView(BaseSnapEditView): | |||
226 | 876 | if 'project' in data: | 873 | if 'project' in data: |
227 | 877 | project = data.pop('project') | 874 | project = data.pop('project') |
228 | 878 | self.context.setProject(project) | 875 | self.context.setProject(project) |
231 | 879 | super(SnapAdminView, self).updateContextFromData( | 876 | super().updateContextFromData(data, context, notify_modified) |
230 | 880 | data, context, notify_modified) | ||
232 | 881 | 877 | ||
233 | 882 | 878 | ||
234 | 883 | class SnapEditView(BaseSnapEditView, EnableProcessorsMixin): | 879 | class SnapEditView(BaseSnapEditView, EnableProcessorsMixin): |
235 | @@ -926,7 +922,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin): | |||
236 | 926 | 922 | ||
237 | 927 | def setUpFields(self): | 923 | def setUpFields(self): |
238 | 928 | """See `LaunchpadFormView`.""" | 924 | """See `LaunchpadFormView`.""" |
240 | 929 | super(SnapEditView, self).setUpFields() | 925 | super().setUpFields() |
241 | 930 | self.form_fields += self.createEnabledProcessors( | 926 | self.form_fields += self.createEnabledProcessors( |
242 | 931 | self.context.available_processors, | 927 | self.context.available_processors, |
243 | 932 | "The architectures that this snap package builds for. Some " | 928 | "The architectures that this snap package builds for. Some " |
244 | @@ -934,7 +930,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin): | |||
245 | 934 | "disabled by administrators.") | 930 | "disabled by administrators.") |
246 | 935 | 931 | ||
247 | 936 | def setUpWidgets(self, context=None): | 932 | def setUpWidgets(self, context=None): |
249 | 937 | super(SnapEditView, self).setUpWidgets(context) | 933 | super().setUpWidgets(context) |
250 | 938 | info_type_widget = self.widgets['information_type'] | 934 | info_type_widget = self.widgets['information_type'] |
251 | 939 | info_type_widget.vocabulary = InformationTypeVocabulary( | 935 | info_type_widget.vocabulary = InformationTypeVocabulary( |
252 | 940 | types=self.getPossibleInformationTypes(self.context, self.user)) | 936 | types=self.getPossibleInformationTypes(self.context, self.user)) |
253 | @@ -957,7 +953,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin): | |||
254 | 957 | return initial_values | 953 | return initial_values |
255 | 958 | 954 | ||
256 | 959 | def validate(self, data): | 955 | def validate(self, data): |
258 | 960 | super(SnapEditView, self).validate(data) | 956 | super().validate(data) |
259 | 961 | owner = data.get('owner', None) | 957 | owner = data.get('owner', None) |
260 | 962 | name = data.get('name', None) | 958 | name = data.get('name', None) |
261 | 963 | if owner and name: | 959 | if owner and name: |
262 | @@ -988,8 +984,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin): | |||
263 | 988 | if 'project' in data: | 984 | if 'project' in data: |
264 | 989 | project = data.pop('project') | 985 | project = data.pop('project') |
265 | 990 | self.context.setProject(project) | 986 | self.context.setProject(project) |
268 | 991 | super(SnapEditView, self).updateContextFromData( | 987 | super().updateContextFromData(data, context, notify_modified) |
267 | 992 | data, context, notify_modified) | ||
269 | 993 | 988 | ||
270 | 994 | 989 | ||
271 | 995 | class SnapAuthorizeView(LaunchpadEditFormView): | 990 | class SnapAuthorizeView(LaunchpadEditFormView): |
272 | @@ -1029,7 +1024,7 @@ class SnapAuthorizeView(LaunchpadEditFormView): | |||
273 | 1029 | ]) | 1024 | ]) |
274 | 1030 | return login_url | 1025 | return login_url |
275 | 1031 | except CannotAuthorizeStoreUploads as e: | 1026 | except CannotAuthorizeStoreUploads as e: |
277 | 1032 | request.response.addInfoNotification(six.text_type(e)) | 1027 | request.response.addInfoNotification(str(e)) |
278 | 1033 | request.response.redirect(canonical_url(snap)) | 1028 | request.response.redirect(canonical_url(snap)) |
279 | 1034 | return | 1029 | return |
280 | 1035 | 1030 | ||
281 | diff --git a/lib/lp/snappy/browser/snapbuild.py b/lib/lp/snappy/browser/snapbuild.py | |||
282 | index ff5e231..ad54692 100644 | |||
283 | --- a/lib/lp/snappy/browser/snapbuild.py | |||
284 | +++ b/lib/lp/snappy/browser/snapbuild.py | |||
285 | @@ -163,7 +163,7 @@ class SnapBuildRescoreView(LaunchpadFormView): | |||
286 | 163 | 163 | ||
287 | 164 | def __call__(self): | 164 | def __call__(self): |
288 | 165 | if self.context.can_be_rescored: | 165 | if self.context.can_be_rescored: |
290 | 166 | return super(SnapBuildRescoreView, self).__call__() | 166 | return super().__call__() |
291 | 167 | self.request.response.addWarningNotification( | 167 | self.request.response.addWarningNotification( |
292 | 168 | "Cannot rescore this build because it is not queued.") | 168 | "Cannot rescore this build because it is not queued.") |
293 | 169 | self.request.response.redirect(canonical_url(self.context)) | 169 | self.request.response.redirect(canonical_url(self.context)) |
294 | diff --git a/lib/lp/snappy/browser/snaplisting.py b/lib/lp/snappy/browser/snaplisting.py | |||
295 | index 7c2e9d5..37098b5 100644 | |||
296 | --- a/lib/lp/snappy/browser/snaplisting.py | |||
297 | +++ b/lib/lp/snappy/browser/snaplisting.py | |||
298 | @@ -39,7 +39,7 @@ class SnapListingView(LaunchpadView, FeedsMixin): | |||
299 | 39 | 'displayname': self.context.displayname} | 39 | 'displayname': self.context.displayname} |
300 | 40 | 40 | ||
301 | 41 | def initialize(self): | 41 | def initialize(self): |
303 | 42 | super(SnapListingView, self).initialize() | 42 | super().initialize() |
304 | 43 | snaps = getUtility(ISnapSet).findByContext( | 43 | snaps = getUtility(ISnapSet).findByContext( |
305 | 44 | self.context, visible_by_user=self.user) | 44 | self.context, visible_by_user=self.user) |
306 | 45 | loader = partial( | 45 | loader = partial( |
307 | @@ -56,7 +56,7 @@ class BranchSnapListingView(SnapListingView): | |||
308 | 56 | source_enabled = False | 56 | source_enabled = False |
309 | 57 | 57 | ||
310 | 58 | def initialize(self): | 58 | def initialize(self): |
312 | 59 | super(BranchSnapListingView, self).initialize() | 59 | super().initialize() |
313 | 60 | # Replace our context with a decorated branch, if it is not already | 60 | # Replace our context with a decorated branch, if it is not already |
314 | 61 | # decorated. | 61 | # decorated. |
315 | 62 | if not isinstance(self.context, DecoratedBranch): | 62 | if not isinstance(self.context, DecoratedBranch): |
316 | diff --git a/lib/lp/snappy/browser/snapsubscription.py b/lib/lp/snappy/browser/snapsubscription.py | |||
317 | index 0b4afb3..dcb6a2c 100644 | |||
318 | --- a/lib/lp/snappy/browser/snapsubscription.py | |||
319 | +++ b/lib/lp/snappy/browser/snapsubscription.py | |||
320 | @@ -93,7 +93,7 @@ class SnapSubscriptionEditView(RedirectToSnapMixin, LaunchpadEditFormView): | |||
321 | 93 | def initialize(self): | 93 | def initialize(self): |
322 | 94 | self.snap = self.context.snap | 94 | self.snap = self.context.snap |
323 | 95 | self.person = self.context.person | 95 | self.person = self.context.person |
325 | 96 | super(SnapSubscriptionEditView, self).initialize() | 96 | super().initialize() |
326 | 97 | 97 | ||
327 | 98 | @action("Unsubscribe", name="unsubscribe") | 98 | @action("Unsubscribe", name="unsubscribe") |
328 | 99 | def unsubscribe_action(self, action, data): | 99 | def unsubscribe_action(self, action, data): |
329 | @@ -112,7 +112,7 @@ class _SnapSubscriptionCreationView(RedirectToSnapMixin, LaunchpadFormView): | |||
330 | 112 | 112 | ||
331 | 113 | def initialize(self): | 113 | def initialize(self): |
332 | 114 | self.snap = self.context | 114 | self.snap = self.context |
334 | 115 | super(_SnapSubscriptionCreationView, self).initialize() | 115 | super().initialize() |
335 | 116 | 116 | ||
336 | 117 | 117 | ||
337 | 118 | class SnapSubscriptionAddView(_SnapSubscriptionCreationView): | 118 | class SnapSubscriptionAddView(_SnapSubscriptionCreationView): |
338 | diff --git a/lib/lp/snappy/browser/tests/test_hassnaps.py b/lib/lp/snappy/browser/tests/test_hassnaps.py | |||
339 | index b70994a..88608a6 100644 | |||
340 | --- a/lib/lp/snappy/browser/tests/test_hassnaps.py | |||
341 | +++ b/lib/lp/snappy/browser/tests/test_hassnaps.py | |||
342 | @@ -104,7 +104,7 @@ class TestHasSnapsMenu(WithScenarios, TestCaseWithFactory): | |||
343 | 104 | ] | 104 | ] |
344 | 105 | 105 | ||
345 | 106 | def setUp(self): | 106 | def setUp(self): |
347 | 107 | super(TestHasSnapsMenu, self).setUp() | 107 | super().setUp() |
348 | 108 | if self.needs_git_hosting_fixture: | 108 | if self.needs_git_hosting_fixture: |
349 | 109 | self.useFixture(GitHostingFixture()) | 109 | self.useFixture(GitHostingFixture()) |
350 | 110 | 110 | ||
351 | diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py | |||
352 | index 3e54942..c513111 100644 | |||
353 | --- a/lib/lp/snappy/browser/tests/test_snap.py | |||
354 | +++ b/lib/lp/snappy/browser/tests/test_snap.py | |||
355 | @@ -118,7 +118,7 @@ class TestSnapNavigation(TestCaseWithFactory): | |||
356 | 118 | layer = DatabaseFunctionalLayer | 118 | layer = DatabaseFunctionalLayer |
357 | 119 | 119 | ||
358 | 120 | def setUp(self): | 120 | def setUp(self): |
360 | 121 | super(TestSnapNavigation, self).setUp() | 121 | super().setUp() |
361 | 122 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 122 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
362 | 123 | 123 | ||
363 | 124 | def test_canonical_url(self): | 124 | def test_canonical_url(self): |
364 | @@ -162,7 +162,7 @@ class BaseTestSnapView(BrowserTestCase): | |||
365 | 162 | layer = LaunchpadFunctionalLayer | 162 | layer = LaunchpadFunctionalLayer |
366 | 163 | 163 | ||
367 | 164 | def setUp(self): | 164 | def setUp(self): |
369 | 165 | super(BaseTestSnapView, self).setUp() | 165 | super().setUp() |
370 | 166 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 166 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
371 | 167 | self.useFixture(FakeLogger()) | 167 | self.useFixture(FakeLogger()) |
372 | 168 | self.snap_store_client = FakeMethod() | 168 | self.snap_store_client = FakeMethod() |
373 | @@ -181,7 +181,7 @@ class BaseTestSnapView(BrowserTestCase): | |||
374 | 181 | class TestSnapAddView(BaseTestSnapView): | 181 | class TestSnapAddView(BaseTestSnapView): |
375 | 182 | 182 | ||
376 | 183 | def setUp(self): | 183 | def setUp(self): |
378 | 184 | super(TestSnapAddView, self).setUp() | 184 | super().setUp() |
379 | 185 | self.distroseries = self.factory.makeUbuntuDistroSeries( | 185 | self.distroseries = self.factory.makeUbuntuDistroSeries( |
380 | 186 | version="13.10") | 186 | version="13.10") |
381 | 187 | with admin_logged_in(): | 187 | with admin_logged_in(): |
382 | @@ -846,7 +846,7 @@ class TestSnapAdminView(BaseTestSnapView): | |||
383 | 846 | class TestSnapEditView(BaseTestSnapView): | 846 | class TestSnapEditView(BaseTestSnapView): |
384 | 847 | 847 | ||
385 | 848 | def setUp(self): | 848 | def setUp(self): |
387 | 849 | super(TestSnapEditView, self).setUp() | 849 | super().setUp() |
388 | 850 | self.distroseries = self.factory.makeUbuntuDistroSeries( | 850 | self.distroseries = self.factory.makeUbuntuDistroSeries( |
389 | 851 | version="13.10") | 851 | version="13.10") |
390 | 852 | with admin_logged_in(): | 852 | with admin_logged_in(): |
391 | @@ -1472,7 +1472,7 @@ class TestSnapEditView(BaseTestSnapView): | |||
392 | 1472 | class TestSnapAuthorizeView(BaseTestSnapView): | 1472 | class TestSnapAuthorizeView(BaseTestSnapView): |
393 | 1473 | 1473 | ||
394 | 1474 | def setUp(self): | 1474 | def setUp(self): |
396 | 1475 | super(TestSnapAuthorizeView, self).setUp() | 1475 | super().setUp() |
397 | 1476 | self.distroseries = self.factory.makeUbuntuDistroSeries() | 1476 | self.distroseries = self.factory.makeUbuntuDistroSeries() |
398 | 1477 | with admin_logged_in(): | 1477 | with admin_logged_in(): |
399 | 1478 | self.snappyseries = self.factory.makeSnappySeries( | 1478 | self.snappyseries = self.factory.makeSnappySeries( |
400 | @@ -1620,7 +1620,7 @@ class TestSnapDeleteView(BaseTestSnapView): | |||
401 | 1620 | class TestSnapView(BaseTestSnapView): | 1620 | class TestSnapView(BaseTestSnapView): |
402 | 1621 | 1621 | ||
403 | 1622 | def setUp(self): | 1622 | def setUp(self): |
405 | 1623 | super(TestSnapView, self).setUp() | 1623 | super().setUp() |
406 | 1624 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu | 1624 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
407 | 1625 | self.distroseries = self.factory.makeDistroSeries( | 1625 | self.distroseries = self.factory.makeDistroSeries( |
408 | 1626 | distribution=self.ubuntu, name="shiny", displayname="Shiny") | 1626 | distribution=self.ubuntu, name="shiny", displayname="Shiny") |
409 | @@ -2080,7 +2080,7 @@ class TestSnapView(BaseTestSnapView): | |||
410 | 2080 | class TestSnapRequestBuildsView(BaseTestSnapView): | 2080 | class TestSnapRequestBuildsView(BaseTestSnapView): |
411 | 2081 | 2081 | ||
412 | 2082 | def setUp(self): | 2082 | def setUp(self): |
414 | 2083 | super(TestSnapRequestBuildsView, self).setUp() | 2083 | super().setUp() |
415 | 2084 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu | 2084 | self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
416 | 2085 | self.distroseries = self.factory.makeDistroSeries( | 2085 | self.distroseries = self.factory.makeDistroSeries( |
417 | 2086 | distribution=self.ubuntu, name="shiny", displayname="Shiny") | 2086 | distribution=self.ubuntu, name="shiny", displayname="Shiny") |
418 | diff --git a/lib/lp/snappy/browser/tests/test_snapbuild.py b/lib/lp/snappy/browser/tests/test_snapbuild.py | |||
419 | index ef78906..5b802d5 100644 | |||
420 | --- a/lib/lp/snappy/browser/tests/test_snapbuild.py | |||
421 | +++ b/lib/lp/snappy/browser/tests/test_snapbuild.py | |||
422 | @@ -236,7 +236,7 @@ class TestSnapBuildOperations(BrowserTestCase): | |||
423 | 236 | layer = DatabaseFunctionalLayer | 236 | layer = DatabaseFunctionalLayer |
424 | 237 | 237 | ||
425 | 238 | def setUp(self): | 238 | def setUp(self): |
427 | 239 | super(TestSnapBuildOperations, self).setUp() | 239 | super().setUp() |
428 | 240 | self.useFixture(FakeLogger()) | 240 | self.useFixture(FakeLogger()) |
429 | 241 | self.build = self.factory.makeSnapBuild() | 241 | self.build = self.factory.makeSnapBuild() |
430 | 242 | self.build_url = canonical_url(self.build) | 242 | self.build_url = canonical_url(self.build) |
431 | diff --git a/lib/lp/snappy/browser/tests/test_snapsubscription.py b/lib/lp/snappy/browser/tests/test_snapsubscription.py | |||
432 | index d73e0cc..575c0d6 100644 | |||
433 | --- a/lib/lp/snappy/browser/tests/test_snapsubscription.py | |||
434 | +++ b/lib/lp/snappy/browser/tests/test_snapsubscription.py | |||
435 | @@ -30,7 +30,7 @@ class BaseTestSnapView(BrowserTestCase): | |||
436 | 30 | layer = DatabaseFunctionalLayer | 30 | layer = DatabaseFunctionalLayer |
437 | 31 | 31 | ||
438 | 32 | def setUp(self): | 32 | def setUp(self): |
440 | 33 | super(BaseTestSnapView, self).setUp() | 33 | super().setUp() |
441 | 34 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 34 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
442 | 35 | self.useFixture(FakeLogger()) | 35 | self.useFixture(FakeLogger()) |
443 | 36 | self.person = self.factory.makePerson(name='snap-owner') | 36 | self.person = self.factory.makePerson(name='snap-owner') |
444 | diff --git a/lib/lp/snappy/browser/widgets/snaparchive.py b/lib/lp/snappy/browser/widgets/snaparchive.py | |||
445 | index 74102aa..538123e 100644 | |||
446 | --- a/lib/lp/snappy/browser/widgets/snaparchive.py | |||
447 | +++ b/lib/lp/snappy/browser/widgets/snaparchive.py | |||
448 | @@ -137,7 +137,7 @@ class SnapArchiveWidget(BrowserWidget, InputWidget): | |||
449 | 137 | self.getInputValue() | 137 | self.getInputValue() |
450 | 138 | except InputErrors as error: | 138 | except InputErrors as error: |
451 | 139 | self._error = error | 139 | self._error = error |
453 | 140 | return super(SnapArchiveWidget, self).error() | 140 | return super().error() |
454 | 141 | 141 | ||
455 | 142 | def __call__(self): | 142 | def __call__(self): |
456 | 143 | """See `IBrowserWidget`.""" | 143 | """See `IBrowserWidget`.""" |
457 | diff --git a/lib/lp/snappy/browser/widgets/snapbuildchannels.py b/lib/lp/snappy/browser/widgets/snapbuildchannels.py | |||
458 | index 1be81fc..8d0264d 100644 | |||
459 | --- a/lib/lp/snappy/browser/widgets/snapbuildchannels.py | |||
460 | +++ b/lib/lp/snappy/browser/widgets/snapbuildchannels.py | |||
461 | @@ -37,7 +37,7 @@ class SnapBuildChannelsWidget(BrowserWidget, InputWidget): | |||
462 | 37 | _widgets_set_up = False | 37 | _widgets_set_up = False |
463 | 38 | 38 | ||
464 | 39 | def __init__(self, context, request): | 39 | def __init__(self, context, request): |
466 | 40 | super(SnapBuildChannelsWidget, self).__init__(context, request) | 40 | super().__init__(context, request) |
467 | 41 | self.hint = ( | 41 | self.hint = ( |
468 | 42 | 'The channels to use for build tools when building the snap ' | 42 | 'The channels to use for build tools when building the snap ' |
469 | 43 | 'package.\n') | 43 | 'package.\n') |
470 | @@ -112,7 +112,7 @@ class SnapBuildChannelsWidget(BrowserWidget, InputWidget): | |||
471 | 112 | self.getInputValue() | 112 | self.getInputValue() |
472 | 113 | except InputErrors as error: | 113 | except InputErrors as error: |
473 | 114 | self._error = error | 114 | self._error = error |
475 | 115 | return super(SnapBuildChannelsWidget, self).error() | 115 | return super().error() |
476 | 116 | 116 | ||
477 | 117 | def __call__(self): | 117 | def __call__(self): |
478 | 118 | """See `IBrowserWidget`.""" | 118 | """See `IBrowserWidget`.""" |
479 | diff --git a/lib/lp/snappy/browser/widgets/storechannels.py b/lib/lp/snappy/browser/widgets/storechannels.py | |||
480 | index 996393b..7b0badf 100644 | |||
481 | --- a/lib/lp/snappy/browser/widgets/storechannels.py | |||
482 | +++ b/lib/lp/snappy/browser/widgets/storechannels.py | |||
483 | @@ -48,7 +48,7 @@ class StoreChannelsWidget(BrowserWidget, InputWidget): | |||
484 | 48 | 48 | ||
485 | 49 | def __init__(self, field, value_type, request): | 49 | def __init__(self, field, value_type, request): |
486 | 50 | # We don't use value_type. | 50 | # We don't use value_type. |
488 | 51 | super(StoreChannelsWidget, self).__init__(field, request) | 51 | super().__init__(field, request) |
489 | 52 | # disable help_text for the global widget | 52 | # disable help_text for the global widget |
490 | 53 | self.hint = None | 53 | self.hint = None |
491 | 54 | 54 | ||
492 | @@ -168,7 +168,7 @@ class StoreChannelsWidget(BrowserWidget, InputWidget): | |||
493 | 168 | self.getInputValue() | 168 | self.getInputValue() |
494 | 169 | except InputErrors as error: | 169 | except InputErrors as error: |
495 | 170 | self._error = error | 170 | self._error = error |
497 | 171 | return super(StoreChannelsWidget, self).error() | 171 | return super().error() |
498 | 172 | 172 | ||
499 | 173 | def __call__(self): | 173 | def __call__(self): |
500 | 174 | """See `IBrowserWidget`.""" | 174 | """See `IBrowserWidget`.""" |
501 | diff --git a/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py b/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py | |||
502 | index e6b1ec1..5116684 100644 | |||
503 | --- a/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py | |||
504 | +++ b/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py | |||
505 | @@ -60,7 +60,7 @@ class TestSnapArchiveWidget(WithScenarios, TestCaseWithFactory): | |||
506 | 60 | ] | 60 | ] |
507 | 61 | 61 | ||
508 | 62 | def setUp(self): | 62 | def setUp(self): |
510 | 63 | super(TestSnapArchiveWidget, self).setUp() | 63 | super().setUp() |
511 | 64 | self.distroseries = self.factory.makeDistroSeries() | 64 | self.distroseries = self.factory.makeDistroSeries() |
512 | 65 | field = Reference(__name__="archive", schema=IArchive, title="Archive") | 65 | field = Reference(__name__="archive", schema=IArchive, title="Archive") |
513 | 66 | self.context = self.context_factory(self) | 66 | self.context = self.context_factory(self) |
514 | diff --git a/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py b/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py | |||
515 | index 2d4dc25..543d4ed 100644 | |||
516 | --- a/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py | |||
517 | +++ b/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py | |||
518 | @@ -28,7 +28,7 @@ class TestSnapBuildChannelsWidget(TestCaseWithFactory): | |||
519 | 28 | layer = DatabaseFunctionalLayer | 28 | layer = DatabaseFunctionalLayer |
520 | 29 | 29 | ||
521 | 30 | def setUp(self): | 30 | def setUp(self): |
523 | 31 | super(TestSnapBuildChannelsWidget, self).setUp() | 31 | super().setUp() |
524 | 32 | field = Dict( | 32 | field = Dict( |
525 | 33 | __name__="auto_build_channels", | 33 | __name__="auto_build_channels", |
526 | 34 | title="Source snap channels for automatic builds") | 34 | title="Source snap channels for automatic builds") |
527 | diff --git a/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py b/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py | |||
528 | index bc452aa..6deb9de 100644 | |||
529 | --- a/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py | |||
530 | +++ b/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py | |||
531 | @@ -31,7 +31,7 @@ class TestStoreChannelsWidget(TestCaseWithFactory): | |||
532 | 31 | layer = DatabaseFunctionalLayer | 31 | layer = DatabaseFunctionalLayer |
533 | 32 | 32 | ||
534 | 33 | def setUp(self): | 33 | def setUp(self): |
536 | 34 | super(TestStoreChannelsWidget, self).setUp() | 34 | super().setUp() |
537 | 35 | field = List(__name__="channels", title="Store channels") | 35 | field = List(__name__="channels", title="Store channels") |
538 | 36 | self.context = self.factory.makeSnap() | 36 | self.context = self.factory.makeSnap() |
539 | 37 | field = field.bind(self.context) | 37 | field = field.bind(self.context) |
540 | diff --git a/lib/lp/snappy/interfaces/snap.py b/lib/lp/snappy/interfaces/snap.py | |||
541 | index 957a378..af3cfd8 100644 | |||
542 | --- a/lib/lp/snappy/interfaces/snap.py | |||
543 | +++ b/lib/lp/snappy/interfaces/snap.py | |||
544 | @@ -133,7 +133,7 @@ class SnapBuildAlreadyPending(Exception): | |||
545 | 133 | """A build was requested when an identical build was already pending.""" | 133 | """A build was requested when an identical build was already pending.""" |
546 | 134 | 134 | ||
547 | 135 | def __init__(self): | 135 | def __init__(self): |
549 | 136 | super(SnapBuildAlreadyPending, self).__init__( | 136 | super().__init__( |
550 | 137 | "An identical build of this snap package is already pending.") | 137 | "An identical build of this snap package is already pending.") |
551 | 138 | 138 | ||
552 | 139 | 139 | ||
553 | @@ -150,7 +150,7 @@ class SnapBuildArchiveOwnerMismatch(Forbidden): | |||
554 | 150 | """ | 150 | """ |
555 | 151 | 151 | ||
556 | 152 | def __init__(self): | 152 | def __init__(self): |
558 | 153 | super(SnapBuildArchiveOwnerMismatch, self).__init__( | 153 | super().__init__( |
559 | 154 | "Snap package builds against private archives are only allowed " | 154 | "Snap package builds against private archives are only allowed " |
560 | 155 | "if the snap package owner and the archive owner are equal.") | 155 | "if the snap package owner and the archive owner are equal.") |
561 | 156 | 156 | ||
562 | @@ -160,7 +160,7 @@ class SnapBuildDisallowedArchitecture(Exception): | |||
563 | 160 | """A build was requested for a disallowed architecture.""" | 160 | """A build was requested for a disallowed architecture.""" |
564 | 161 | 161 | ||
565 | 162 | def __init__(self, das, pocket): | 162 | def __init__(self, das, pocket): |
567 | 163 | super(SnapBuildDisallowedArchitecture, self).__init__( | 163 | super().__init__( |
568 | 164 | "This snap package is not allowed to build for %s/%s." % | 164 | "This snap package is not allowed to build for %s/%s." % |
569 | 165 | (das.distroseries.getSuite(pocket), das.architecturetag)) | 165 | (das.distroseries.getSuite(pocket), das.architecturetag)) |
570 | 166 | 166 | ||
571 | @@ -170,8 +170,7 @@ class SnapPrivateFeatureDisabled(Unauthorized): | |||
572 | 170 | """Only certain users can create private snap objects.""" | 170 | """Only certain users can create private snap objects.""" |
573 | 171 | 171 | ||
574 | 172 | def __init__(self): | 172 | def __init__(self): |
577 | 173 | super(SnapPrivateFeatureDisabled, self).__init__( | 173 | super().__init__("You do not have permission to create private snaps") |
576 | 174 | "You do not have permission to create private snaps") | ||
578 | 175 | 174 | ||
579 | 176 | 175 | ||
580 | 177 | @error_status(http.client.BAD_REQUEST) | 176 | @error_status(http.client.BAD_REQUEST) |
581 | @@ -179,7 +178,7 @@ class DuplicateSnapName(Exception): | |||
582 | 179 | """Raised for snap packages with duplicate name/owner.""" | 178 | """Raised for snap packages with duplicate name/owner.""" |
583 | 180 | 179 | ||
584 | 181 | def __init__(self): | 180 | def __init__(self): |
586 | 182 | super(DuplicateSnapName, self).__init__( | 181 | super().__init__( |
587 | 183 | "There is already a snap package with the same name and owner.") | 182 | "There is already a snap package with the same name and owner.") |
588 | 184 | 183 | ||
589 | 185 | 184 | ||
590 | @@ -198,7 +197,7 @@ class NoSourceForSnap(Exception): | |||
591 | 198 | """Snap packages must have a source (Bazaar or Git branch).""" | 197 | """Snap packages must have a source (Bazaar or Git branch).""" |
592 | 199 | 198 | ||
593 | 200 | def __init__(self): | 199 | def __init__(self): |
595 | 201 | super(NoSourceForSnap, self).__init__( | 200 | super().__init__( |
596 | 202 | "New snap packages must have either a Bazaar branch or a Git " | 201 | "New snap packages must have either a Bazaar branch or a Git " |
597 | 203 | "branch.") | 202 | "branch.") |
598 | 204 | 203 | ||
599 | @@ -213,7 +212,7 @@ class SnapPrivacyMismatch(Exception): | |||
600 | 213 | """Snap package privacy does not match its content.""" | 212 | """Snap package privacy does not match its content.""" |
601 | 214 | 213 | ||
602 | 215 | def __init__(self, message=None): | 214 | def __init__(self, message=None): |
604 | 216 | super(SnapPrivacyMismatch, self).__init__( | 215 | super().__init__( |
605 | 217 | message or | 216 | message or |
606 | 218 | "Snap recipe contains private information and cannot be public.") | 217 | "Snap recipe contains private information and cannot be public.") |
607 | 219 | 218 | ||
608 | @@ -223,7 +222,7 @@ class SnapPrivacyPillarError(Exception): | |||
609 | 223 | """Private Snaps should be based in a pillar.""" | 222 | """Private Snaps should be based in a pillar.""" |
610 | 224 | 223 | ||
611 | 225 | def __init__(self, message=None): | 224 | def __init__(self, message=None): |
613 | 226 | super(SnapPrivacyPillarError, self).__init__( | 225 | super().__init__( |
614 | 227 | message or "Private Snap recipes should have a pillar.") | 226 | message or "Private Snap recipes should have a pillar.") |
615 | 228 | 227 | ||
616 | 229 | 228 | ||
617 | @@ -240,8 +239,7 @@ class CannotModifySnapProcessor(Exception): | |||
618 | 240 | 'by administrators.') | 239 | 'by administrators.') |
619 | 241 | 240 | ||
620 | 242 | def __init__(self, processor): | 241 | def __init__(self, processor): |
623 | 243 | super(CannotModifySnapProcessor, self).__init__( | 242 | super().__init__(self._fmt % {'processor': processor.name}) |
622 | 244 | self._fmt % {'processor': processor.name}) | ||
624 | 245 | 243 | ||
625 | 246 | 244 | ||
626 | 247 | @error_status(http.client.BAD_REQUEST) | 245 | @error_status(http.client.BAD_REQUEST) |
627 | @@ -264,7 +262,7 @@ class CannotRequestAutoBuilds(Exception): | |||
628 | 264 | """Snap package is not configured for automatic builds.""" | 262 | """Snap package is not configured for automatic builds.""" |
629 | 265 | 263 | ||
630 | 266 | def __init__(self, field): | 264 | def __init__(self, field): |
632 | 267 | super(CannotRequestAutoBuilds, self).__init__( | 265 | super().__init__( |
633 | 268 | "This snap package cannot have automatic builds created for it " | 266 | "This snap package cannot have automatic builds created for it " |
634 | 269 | "because %s is not set." % field) | 267 | "because %s is not set." % field) |
635 | 270 | 268 | ||
636 | @@ -273,15 +271,14 @@ class MissingSnapcraftYaml(Exception): | |||
637 | 273 | """The repository for this snap package does not have a snapcraft.yaml.""" | 271 | """The repository for this snap package does not have a snapcraft.yaml.""" |
638 | 274 | 272 | ||
639 | 275 | def __init__(self, branch_name): | 273 | def __init__(self, branch_name): |
642 | 276 | super(MissingSnapcraftYaml, self).__init__( | 274 | super().__init__("Cannot find snapcraft.yaml in %s" % branch_name) |
641 | 277 | "Cannot find snapcraft.yaml in %s" % branch_name) | ||
643 | 278 | 275 | ||
644 | 279 | 276 | ||
645 | 280 | class CannotFetchSnapcraftYaml(Exception): | 277 | class CannotFetchSnapcraftYaml(Exception): |
646 | 281 | """Launchpad cannot fetch this snap package's snapcraft.yaml.""" | 278 | """Launchpad cannot fetch this snap package's snapcraft.yaml.""" |
647 | 282 | 279 | ||
648 | 283 | def __init__(self, message, unsupported_remote=False): | 280 | def __init__(self, message, unsupported_remote=False): |
650 | 284 | super(CannotFetchSnapcraftYaml, self).__init__(message) | 281 | super().__init__(message) |
651 | 285 | self.unsupported_remote = unsupported_remote | 282 | self.unsupported_remote = unsupported_remote |
652 | 286 | 283 | ||
653 | 287 | 284 | ||
654 | diff --git a/lib/lp/snappy/interfaces/snapbase.py b/lib/lp/snappy/interfaces/snapbase.py | |||
655 | index ace5443..d635bfb 100644 | |||
656 | --- a/lib/lp/snappy/interfaces/snapbase.py | |||
657 | +++ b/lib/lp/snappy/interfaces/snapbase.py | |||
658 | @@ -34,7 +34,6 @@ from lazr.restful.fields import ( | |||
659 | 34 | Reference, | 34 | Reference, |
660 | 35 | ) | 35 | ) |
661 | 36 | from lazr.restful.interface import copy_field | 36 | from lazr.restful.interface import copy_field |
662 | 37 | import six | ||
663 | 38 | from zope.component import getUtility | 37 | from zope.component import getUtility |
664 | 39 | from zope.interface import Interface | 38 | from zope.interface import Interface |
665 | 40 | from zope.schema import ( | 39 | from zope.schema import ( |
666 | @@ -179,7 +178,7 @@ class ISnapBaseEdit(Interface): | |||
667 | 179 | 178 | ||
668 | 180 | @operation_parameters( | 179 | @operation_parameters( |
669 | 181 | component=copy_field(IArchiveDependency["component_name"])) | 180 | component=copy_field(IArchiveDependency["component_name"])) |
671 | 182 | @export_operation_as(six.ensure_str("addArchiveDependency")) | 181 | @export_operation_as("addArchiveDependency") |
672 | 183 | @export_factory_operation(IArchiveDependency, ["dependency", "pocket"]) | 182 | @export_factory_operation(IArchiveDependency, ["dependency", "pocket"]) |
673 | 184 | @operation_for_version("devel") | 183 | @operation_for_version("devel") |
674 | 185 | def _addArchiveDependency(dependency, pocket, component=None): | 184 | def _addArchiveDependency(dependency, pocket, component=None): |
675 | diff --git a/lib/lp/snappy/interfaces/snapstoreclient.py b/lib/lp/snappy/interfaces/snapstoreclient.py | |||
676 | index 30740d2..1e00979 100644 | |||
677 | --- a/lib/lp/snappy/interfaces/snapstoreclient.py | |||
678 | +++ b/lib/lp/snappy/interfaces/snapstoreclient.py | |||
679 | @@ -27,7 +27,7 @@ class SnapStoreError(Exception): | |||
680 | 27 | 27 | ||
681 | 28 | def __init__( | 28 | def __init__( |
682 | 29 | self, message="", detail=None, messages=None, can_retry=False): | 29 | self, message="", detail=None, messages=None, can_retry=False): |
684 | 30 | super(SnapStoreError, self).__init__(message) | 30 | super().__init__(message) |
685 | 31 | self.message = message | 31 | self.message = message |
686 | 32 | self.detail = detail | 32 | self.detail = detail |
687 | 33 | self.messages = messages | 33 | self.messages = messages |
688 | diff --git a/lib/lp/snappy/mail/snapbuild.py b/lib/lp/snappy/mail/snapbuild.py | |||
689 | index 310c782..aee1685 100644 | |||
690 | --- a/lib/lp/snappy/mail/snapbuild.py | |||
691 | +++ b/lib/lp/snappy/mail/snapbuild.py | |||
692 | @@ -89,14 +89,14 @@ class SnapBuildMailer(BaseMailer): | |||
693 | 89 | 89 | ||
694 | 90 | def __init__(self, subject, template_name, recipients, from_address, | 90 | def __init__(self, subject, template_name, recipients, from_address, |
695 | 91 | notification_type, build): | 91 | notification_type, build): |
697 | 92 | super(SnapBuildMailer, self).__init__( | 92 | super().__init__( |
698 | 93 | subject, template_name, recipients, from_address, | 93 | subject, template_name, recipients, from_address, |
699 | 94 | notification_type=notification_type) | 94 | notification_type=notification_type) |
700 | 95 | self.build = build | 95 | self.build = build |
701 | 96 | 96 | ||
702 | 97 | def _getHeaders(self, email, recipient): | 97 | def _getHeaders(self, email, recipient): |
703 | 98 | """See `BaseMailer`.""" | 98 | """See `BaseMailer`.""" |
705 | 99 | headers = super(SnapBuildMailer, self)._getHeaders(email, recipient) | 99 | headers = super()._getHeaders(email, recipient) |
706 | 100 | headers["X-Launchpad-Build-State"] = self.build.status.name | 100 | headers["X-Launchpad-Build-State"] = self.build.status.name |
707 | 101 | return headers | 101 | return headers |
708 | 102 | 102 | ||
709 | @@ -110,8 +110,7 @@ class SnapBuildMailer(BaseMailer): | |||
710 | 110 | else: | 110 | else: |
711 | 111 | error_message = upload_job.error_message or "" | 111 | error_message = upload_job.error_message or "" |
712 | 112 | store_url = upload_job.store_url or "" | 112 | store_url = upload_job.store_url or "" |
715 | 113 | params = super(SnapBuildMailer, self)._getTemplateParams( | 113 | params = super()._getTemplateParams(email, recipient) |
714 | 114 | email, recipient) | ||
716 | 115 | params.update({ | 114 | params.update({ |
717 | 116 | "archive_tag": build.archive.reference, | 115 | "archive_tag": build.archive.reference, |
718 | 117 | "build_id": build.id, | 116 | "build_id": build.id, |
719 | diff --git a/lib/lp/snappy/model/snap.py b/lib/lp/snappy/model/snap.py | |||
720 | index 6798eb2..f6251d9 100644 | |||
721 | --- a/lib/lp/snappy/model/snap.py | |||
722 | +++ b/lib/lp/snappy/model/snap.py | |||
723 | @@ -426,7 +426,7 @@ class Snap(Storm, WebhookTargetMixin): | |||
724 | 426 | store_upload=False, store_series=None, store_name=None, | 426 | store_upload=False, store_series=None, store_name=None, |
725 | 427 | store_secrets=None, store_channels=None, project=None): | 427 | store_secrets=None, store_channels=None, project=None): |
726 | 428 | """Construct a `Snap`.""" | 428 | """Construct a `Snap`.""" |
728 | 429 | super(Snap, self).__init__() | 429 | super().__init__() |
729 | 430 | 430 | ||
730 | 431 | # Set the information type first so that other validators can perform | 431 | # Set the information type first so that other validators can perform |
731 | 432 | # suitable privacy checks, but pillar should also be set, since it's | 432 | # suitable privacy checks, but pillar should also be set, since it's |
732 | diff --git a/lib/lp/snappy/model/snapbase.py b/lib/lp/snappy/model/snapbase.py | |||
733 | index 1ad5c25..7577c81 100644 | |||
734 | --- a/lib/lp/snappy/model/snapbase.py | |||
735 | +++ b/lib/lp/snappy/model/snapbase.py | |||
736 | @@ -8,7 +8,6 @@ __all__ = [ | |||
737 | 8 | ] | 8 | ] |
738 | 9 | 9 | ||
739 | 10 | import pytz | 10 | import pytz |
740 | 11 | import six | ||
741 | 12 | from storm.locals import ( | 11 | from storm.locals import ( |
742 | 13 | Bool, | 12 | Bool, |
743 | 14 | DateTime, | 13 | DateTime, |
744 | @@ -74,7 +73,7 @@ class SnapBase(Storm): | |||
745 | 74 | 73 | ||
746 | 75 | def __init__(self, registrant, name, display_name, distro_series, | 74 | def __init__(self, registrant, name, display_name, distro_series, |
747 | 76 | build_channels, date_created=DEFAULT): | 75 | build_channels, date_created=DEFAULT): |
749 | 77 | super(SnapBase, self).__init__() | 76 | super().__init__() |
750 | 78 | self.registrant = registrant | 77 | self.registrant = registrant |
751 | 79 | self.name = name | 78 | self.name = name |
752 | 80 | self.display_name = display_name | 79 | self.display_name = display_name |
753 | @@ -145,7 +144,7 @@ class SnapBase(Storm): | |||
754 | 145 | 144 | ||
755 | 146 | def _addArchiveDependency(self, dependency, pocket, component=None): | 145 | def _addArchiveDependency(self, dependency, pocket, component=None): |
756 | 147 | """See `ISnapBase`.""" | 146 | """See `ISnapBase`.""" |
758 | 148 | if isinstance(component, six.text_type): | 147 | if isinstance(component, str): |
759 | 149 | try: | 148 | try: |
760 | 150 | component = getUtility(IComponentSet)[component] | 149 | component = getUtility(IComponentSet)[component] |
761 | 151 | except NotFoundError as e: | 150 | except NotFoundError as e: |
762 | diff --git a/lib/lp/snappy/model/snapbuild.py b/lib/lp/snappy/model/snapbuild.py | |||
763 | index 31955e9..a4405de 100644 | |||
764 | --- a/lib/lp/snappy/model/snapbuild.py | |||
765 | +++ b/lib/lp/snappy/model/snapbuild.py | |||
766 | @@ -123,7 +123,7 @@ class SnapFile(Storm): | |||
767 | 123 | 123 | ||
768 | 124 | def __init__(self, snapbuild, libraryfile): | 124 | def __init__(self, snapbuild, libraryfile): |
769 | 125 | """Construct a `SnapFile`.""" | 125 | """Construct a `SnapFile`.""" |
771 | 126 | super(SnapFile, self).__init__() | 126 | super().__init__() |
772 | 127 | self.snapbuild = snapbuild | 127 | self.snapbuild = snapbuild |
773 | 128 | self.libraryfile = libraryfile | 128 | self.libraryfile = libraryfile |
774 | 129 | 129 | ||
775 | @@ -199,7 +199,7 @@ class SnapBuild(PackageBuildMixin, Storm): | |||
776 | 199 | processor, virtualized, date_created, | 199 | processor, virtualized, date_created, |
777 | 200 | store_upload_metadata=None, build_request=None): | 200 | store_upload_metadata=None, build_request=None): |
778 | 201 | """Construct a `SnapBuild`.""" | 201 | """Construct a `SnapBuild`.""" |
780 | 202 | super(SnapBuild, self).__init__() | 202 | super().__init__() |
781 | 203 | self.build_farm_job = build_farm_job | 203 | self.build_farm_job = build_farm_job |
782 | 204 | self.requester = requester | 204 | self.requester = requester |
783 | 205 | self.snap = snap | 205 | self.snap = snap |
784 | @@ -416,7 +416,7 @@ class SnapBuild(PackageBuildMixin, Storm): | |||
785 | 416 | force_invalid_transition=False): | 416 | force_invalid_transition=False): |
786 | 417 | """See `IBuildFarmJob`.""" | 417 | """See `IBuildFarmJob`.""" |
787 | 418 | old_status = self.status | 418 | old_status = self.status |
789 | 419 | super(SnapBuild, self).updateStatus( | 419 | super().updateStatus( |
790 | 420 | status, builder=builder, slave_status=slave_status, | 420 | status, builder=builder, slave_status=slave_status, |
791 | 421 | date_started=date_started, date_finished=date_finished, | 421 | date_started=date_started, date_finished=date_finished, |
792 | 422 | force_invalid_transition=force_invalid_transition) | 422 | force_invalid_transition=force_invalid_transition) |
793 | diff --git a/lib/lp/snappy/model/snapbuildbehaviour.py b/lib/lp/snappy/model/snapbuildbehaviour.py | |||
794 | index cfbf645..a136e58 100644 | |||
795 | --- a/lib/lp/snappy/model/snapbuildbehaviour.py | |||
796 | +++ b/lib/lp/snappy/model/snapbuildbehaviour.py | |||
797 | @@ -106,8 +106,7 @@ class SnapBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase): | |||
798 | 106 | Return the extra arguments required by the slave for the given build. | 106 | Return the extra arguments required by the slave for the given build. |
799 | 107 | """ | 107 | """ |
800 | 108 | build = self.build | 108 | build = self.build |
803 | 109 | args = yield super(SnapBuildBehaviour, self).extraBuildArgs( | 109 | args = yield super().extraBuildArgs(logger=logger) |
802 | 110 | logger=logger) | ||
804 | 111 | yield self.addProxyArgs(args, build.snap.allow_internet) | 110 | yield self.addProxyArgs(args, build.snap.allow_internet) |
805 | 112 | args["name"] = build.snap.store_name or build.snap.name | 111 | args["name"] = build.snap.store_name or build.snap.name |
806 | 113 | channels = build.channels or {} | 112 | channels = build.channels or {} |
807 | diff --git a/lib/lp/snappy/model/snapbuildjob.py b/lib/lp/snappy/model/snapbuildjob.py | |||
808 | index 55d219b..7888c90 100644 | |||
809 | --- a/lib/lp/snappy/model/snapbuildjob.py | |||
810 | +++ b/lib/lp/snappy/model/snapbuildjob.py | |||
811 | @@ -101,7 +101,7 @@ class SnapBuildJob(StormBase): | |||
812 | 101 | :param metadata: The type-specific variables, as a JSON-compatible | 101 | :param metadata: The type-specific variables, as a JSON-compatible |
813 | 102 | dict. | 102 | dict. |
814 | 103 | """ | 103 | """ |
816 | 104 | super(SnapBuildJob, self).__init__() | 104 | super().__init__() |
817 | 105 | self.job = Job(**job_args) | 105 | self.job = Job(**job_args) |
818 | 106 | self.snapbuild = snapbuild | 106 | self.snapbuild = snapbuild |
819 | 107 | self.job_type = job_type | 107 | self.job_type = job_type |
820 | @@ -152,7 +152,7 @@ class SnapBuildJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): | |||
821 | 152 | 152 | ||
822 | 153 | def getOopsVars(self): | 153 | def getOopsVars(self): |
823 | 154 | """See `IRunnableJob`.""" | 154 | """See `IRunnableJob`.""" |
825 | 155 | oops_vars = super(SnapBuildJobDerived, self).getOopsVars() | 155 | oops_vars = super().getOopsVars() |
826 | 156 | oops_vars.extend([ | 156 | oops_vars.extend([ |
827 | 157 | ('job_id', self.context.job.id), | 157 | ('job_id', self.context.job.id), |
828 | 158 | ('job_type', self.context.job_type.title), | 158 | ('job_type', self.context.job_type.title), |
829 | @@ -291,7 +291,7 @@ class SnapStoreUploadJob(SnapBuildJobDerived): | |||
830 | 291 | def _do_lifecycle(self, method_name, manage_transaction=False, | 291 | def _do_lifecycle(self, method_name, manage_transaction=False, |
831 | 292 | *args, **kwargs): | 292 | *args, **kwargs): |
832 | 293 | old_store_upload_status = self.snapbuild.store_upload_status | 293 | old_store_upload_status = self.snapbuild.store_upload_status |
834 | 294 | getattr(super(SnapStoreUploadJob, self), method_name)( | 294 | getattr(super(), method_name)( |
835 | 295 | *args, manage_transaction=manage_transaction, **kwargs) | 295 | *args, manage_transaction=manage_transaction, **kwargs) |
836 | 296 | if self.snapbuild.store_upload_status != old_store_upload_status: | 296 | if self.snapbuild.store_upload_status != old_store_upload_status: |
837 | 297 | notify(SnapBuildStoreUploadStatusChangedEvent(self.snapbuild)) | 297 | notify(SnapBuildStoreUploadStatusChangedEvent(self.snapbuild)) |
838 | @@ -318,7 +318,7 @@ class SnapStoreUploadJob(SnapBuildJobDerived): | |||
839 | 318 | 318 | ||
840 | 319 | def getOopsVars(self): | 319 | def getOopsVars(self): |
841 | 320 | """See `IRunnableJob`.""" | 320 | """See `IRunnableJob`.""" |
843 | 321 | oops_vars = super(SnapStoreUploadJob, self).getOopsVars() | 321 | oops_vars = super().getOopsVars() |
844 | 322 | oops_vars.append(('error_detail', self.error_detail)) | 322 | oops_vars.append(('error_detail', self.error_detail)) |
845 | 323 | return oops_vars | 323 | return oops_vars |
846 | 324 | 324 | ||
847 | diff --git a/lib/lp/snappy/model/snapjob.py b/lib/lp/snappy/model/snapjob.py | |||
848 | index bf16b2d..c84f823 100644 | |||
849 | --- a/lib/lp/snappy/model/snapjob.py | |||
850 | +++ b/lib/lp/snappy/model/snapjob.py | |||
851 | @@ -106,7 +106,7 @@ class SnapJob(StormBase): | |||
852 | 106 | :param metadata: The type-specific variables, as a JSON-compatible | 106 | :param metadata: The type-specific variables, as a JSON-compatible |
853 | 107 | dict. | 107 | dict. |
854 | 108 | """ | 108 | """ |
856 | 109 | super(SnapJob, self).__init__() | 109 | super().__init__() |
857 | 110 | self.job = Job(**job_args) | 110 | self.job = Job(**job_args) |
858 | 111 | self.snap = snap | 111 | self.snap = snap |
859 | 112 | self.job_type = job_type | 112 | self.job_type = job_type |
860 | @@ -155,7 +155,7 @@ class SnapJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass): | |||
861 | 155 | 155 | ||
862 | 156 | def getOopsVars(self): | 156 | def getOopsVars(self): |
863 | 157 | """See `IRunnableJob`.""" | 157 | """See `IRunnableJob`.""" |
865 | 158 | oops_vars = super(SnapJobDerived, self).getOopsVars() | 158 | oops_vars = super().getOopsVars() |
866 | 159 | oops_vars.extend([ | 159 | oops_vars.extend([ |
867 | 160 | ("job_id", self.context.job.id), | 160 | ("job_id", self.context.job.id), |
868 | 161 | ("job_type", self.context.job_type.title), | 161 | ("job_type", self.context.job_type.title), |
869 | diff --git a/lib/lp/snappy/model/snappyseries.py b/lib/lp/snappy/model/snappyseries.py | |||
870 | index 52de880..50cef2a 100644 | |||
871 | --- a/lib/lp/snappy/model/snappyseries.py | |||
872 | +++ b/lib/lp/snappy/model/snappyseries.py | |||
873 | @@ -65,7 +65,7 @@ class SnappySeries(Storm): | |||
874 | 65 | 65 | ||
875 | 66 | def __init__(self, registrant, name, display_name, status, | 66 | def __init__(self, registrant, name, display_name, status, |
876 | 67 | preferred_distro_series=None, date_created=DEFAULT): | 67 | preferred_distro_series=None, date_created=DEFAULT): |
878 | 68 | super(SnappySeries, self).__init__() | 68 | super().__init__() |
879 | 69 | self.registrant = registrant | 69 | self.registrant = registrant |
880 | 70 | self.name = name | 70 | self.name = name |
881 | 71 | self.display_name = display_name | 71 | self.display_name = display_name |
882 | @@ -207,7 +207,7 @@ class SnappyDistroSeries(Storm, SnappyDistroSeriesMixin): | |||
883 | 207 | preferred = Bool(name='preferred', allow_none=False) | 207 | preferred = Bool(name='preferred', allow_none=False) |
884 | 208 | 208 | ||
885 | 209 | def __init__(self, snappy_series, distro_series, preferred=False): | 209 | def __init__(self, snappy_series, distro_series, preferred=False): |
887 | 210 | super(SnappyDistroSeries, self).__init__() | 210 | super().__init__() |
888 | 211 | self.snappy_series = snappy_series | 211 | self.snappy_series = snappy_series |
889 | 212 | self.distro_series = distro_series | 212 | self.distro_series = distro_series |
890 | 213 | self.preferred = preferred | 213 | self.preferred = preferred |
891 | diff --git a/lib/lp/snappy/model/snapstoreclient.py b/lib/lp/snappy/model/snapstoreclient.py | |||
892 | index a288a35..e5900fc 100644 | |||
893 | --- a/lib/lp/snappy/model/snapstoreclient.py | |||
894 | +++ b/lib/lp/snappy/model/snapstoreclient.py | |||
895 | @@ -398,7 +398,7 @@ class SnapStoreClient: | |||
896 | 398 | channels = memcache_client.get_json(memcache_key, log, description) | 398 | channels = memcache_client.get_json(memcache_key, log, description) |
897 | 399 | 399 | ||
898 | 400 | if (channels is None and | 400 | if (channels is None and |
900 | 401 | not getFeatureFlag(u"snap.disable_channel_search")): | 401 | not getFeatureFlag("snap.disable_channel_search")): |
901 | 402 | path = "api/v1/channels" | 402 | path = "api/v1/channels" |
902 | 403 | timeline = cls._getTimeline() | 403 | timeline = cls._getTimeline() |
903 | 404 | if timeline is not None: | 404 | if timeline is not None: |
904 | diff --git a/lib/lp/snappy/model/snapsubscription.py b/lib/lp/snappy/model/snapsubscription.py | |||
905 | index fd36b12..4384cd5 100644 | |||
906 | --- a/lib/lp/snappy/model/snapsubscription.py | |||
907 | +++ b/lib/lp/snappy/model/snapsubscription.py | |||
908 | @@ -44,7 +44,7 @@ class SnapSubscription(StormBase): | |||
909 | 44 | subscribed_by = Reference(subscribed_by_id, "Person.id") | 44 | subscribed_by = Reference(subscribed_by_id, "Person.id") |
910 | 45 | 45 | ||
911 | 46 | def __init__(self, snap, person, subscribed_by): | 46 | def __init__(self, snap, person, subscribed_by): |
913 | 47 | super(SnapSubscription, self).__init__() | 47 | super().__init__() |
914 | 48 | self.snap = snap | 48 | self.snap = snap |
915 | 49 | self.person = person | 49 | self.person = person |
916 | 50 | self.subscribed_by = subscribed_by | 50 | self.subscribed_by = subscribed_by |
917 | diff --git a/lib/lp/snappy/tests/test_snap.py b/lib/lp/snappy/tests/test_snap.py | |||
918 | index 08ce35b..178c4fc 100644 | |||
919 | --- a/lib/lp/snappy/tests/test_snap.py | |||
920 | +++ b/lib/lp/snappy/tests/test_snap.py | |||
921 | @@ -186,7 +186,7 @@ class TestSnap(TestCaseWithFactory): | |||
922 | 186 | layer = DatabaseFunctionalLayer | 186 | layer = DatabaseFunctionalLayer |
923 | 187 | 187 | ||
924 | 188 | def setUp(self): | 188 | def setUp(self): |
926 | 189 | super(TestSnap, self).setUp() | 189 | super().setUp() |
927 | 190 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 190 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
928 | 191 | 191 | ||
929 | 192 | def test_implements_interfaces(self): | 192 | def test_implements_interfaces(self): |
930 | @@ -1391,7 +1391,7 @@ class TestSnapDeleteWithBuilds(TestCaseWithFactory): | |||
931 | 1391 | layer = LaunchpadFunctionalLayer | 1391 | layer = LaunchpadFunctionalLayer |
932 | 1392 | 1392 | ||
933 | 1393 | def setUp(self): | 1393 | def setUp(self): |
935 | 1394 | super(TestSnapDeleteWithBuilds, self).setUp() | 1394 | super().setUp() |
936 | 1395 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 1395 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
937 | 1396 | 1396 | ||
938 | 1397 | def test_delete_with_builds(self): | 1397 | def test_delete_with_builds(self): |
939 | @@ -1507,7 +1507,7 @@ class TestSnapVisibility(TestCaseWithFactory): | |||
940 | 1507 | layer = DatabaseFunctionalLayer | 1507 | layer = DatabaseFunctionalLayer |
941 | 1508 | 1508 | ||
942 | 1509 | def setUp(self): | 1509 | def setUp(self): |
944 | 1510 | super(TestSnapVisibility, self).setUp() | 1510 | super().setUp() |
945 | 1511 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 1511 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
946 | 1512 | 1512 | ||
947 | 1513 | def getSnapGrants(self, snap, person=None): | 1513 | def getSnapGrants(self, snap, person=None): |
948 | @@ -1654,7 +1654,7 @@ class TestSnapSet(TestCaseWithFactory): | |||
949 | 1654 | layer = DatabaseFunctionalLayer | 1654 | layer = DatabaseFunctionalLayer |
950 | 1655 | 1655 | ||
951 | 1656 | def setUp(self): | 1656 | def setUp(self): |
953 | 1657 | super(TestSnapSet, self).setUp() | 1657 | super().setUp() |
954 | 1658 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 1658 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
955 | 1659 | 1659 | ||
956 | 1660 | def test_class_implements_interfaces(self): | 1660 | def test_class_implements_interfaces(self): |
957 | @@ -1891,7 +1891,7 @@ class TestSnapSet(TestCaseWithFactory): | |||
958 | 1891 | self.assertContentEqual(snaps[3:], snap_set.findByPerson(owners[1])) | 1891 | self.assertContentEqual(snaps[3:], snap_set.findByPerson(owners[1])) |
959 | 1892 | 1892 | ||
960 | 1893 | def test_get_snap_privacy_filter_includes_grants(self): | 1893 | def test_get_snap_privacy_filter_includes_grants(self): |
962 | 1894 | grantee, creator = [self.factory.makePerson() for i in range(2)] | 1894 | grantee, creator = (self.factory.makePerson() for i in range(2)) |
963 | 1895 | # All snaps are owned by "creator", and "grantee" will later have | 1895 | # All snaps are owned by "creator", and "grantee" will later have |
964 | 1896 | # access granted using sharing service. | 1896 | # access granted using sharing service. |
965 | 1897 | snap_data = dict(registrant=creator, owner=creator, private=True) | 1897 | snap_data = dict(registrant=creator, owner=creator, private=True) |
966 | @@ -2763,7 +2763,7 @@ class TestSnapProcessors(TestCaseWithFactory): | |||
967 | 2763 | layer = LaunchpadFunctionalLayer | 2763 | layer = LaunchpadFunctionalLayer |
968 | 2764 | 2764 | ||
969 | 2765 | def setUp(self): | 2765 | def setUp(self): |
971 | 2766 | super(TestSnapProcessors, self).setUp(user="foo.bar@canonical.com") | 2766 | super().setUp(user="foo.bar@canonical.com") |
972 | 2767 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 2767 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
973 | 2768 | self.default_procs = [ | 2768 | self.default_procs = [ |
974 | 2769 | getUtility(IProcessorSet).getByName("386"), | 2769 | getUtility(IProcessorSet).getByName("386"), |
975 | @@ -2880,7 +2880,7 @@ class TestSnapWebservice(TestCaseWithFactory): | |||
976 | 2880 | layer = LaunchpadFunctionalLayer | 2880 | layer = LaunchpadFunctionalLayer |
977 | 2881 | 2881 | ||
978 | 2882 | def setUp(self): | 2882 | def setUp(self): |
980 | 2883 | super(TestSnapWebservice, self).setUp() | 2883 | super().setUp() |
981 | 2884 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 2884 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
982 | 2885 | self.snap_store_client = FakeMethod() | 2885 | self.snap_store_client = FakeMethod() |
983 | 2886 | self.snap_store_client.listChannels = FakeMethod(result=[ | 2886 | self.snap_store_client.listChannels = FakeMethod(result=[ |
984 | diff --git a/lib/lp/snappy/tests/test_snapbase.py b/lib/lp/snappy/tests/test_snapbase.py | |||
985 | index 88bf5ff..a5de6f2 100644 | |||
986 | --- a/lib/lp/snappy/tests/test_snapbase.py | |||
987 | +++ b/lib/lp/snappy/tests/test_snapbase.py | |||
988 | @@ -80,7 +80,7 @@ class TestSnapBaseProcessors(TestCaseWithFactory): | |||
989 | 80 | layer = ZopelessDatabaseLayer | 80 | layer = ZopelessDatabaseLayer |
990 | 81 | 81 | ||
991 | 82 | def setUp(self): | 82 | def setUp(self): |
993 | 83 | super(TestSnapBaseProcessors, self).setUp(user="foo.bar@canonical.com") | 83 | super().setUp(user="foo.bar@canonical.com") |
994 | 84 | self.unrestricted_procs = [ | 84 | self.unrestricted_procs = [ |
995 | 85 | self.factory.makeProcessor() for _ in range(3)] | 85 | self.factory.makeProcessor() for _ in range(3)] |
996 | 86 | self.restricted_procs = [ | 86 | self.restricted_procs = [ |
997 | diff --git a/lib/lp/snappy/tests/test_snapbuild.py b/lib/lp/snappy/tests/test_snapbuild.py | |||
998 | index 9ed98cb..639893f 100644 | |||
999 | --- a/lib/lp/snappy/tests/test_snapbuild.py | |||
1000 | +++ b/lib/lp/snappy/tests/test_snapbuild.py | |||
1001 | @@ -100,7 +100,7 @@ class TestSnapBuild(TestCaseWithFactory): | |||
1002 | 100 | layer = LaunchpadZopelessLayer | 100 | layer = LaunchpadZopelessLayer |
1003 | 101 | 101 | ||
1004 | 102 | def setUp(self): | 102 | def setUp(self): |
1006 | 103 | super(TestSnapBuild, self).setUp() | 103 | super().setUp() |
1007 | 104 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 104 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1008 | 105 | self.pushConfig( | 105 | self.pushConfig( |
1009 | 106 | "snappy", store_url="http://sca.example/", | 106 | "snappy", store_url="http://sca.example/", |
1010 | @@ -700,7 +700,7 @@ class TestSnapBuildSet(TestCaseWithFactory): | |||
1011 | 700 | layer = LaunchpadZopelessLayer | 700 | layer = LaunchpadZopelessLayer |
1012 | 701 | 701 | ||
1013 | 702 | def setUp(self): | 702 | def setUp(self): |
1015 | 703 | super(TestSnapBuildSet, self).setUp() | 703 | super().setUp() |
1016 | 704 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 704 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1017 | 705 | 705 | ||
1018 | 706 | def test_getByBuildFarmJob_works(self): | 706 | def test_getByBuildFarmJob_works(self): |
1019 | @@ -731,7 +731,7 @@ class TestSnapBuildWebservice(TestCaseWithFactory): | |||
1020 | 731 | layer = LaunchpadFunctionalLayer | 731 | layer = LaunchpadFunctionalLayer |
1021 | 732 | 732 | ||
1022 | 733 | def setUp(self): | 733 | def setUp(self): |
1024 | 734 | super(TestSnapBuildWebservice, self).setUp() | 734 | super().setUp() |
1025 | 735 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 735 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1026 | 736 | self.person = self.factory.makePerson() | 736 | self.person = self.factory.makePerson() |
1027 | 737 | self.webservice = webservice_for_person( | 737 | self.webservice = webservice_for_person( |
1028 | @@ -897,7 +897,7 @@ class TestSnapBuildMacaroonIssuer(MacaroonTestMixin, TestCaseWithFactory): | |||
1029 | 897 | layer = LaunchpadZopelessLayer | 897 | layer = LaunchpadZopelessLayer |
1030 | 898 | 898 | ||
1031 | 899 | def setUp(self): | 899 | def setUp(self): |
1033 | 900 | super(TestSnapBuildMacaroonIssuer, self).setUp() | 900 | super().setUp() |
1034 | 901 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 901 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1035 | 902 | self.pushConfig( | 902 | self.pushConfig( |
1036 | 903 | "launchpad", internal_macaroon_secret_key="some-secret") | 903 | "launchpad", internal_macaroon_secret_key="some-secret") |
1037 | diff --git a/lib/lp/snappy/tests/test_snapbuildbehaviour.py b/lib/lp/snappy/tests/test_snapbuildbehaviour.py | |||
1038 | index dbd91e7..fc2d5a8 100644 | |||
1039 | --- a/lib/lp/snappy/tests/test_snapbuildbehaviour.py | |||
1040 | +++ b/lib/lp/snappy/tests/test_snapbuildbehaviour.py | |||
1041 | @@ -125,7 +125,7 @@ class TestSnapBuildBehaviourBase(TestCaseWithFactory): | |||
1042 | 125 | layer = LaunchpadZopelessLayer | 125 | layer = LaunchpadZopelessLayer |
1043 | 126 | 126 | ||
1044 | 127 | def setUp(self): | 127 | def setUp(self): |
1046 | 128 | super(TestSnapBuildBehaviourBase, self).setUp() | 128 | super().setUp() |
1047 | 129 | self.pushConfig("snappy", tools_source=None, tools_fingerprint=None) | 129 | self.pushConfig("snappy", tools_source=None, tools_fingerprint=None) |
1048 | 130 | 130 | ||
1049 | 131 | def makeJob(self, archive=None, pocket=PackagePublishingPocket.UPDATES, | 131 | def makeJob(self, archive=None, pocket=PackagePublishingPocket.UPDATES, |
1050 | @@ -251,7 +251,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase): | |||
1051 | 251 | 251 | ||
1052 | 252 | @defer.inlineCallbacks | 252 | @defer.inlineCallbacks |
1053 | 253 | def setUp(self): | 253 | def setUp(self): |
1055 | 254 | super(TestAsyncSnapBuildBehaviour, self).setUp() | 254 | super().setUp() |
1056 | 255 | build_username = 'SNAPBUILD-1' | 255 | build_username = 'SNAPBUILD-1' |
1057 | 256 | self.token = {'secret': uuid.uuid4().hex, | 256 | self.token = {'secret': uuid.uuid4().hex, |
1058 | 257 | 'username': build_username, | 257 | 'username': build_username, |
1059 | @@ -273,7 +273,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase): | |||
1060 | 273 | def makeJob(self, **kwargs): | 273 | def makeJob(self, **kwargs): |
1061 | 274 | # We need a builder slave in these tests, in order that requesting a | 274 | # We need a builder slave in these tests, in order that requesting a |
1062 | 275 | # proxy token can piggyback on its reactor and pool. | 275 | # proxy token can piggyback on its reactor and pool. |
1064 | 276 | job = super(TestAsyncSnapBuildBehaviour, self).makeJob(**kwargs) | 276 | job = super().makeJob(**kwargs) |
1065 | 277 | builder = MockBuilder() | 277 | builder = MockBuilder() |
1066 | 278 | builder.processor = job.build.processor | 278 | builder.processor = job.build.processor |
1067 | 279 | slave = self.useFixture(SlaveTestHelpers()).getClientSlave() | 279 | slave = self.useFixture(SlaveTestHelpers()).getClientSlave() |
1068 | diff --git a/lib/lp/snappy/tests/test_snapbuildjob.py b/lib/lp/snappy/tests/test_snapbuildjob.py | |||
1069 | index 1918da5..e0c485e 100644 | |||
1070 | --- a/lib/lp/snappy/tests/test_snapbuildjob.py | |||
1071 | +++ b/lib/lp/snappy/tests/test_snapbuildjob.py | |||
1072 | @@ -95,7 +95,7 @@ class TestSnapBuildJob(TestCaseWithFactory): | |||
1073 | 95 | layer = DatabaseFunctionalLayer | 95 | layer = DatabaseFunctionalLayer |
1074 | 96 | 96 | ||
1075 | 97 | def setUp(self): | 97 | def setUp(self): |
1077 | 98 | super(TestSnapBuildJob, self).setUp() | 98 | super().setUp() |
1078 | 99 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 99 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1079 | 100 | 100 | ||
1080 | 101 | def test_provides_interface(self): | 101 | def test_provides_interface(self): |
1081 | @@ -111,7 +111,7 @@ class TestSnapStoreUploadJob(TestCaseWithFactory): | |||
1082 | 111 | layer = LaunchpadZopelessLayer | 111 | layer = LaunchpadZopelessLayer |
1083 | 112 | 112 | ||
1084 | 113 | def setUp(self): | 113 | def setUp(self): |
1086 | 114 | super(TestSnapStoreUploadJob, self).setUp() | 114 | super().setUp() |
1087 | 115 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 115 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1088 | 116 | self.status_url = "http://sca.example/dev/api/snaps/1/builds/1/status" | 116 | self.status_url = "http://sca.example/dev/api/snaps/1/builds/1/status" |
1089 | 117 | self.store_url = "http://sca.example/dev/click-apps/1/rev/1/" | 117 | self.store_url = "http://sca.example/dev/click-apps/1/rev/1/" |
1090 | diff --git a/lib/lp/snappy/tests/test_snappyseries.py b/lib/lp/snappy/tests/test_snappyseries.py | |||
1091 | index cfdf194..7d4e64c 100644 | |||
1092 | --- a/lib/lp/snappy/tests/test_snappyseries.py | |||
1093 | +++ b/lib/lp/snappy/tests/test_snappyseries.py | |||
1094 | @@ -43,7 +43,7 @@ class TestSnappySeries(TestCaseWithFactory): | |||
1095 | 43 | layer = ZopelessDatabaseLayer | 43 | layer = ZopelessDatabaseLayer |
1096 | 44 | 44 | ||
1097 | 45 | def setUp(self): | 45 | def setUp(self): |
1099 | 46 | super(TestSnappySeries, self).setUp() | 46 | super().setUp() |
1100 | 47 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 47 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1101 | 48 | 48 | ||
1102 | 49 | def test_implements_interface(self): | 49 | def test_implements_interface(self): |
1103 | @@ -108,7 +108,7 @@ class TestSnappySeriesSet(TestCaseWithFactory): | |||
1104 | 108 | layer = ZopelessDatabaseLayer | 108 | layer = ZopelessDatabaseLayer |
1105 | 109 | 109 | ||
1106 | 110 | def setUp(self): | 110 | def setUp(self): |
1108 | 111 | super(TestSnappySeriesSet, self).setUp() | 111 | super().setUp() |
1109 | 112 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 112 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1110 | 113 | 113 | ||
1111 | 114 | def test_getByName(self): | 114 | def test_getByName(self): |
1112 | @@ -132,7 +132,7 @@ class TestSnappySeriesWebservice(TestCaseWithFactory): | |||
1113 | 132 | layer = DatabaseFunctionalLayer | 132 | layer = DatabaseFunctionalLayer |
1114 | 133 | 133 | ||
1115 | 134 | def setUp(self): | 134 | def setUp(self): |
1117 | 135 | super(TestSnappySeriesWebservice, self).setUp() | 135 | super().setUp() |
1118 | 136 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 136 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1119 | 137 | 137 | ||
1120 | 138 | def test_new_unpriv(self): | 138 | def test_new_unpriv(self): |
1121 | @@ -234,7 +234,7 @@ class TestSnappyDistroSeriesSet(TestCaseWithFactory): | |||
1122 | 234 | layer = ZopelessDatabaseLayer | 234 | layer = ZopelessDatabaseLayer |
1123 | 235 | 235 | ||
1124 | 236 | def setUp(self): | 236 | def setUp(self): |
1126 | 237 | super(TestSnappyDistroSeriesSet, self).setUp() | 237 | super().setUp() |
1127 | 238 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 238 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1128 | 239 | 239 | ||
1129 | 240 | def test_getByBothSeries(self): | 240 | def test_getByBothSeries(self): |
1130 | diff --git a/lib/lp/snappy/tests/test_snapstoreclient.py b/lib/lp/snappy/tests/test_snapstoreclient.py | |||
1131 | index 66e446b..b4bd3ea 100644 | |||
1132 | --- a/lib/lp/snappy/tests/test_snapstoreclient.py | |||
1133 | +++ b/lib/lp/snappy/tests/test_snapstoreclient.py | |||
1134 | @@ -213,7 +213,7 @@ class TestSnapStoreClient(TestCaseWithFactory): | |||
1135 | 213 | layer = LaunchpadZopelessLayer | 213 | layer = LaunchpadZopelessLayer |
1136 | 214 | 214 | ||
1137 | 215 | def setUp(self): | 215 | def setUp(self): |
1139 | 216 | super(TestSnapStoreClient, self).setUp() | 216 | super().setUp() |
1140 | 217 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) | 217 | self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS)) |
1141 | 218 | self.pushConfig( | 218 | self.pushConfig( |
1142 | 219 | "snappy", store_url="http://sca.example/", | 219 | "snappy", store_url="http://sca.example/", |
1143 | @@ -769,7 +769,7 @@ class TestSnapStoreClient(TestCaseWithFactory): | |||
1144 | 769 | @responses.activate | 769 | @responses.activate |
1145 | 770 | def test_listChannels_disable_search(self): | 770 | def test_listChannels_disable_search(self): |
1146 | 771 | self.useFixture( | 771 | self.useFixture( |
1148 | 772 | FeatureFixture({u"snap.disable_channel_search": u"on"})) | 772 | FeatureFixture({"snap.disable_channel_search": "on"})) |
1149 | 773 | expected_channels = [ | 773 | expected_channels = [ |
1150 | 774 | {"name": "candidate", "display_name": "Candidate"}, | 774 | {"name": "candidate", "display_name": "Candidate"}, |
1151 | 775 | {"name": "edge", "display_name": "Edge"}, | 775 | {"name": "edge", "display_name": "Edge"}, |
1152 | diff --git a/lib/lp/snappy/tests/test_snapvocabularies.py b/lib/lp/snappy/tests/test_snapvocabularies.py | |||
1153 | index bac4756..942b5c6 100644 | |||
1154 | --- a/lib/lp/snappy/tests/test_snapvocabularies.py | |||
1155 | +++ b/lib/lp/snappy/tests/test_snapvocabularies.py | |||
1156 | @@ -15,7 +15,7 @@ class TestSnappyDistroSeriesVocabulary(TestCaseWithFactory): | |||
1157 | 15 | layer = ZopelessDatabaseLayer | 15 | layer = ZopelessDatabaseLayer |
1158 | 16 | 16 | ||
1159 | 17 | def setUp(self): | 17 | def setUp(self): |
1161 | 18 | super(TestSnappyDistroSeriesVocabulary, self).setUp() | 18 | super().setUp() |
1162 | 19 | self.vocab = SnappyDistroSeriesVocabulary() | 19 | self.vocab = SnappyDistroSeriesVocabulary() |
1163 | 20 | 20 | ||
1164 | 21 | def test_getTermByToken(self): | 21 | def test_getTermByToken(self): |
1165 | diff --git a/lib/lp/snappy/validators/tests/test_channels.py b/lib/lp/snappy/validators/tests/test_channels.py | |||
1166 | index e2da963..02b19ad 100644 | |||
1167 | --- a/lib/lp/snappy/validators/tests/test_channels.py | |||
1168 | +++ b/lib/lp/snappy/validators/tests/test_channels.py | |||
1169 | @@ -18,7 +18,7 @@ class TestChannelsValidator(TestCaseWithFactory): | |||
1170 | 18 | layer = LaunchpadFunctionalLayer | 18 | layer = LaunchpadFunctionalLayer |
1171 | 19 | 19 | ||
1172 | 20 | def setUp(self): | 20 | def setUp(self): |
1174 | 21 | super(TestChannelsValidator, self).setUp() | 21 | super().setUp() |
1175 | 22 | self.risks = [ | 22 | self.risks = [ |
1176 | 23 | {"name": "stable", "display_name": "Stable"}, | 23 | {"name": "stable", "display_name": "Stable"}, |
1177 | 24 | {"name": "candidate", "display_name": "Candidate"}, | 24 | {"name": "candidate", "display_name": "Candidate"}, |
1178 | diff --git a/lib/lp/snappy/vocabularies.py b/lib/lp/snappy/vocabularies.py | |||
1179 | index 6fa31a9..8a22a9c 100644 | |||
1180 | --- a/lib/lp/snappy/vocabularies.py | |||
1181 | +++ b/lib/lp/snappy/vocabularies.py | |||
1182 | @@ -238,7 +238,7 @@ class SnapStoreChannelVocabulary(SimpleVocabulary): | |||
1183 | 238 | for name in context_channels: | 238 | for name in context_channels: |
1184 | 239 | if name not in known_names: | 239 | if name not in known_names: |
1185 | 240 | terms.append(self.createTerm(name, name, name)) | 240 | terms.append(self.createTerm(name, name, name)) |
1187 | 241 | super(SnapStoreChannelVocabulary, self).__init__(terms) | 241 | super().__init__(terms) |
1188 | 242 | 242 | ||
1189 | 243 | @classmethod | 243 | @classmethod |
1190 | 244 | def createTerm(cls, *args): | 244 | def createTerm(cls, *args): |
Self-approving (mechanical).