Show More
@@ -69,7 +69,7 b' class TestAdminController(object):' | |||
|
69 | 69 | with open(os.path.join(FIXTURES, 'journal_dump.csv')) as f: |
|
70 | 70 | for row in csv.DictReader(f): |
|
71 | 71 | ul = UserLog() |
|
72 |
for k, v in row. |
|
|
72 | for k, v in row.items(): | |
|
73 | 73 | v = safe_unicode(v) |
|
74 | 74 | if k == 'action_date': |
|
75 | 75 | v = strptime(v) |
@@ -236,7 +236,7 b' class TestAdminSettingsGlobal(object):' | |||
|
236 | 236 | assert_session_flash(response, 'Updated application settings') |
|
237 | 237 | app_settings = SettingsModel().get_all_settings() |
|
238 | 238 | del settings['csrf_token'] |
|
239 |
for key, value in settings. |
|
|
239 | for key, value in settings.items(): | |
|
240 | 240 | assert app_settings[key] == value.decode('utf-8') |
|
241 | 241 | |
|
242 | 242 | return response |
@@ -75,7 +75,7 b' class AdminDefaultSettingsView(BaseAppVi' | |||
|
75 | 75 | |
|
76 | 76 | try: |
|
77 | 77 | form_result = form.to_python(dict(self.request.POST)) |
|
78 |
for k, v in form_result. |
|
|
78 | for k, v in form_result.items(): | |
|
79 | 79 | setting = SettingsModel().create_or_update_setting(k, v) |
|
80 | 80 | Session().add(setting) |
|
81 | 81 | Session().commit() |
@@ -128,7 +128,7 b' class RepoSummaryView(RepoAppView):' | |||
|
128 | 128 | |
|
129 | 129 | # Sort first by decreasing count and second by the file extension, |
|
130 | 130 | # so we have a consistent output. |
|
131 |
lang_stats_items = sorted(lang_stats_d. |
|
|
131 | lang_stats_items = sorted(lang_stats_d.items(), | |
|
132 | 132 | key=lambda k: (-k[1], k[0]))[:10] |
|
133 | 133 | lang_stats = [(x, {"count": y, |
|
134 | 134 | "desc": LANGUAGES_EXTENSIONS_MAP.get(x)}) |
@@ -267,7 +267,7 b' class RepoSummaryView(RepoAppView):' | |||
|
267 | 267 | def _create_reference_items(self, repo, full_repo_name, refs, ref_type, format_ref_id): |
|
268 | 268 | result = [] |
|
269 | 269 | is_svn = h.is_svn(repo) |
|
270 |
for ref_name, raw_id in refs. |
|
|
270 | for ref_name, raw_id in refs.items(): | |
|
271 | 271 | files_url = self._create_files_url( |
|
272 | 272 | repo, full_repo_name, ref_name, raw_id, is_svn) |
|
273 | 273 | result.append({ |
@@ -1112,7 +1112,7 b' class AuthUser(object):' | |||
|
1112 | 1112 | k: v for k, v in perms['user_groups'].items() |
|
1113 | 1113 | if v != 'usergroup.none'} |
|
1114 | 1114 | perms['repository_branches'] = { |
|
1115 |
k: v for k, v in perms['repository_branches']. |
|
|
1115 | k: v for k, v in perms['repository_branches'].items() | |
|
1116 | 1116 | if v != 'branch.none'} |
|
1117 | 1117 | return perms |
|
1118 | 1118 |
@@ -192,7 +192,7 b' class ModelGenerator(object):' | |||
|
192 | 192 | downgradeCommands.append( |
|
193 | 193 | "post_meta.tables[%(table)r].drop()" % {'table': tn}) |
|
194 | 194 | |
|
195 |
for (tn, td) in self.diff.tables_different. |
|
|
195 | for (tn, td) in self.diff.tables_different.items(): | |
|
196 | 196 | if td.columns_missing_from_A or td.columns_different: |
|
197 | 197 | pre_table = self.diff.metadataB.tables[tn] |
|
198 | 198 | decls.extend(self._getTableDefn( |
@@ -23,7 +23,7 b' alias = {' | |||
|
23 | 23 | |
|
24 | 24 | def alias_setup(): |
|
25 | 25 | global alias |
|
26 |
for key, val in alias. |
|
|
26 | for key, val in alias.items(): | |
|
27 | 27 | setattr(api, key, val) |
|
28 | 28 | alias_setup() |
|
29 | 29 | |
@@ -135,7 +135,7 b' def main(argv=None, **kwargs):' | |||
|
135 | 135 | override_kwargs[opt] = value |
|
136 | 136 | |
|
137 | 137 | # override kwargs with options if user is overwriting |
|
138 |
for key, value in options.__dict__. |
|
|
138 | for key, value in options.__dict__.items(): | |
|
139 | 139 | if value is not None: |
|
140 | 140 | override_kwargs[key] = value |
|
141 | 141 | |
@@ -143,7 +143,7 b' def main(argv=None, **kwargs):' | |||
|
143 | 143 | f_required = list(f_args) |
|
144 | 144 | candidates = dict(kwargs) |
|
145 | 145 | candidates.update(override_kwargs) |
|
146 |
for key, value in candidates. |
|
|
146 | for key, value in candidates.items(): | |
|
147 | 147 | if key in f_args: |
|
148 | 148 | f_required.remove(key) |
|
149 | 149 | |
@@ -160,7 +160,7 b' def main(argv=None, **kwargs):' | |||
|
160 | 160 | kwargs.update(override_kwargs) |
|
161 | 161 | |
|
162 | 162 | # configure options |
|
163 |
for key, value in options.__dict__. |
|
|
163 | for key, value in options.__dict__.items(): | |
|
164 | 164 | kwargs.setdefault(key, value) |
|
165 | 165 | |
|
166 | 166 | # configure logging |
@@ -131,7 +131,7 b' def construct_engine(engine, **opts):' | |||
|
131 | 131 | kwargs['echo'] = echo |
|
132 | 132 | |
|
133 | 133 | # parse keyword arguments |
|
134 |
for key, value in opts. |
|
|
134 | for key, value in opts.items(): | |
|
135 | 135 | if key.startswith('engine_arg_'): |
|
136 | 136 | kwargs[key[11:]] = guess_obj_type(value) |
|
137 | 137 |
@@ -103,7 +103,7 b' class BaseModel(object):' | |||
|
103 | 103 | d[k] = getattr(self, k) |
|
104 | 104 | |
|
105 | 105 | # also use __json__() if present to get additional fields |
|
106 |
for k, val in getattr(self, '__json__', lambda: {})(). |
|
|
106 | for k, val in getattr(self, '__json__', lambda: {})().items(): | |
|
107 | 107 | d[k] = val |
|
108 | 108 | return d |
|
109 | 109 |
@@ -82,7 +82,7 b' class BaseModel(object):' | |||
|
82 | 82 | # update with attributes from __json__ |
|
83 | 83 | if callable(_json_attr): |
|
84 | 84 | _json_attr = _json_attr() |
|
85 |
for k, val in _json_attr. |
|
|
85 | for k, val in _json_attr.items(): | |
|
86 | 86 | d[k] = val |
|
87 | 87 | return d |
|
88 | 88 |
@@ -83,7 +83,7 b' class BaseModel(object):' | |||
|
83 | 83 | # update with attributes from __json__ |
|
84 | 84 | if callable(_json_attr): |
|
85 | 85 | _json_attr = _json_attr() |
|
86 |
for k, val in _json_attr. |
|
|
86 | for k, val in _json_attr.items(): | |
|
87 | 87 | d[k] = val |
|
88 | 88 | return d |
|
89 | 89 |
@@ -83,7 +83,7 b' class BaseModel(object):' | |||
|
83 | 83 | # update with attributes from __json__ |
|
84 | 84 | if callable(_json_attr): |
|
85 | 85 | _json_attr = _json_attr() |
|
86 |
for k, val in _json_attr. |
|
|
86 | for k, val in _json_attr.items(): | |
|
87 | 87 | d[k] = val |
|
88 | 88 | return d |
|
89 | 89 |
@@ -83,7 +83,7 b' class BaseModel(object):' | |||
|
83 | 83 | # update with attributes from __json__ |
|
84 | 84 | if callable(_json_attr): |
|
85 | 85 | _json_attr = _json_attr() |
|
86 |
for k, val in _json_attr. |
|
|
86 | for k, val in _json_attr.items(): | |
|
87 | 87 | d[k] = val |
|
88 | 88 | return d |
|
89 | 89 |
@@ -83,7 +83,7 b' class BaseModel(object):' | |||
|
83 | 83 | # update with attributes from __json__ |
|
84 | 84 | if callable(_json_attr): |
|
85 | 85 | _json_attr = _json_attr() |
|
86 |
for k, val in _json_attr. |
|
|
86 | for k, val in _json_attr.items(): | |
|
87 | 87 | d[k] = val |
|
88 | 88 | return d |
|
89 | 89 |
@@ -83,7 +83,7 b' class BaseModel(object):' | |||
|
83 | 83 | # update with attributes from __json__ |
|
84 | 84 | if callable(_json_attr): |
|
85 | 85 | _json_attr = _json_attr() |
|
86 |
for k, val in _json_attr. |
|
|
86 | for k, val in _json_attr.items(): | |
|
87 | 87 | d[k] = val |
|
88 | 88 | return d |
|
89 | 89 |
@@ -84,7 +84,7 b' class BaseModel(object):' | |||
|
84 | 84 | # update with attributes from __json__ |
|
85 | 85 | if callable(_json_attr): |
|
86 | 86 | _json_attr = _json_attr() |
|
87 |
for k, val in _json_attr. |
|
|
87 | for k, val in _json_attr.items(): | |
|
88 | 88 | d[k] = val |
|
89 | 89 | return d |
|
90 | 90 |
@@ -84,7 +84,7 b' class BaseModel(object):' | |||
|
84 | 84 | # update with attributes from __json__ |
|
85 | 85 | if callable(_json_attr): |
|
86 | 86 | _json_attr = _json_attr() |
|
87 |
for k, val in _json_attr. |
|
|
87 | for k, val in _json_attr.items(): | |
|
88 | 88 | d[k] = val |
|
89 | 89 | return d |
|
90 | 90 |
@@ -84,7 +84,7 b' class BaseModel(object):' | |||
|
84 | 84 | # update with attributes from __json__ |
|
85 | 85 | if callable(_json_attr): |
|
86 | 86 | _json_attr = _json_attr() |
|
87 |
for k, val in _json_attr. |
|
|
87 | for k, val in _json_attr.items(): | |
|
88 | 88 | d[k] = val |
|
89 | 89 | return d |
|
90 | 90 |
@@ -84,7 +84,7 b' class BaseModel(object):' | |||
|
84 | 84 | # update with attributes from __json__ |
|
85 | 85 | if callable(_json_attr): |
|
86 | 86 | _json_attr = _json_attr() |
|
87 |
for k, val in _json_attr. |
|
|
87 | for k, val in _json_attr.items(): | |
|
88 | 88 | d[k] = val |
|
89 | 89 | return d |
|
90 | 90 |
@@ -85,7 +85,7 b' class BaseModel(object):' | |||
|
85 | 85 | # update with attributes from __json__ |
|
86 | 86 | if callable(_json_attr): |
|
87 | 87 | _json_attr = _json_attr() |
|
88 |
for k, val in _json_attr. |
|
|
88 | for k, val in _json_attr.items(): | |
|
89 | 89 | d[k] = val |
|
90 | 90 | return d |
|
91 | 91 |
@@ -85,7 +85,7 b' class BaseModel(object):' | |||
|
85 | 85 | # update with attributes from __json__ |
|
86 | 86 | if callable(_json_attr): |
|
87 | 87 | _json_attr = _json_attr() |
|
88 |
for k, val in _json_attr. |
|
|
88 | for k, val in _json_attr.items(): | |
|
89 | 89 | d[k] = val |
|
90 | 90 | return d |
|
91 | 91 |
@@ -85,7 +85,7 b' class BaseModel(object):' | |||
|
85 | 85 | # update with attributes from __json__ |
|
86 | 86 | if callable(_json_attr): |
|
87 | 87 | _json_attr = _json_attr() |
|
88 |
for k, val in _json_attr. |
|
|
88 | for k, val in _json_attr.items(): | |
|
89 | 89 | d[k] = val |
|
90 | 90 | return d |
|
91 | 91 |
@@ -85,7 +85,7 b' class BaseModel(object):' | |||
|
85 | 85 | # update with attributes from __json__ |
|
86 | 86 | if callable(_json_attr): |
|
87 | 87 | _json_attr = _json_attr() |
|
88 |
for k, val in _json_attr. |
|
|
88 | for k, val in _json_attr.items(): | |
|
89 | 89 | d[k] = val |
|
90 | 90 | return d |
|
91 | 91 |
@@ -88,7 +88,7 b' class BaseModel(object):' | |||
|
88 | 88 | # update with attributes from __json__ |
|
89 | 89 | if callable(_json_attr): |
|
90 | 90 | _json_attr = _json_attr() |
|
91 |
for k, val in _json_attr. |
|
|
91 | for k, val in _json_attr.items(): | |
|
92 | 92 | d[k] = val |
|
93 | 93 | return d |
|
94 | 94 |
@@ -90,7 +90,7 b' class BaseModel(object):' | |||
|
90 | 90 | # update with attributes from __json__ |
|
91 | 91 | if callable(_json_attr): |
|
92 | 92 | _json_attr = _json_attr() |
|
93 |
for k, val in _json_attr. |
|
|
93 | for k, val in _json_attr.items(): | |
|
94 | 94 | d[k] = val |
|
95 | 95 | return d |
|
96 | 96 |
@@ -134,7 +134,7 b' class BaseModel(object):' | |||
|
134 | 134 | # update with attributes from __json__ |
|
135 | 135 | if callable(_json_attr): |
|
136 | 136 | _json_attr = _json_attr() |
|
137 |
for k, val in _json_attr. |
|
|
137 | for k, val in _json_attr.items(): | |
|
138 | 138 | d[k] = val |
|
139 | 139 | return d |
|
140 | 140 |
@@ -134,7 +134,7 b' class BaseModel(object):' | |||
|
134 | 134 | # update with attributes from __json__ |
|
135 | 135 | if callable(_json_attr): |
|
136 | 136 | _json_attr = _json_attr() |
|
137 |
for k, val in _json_attr. |
|
|
137 | for k, val in _json_attr.items(): | |
|
138 | 138 | d[k] = val |
|
139 | 139 | return d |
|
140 | 140 |
@@ -135,7 +135,7 b' class BaseModel(object):' | |||
|
135 | 135 | # update with attributes from __json__ |
|
136 | 136 | if callable(_json_attr): |
|
137 | 137 | _json_attr = _json_attr() |
|
138 |
for k, val in _json_attr. |
|
|
138 | for k, val in _json_attr.items(): | |
|
139 | 139 | d[k] = val |
|
140 | 140 | return d |
|
141 | 141 |
@@ -135,7 +135,7 b' class BaseModel(object):' | |||
|
135 | 135 | # update with attributes from __json__ |
|
136 | 136 | if callable(_json_attr): |
|
137 | 137 | _json_attr = _json_attr() |
|
138 |
for k, val in _json_attr. |
|
|
138 | for k, val in _json_attr.items(): | |
|
139 | 139 | d[k] = val |
|
140 | 140 | return d |
|
141 | 141 |
@@ -136,7 +136,7 b' class BaseModel(object):' | |||
|
136 | 136 | # update with attributes from __json__ |
|
137 | 137 | if callable(_json_attr): |
|
138 | 138 | _json_attr = _json_attr() |
|
139 |
for k, val in _json_attr. |
|
|
139 | for k, val in _json_attr.items(): | |
|
140 | 140 | d[k] = val |
|
141 | 141 | return d |
|
142 | 142 |
@@ -136,7 +136,7 b' class BaseModel(object):' | |||
|
136 | 136 | # update with attributes from __json__ |
|
137 | 137 | if callable(_json_attr): |
|
138 | 138 | _json_attr = _json_attr() |
|
139 |
for k, val in _json_attr. |
|
|
139 | for k, val in _json_attr.items(): | |
|
140 | 140 | d[k] = val |
|
141 | 141 | return d |
|
142 | 142 |
@@ -158,7 +158,7 b' class BaseModel(object):' | |||
|
158 | 158 | # update with attributes from __json__ |
|
159 | 159 | if callable(_json_attr): |
|
160 | 160 | _json_attr = _json_attr() |
|
161 |
for k, val in _json_attr. |
|
|
161 | for k, val in _json_attr.items(): | |
|
162 | 162 | d[k] = val |
|
163 | 163 | return d |
|
164 | 164 |
@@ -216,7 +216,7 b' class BaseModel(object):' | |||
|
216 | 216 | # update with attributes from __json__ |
|
217 | 217 | if callable(_json_attr): |
|
218 | 218 | _json_attr = _json_attr() |
|
219 |
for k, val in _json_attr. |
|
|
219 | for k, val in _json_attr.items(): | |
|
220 | 220 | d[k] = val |
|
221 | 221 | return d |
|
222 | 222 |
@@ -216,7 +216,7 b' class BaseModel(object):' | |||
|
216 | 216 | # update with attributes from __json__ |
|
217 | 217 | if callable(_json_attr): |
|
218 | 218 | _json_attr = _json_attr() |
|
219 |
for k, val in _json_attr. |
|
|
219 | for k, val in _json_attr.items(): | |
|
220 | 220 | d[k] = val |
|
221 | 221 | return d |
|
222 | 222 |
@@ -223,7 +223,7 b' class BaseModel(object):' | |||
|
223 | 223 | # update with attributes from __json__ |
|
224 | 224 | if callable(_json_attr): |
|
225 | 225 | _json_attr = _json_attr() |
|
226 |
for k, val in _json_attr. |
|
|
226 | for k, val in _json_attr.items(): | |
|
227 | 227 | d[k] = val |
|
228 | 228 | return d |
|
229 | 229 |
@@ -223,7 +223,7 b' class BaseModel(object):' | |||
|
223 | 223 | # update with attributes from __json__ |
|
224 | 224 | if callable(_json_attr): |
|
225 | 225 | _json_attr = _json_attr() |
|
226 |
for k, val in _json_attr. |
|
|
226 | for k, val in _json_attr.items(): | |
|
227 | 227 | d[k] = val |
|
228 | 228 | return d |
|
229 | 229 |
@@ -223,7 +223,7 b' class BaseModel(object):' | |||
|
223 | 223 | # update with attributes from __json__ |
|
224 | 224 | if callable(_json_attr): |
|
225 | 225 | _json_attr = _json_attr() |
|
226 |
for k, val in _json_attr. |
|
|
226 | for k, val in _json_attr.items(): | |
|
227 | 227 | d[k] = val |
|
228 | 228 | return d |
|
229 | 229 |
@@ -230,7 +230,7 b' class BaseModel(object):' | |||
|
230 | 230 | # update with attributes from __json__ |
|
231 | 231 | if callable(_json_attr): |
|
232 | 232 | _json_attr = _json_attr() |
|
233 |
for k, val in _json_attr. |
|
|
233 | for k, val in _json_attr.items(): | |
|
234 | 234 | d[k] = val |
|
235 | 235 | return d |
|
236 | 236 |
@@ -230,7 +230,7 b' class BaseModel(object):' | |||
|
230 | 230 | # update with attributes from __json__ |
|
231 | 231 | if callable(_json_attr): |
|
232 | 232 | _json_attr = _json_attr() |
|
233 |
for k, val in _json_attr. |
|
|
233 | for k, val in _json_attr.items(): | |
|
234 | 234 | d[k] = val |
|
235 | 235 | return d |
|
236 | 236 |
@@ -230,7 +230,7 b' class BaseModel(object):' | |||
|
230 | 230 | # update with attributes from __json__ |
|
231 | 231 | if callable(_json_attr): |
|
232 | 232 | _json_attr = _json_attr() |
|
233 |
for k, val in _json_attr. |
|
|
233 | for k, val in _json_attr.items(): | |
|
234 | 234 | d[k] = val |
|
235 | 235 | return d |
|
236 | 236 |
@@ -235,7 +235,7 b' class BaseModel(object):' | |||
|
235 | 235 | # update with attributes from __json__ |
|
236 | 236 | if callable(_json_attr): |
|
237 | 237 | _json_attr = _json_attr() |
|
238 |
for k, val in _json_attr. |
|
|
238 | for k, val in _json_attr.items(): | |
|
239 | 239 | d[k] = val |
|
240 | 240 | return d |
|
241 | 241 |
@@ -179,7 +179,7 b' class BaseModel(object):' | |||
|
179 | 179 | # update with attributes from __json__ |
|
180 | 180 | if callable(_json_attr): |
|
181 | 181 | _json_attr = _json_attr() |
|
182 |
for k, val in _json_attr. |
|
|
182 | for k, val in _json_attr.items(): | |
|
183 | 183 | d[k] = val |
|
184 | 184 | return d |
|
185 | 185 |
@@ -180,7 +180,7 b' class BaseModel(object):' | |||
|
180 | 180 | # update with attributes from __json__ |
|
181 | 181 | if callable(_json_attr): |
|
182 | 182 | _json_attr = _json_attr() |
|
183 |
for k, val in _json_attr. |
|
|
183 | for k, val in _json_attr.items(): | |
|
184 | 184 | d[k] = val |
|
185 | 185 | return d |
|
186 | 186 |
@@ -179,7 +179,7 b' class BaseModel(object):' | |||
|
179 | 179 | # update with attributes from __json__ |
|
180 | 180 | if callable(_json_attr): |
|
181 | 181 | _json_attr = _json_attr() |
|
182 |
for k, val in _json_attr. |
|
|
182 | for k, val in _json_attr.items(): | |
|
183 | 183 | d[k] = val |
|
184 | 184 | return d |
|
185 | 185 |
@@ -181,7 +181,7 b' class BaseModel(object):' | |||
|
181 | 181 | # update with attributes from __json__ |
|
182 | 182 | if callable(_json_attr): |
|
183 | 183 | _json_attr = _json_attr() |
|
184 |
for k, val in _json_attr. |
|
|
184 | for k, val in _json_attr.items(): | |
|
185 | 185 | d[k] = val |
|
186 | 186 | return d |
|
187 | 187 |
@@ -181,7 +181,7 b' class BaseModel(object):' | |||
|
181 | 181 | # update with attributes from __json__ |
|
182 | 182 | if callable(_json_attr): |
|
183 | 183 | _json_attr = _json_attr() |
|
184 |
for k, val in _json_attr. |
|
|
184 | for k, val in _json_attr.items(): | |
|
185 | 185 | d[k] = val |
|
186 | 186 | return d |
|
187 | 187 |
@@ -177,7 +177,7 b' class BaseModel(object):' | |||
|
177 | 177 | # update with attributes from __json__ |
|
178 | 178 | if callable(_json_attr): |
|
179 | 179 | _json_attr = _json_attr() |
|
180 |
for k, val in _json_attr. |
|
|
180 | for k, val in _json_attr.items(): | |
|
181 | 181 | d[k] = val |
|
182 | 182 | return d |
|
183 | 183 |
@@ -177,7 +177,7 b' class BaseModel(object):' | |||
|
177 | 177 | # update with attributes from __json__ |
|
178 | 178 | if callable(_json_attr): |
|
179 | 179 | _json_attr = _json_attr() |
|
180 |
for k, val in _json_attr. |
|
|
180 | for k, val in _json_attr.items(): | |
|
181 | 181 | d[k] = val |
|
182 | 182 | return d |
|
183 | 183 |
@@ -175,7 +175,7 b' class BaseModel(object):' | |||
|
175 | 175 | # update with attributes from __json__ |
|
176 | 176 | if callable(_json_attr): |
|
177 | 177 | _json_attr = _json_attr() |
|
178 |
for k, val in _json_attr. |
|
|
178 | for k, val in _json_attr.items(): | |
|
179 | 179 | d[k] = val |
|
180 | 180 | return d |
|
181 | 181 |
@@ -446,7 +446,7 b' class MarkupRenderer(object):' | |||
|
446 | 446 | 'syntax_highlight': 'short', |
|
447 | 447 | }) |
|
448 | 448 | |
|
449 |
for k, v in docutils_settings. |
|
|
449 | for k, v in docutils_settings.items(): | |
|
450 | 450 | directives.register_directive(k, v) |
|
451 | 451 | |
|
452 | 452 | parts = publish_parts(source=source, |
@@ -40,7 +40,7 b' def _get_clean_environ(environ):' | |||
|
40 | 40 | :rtype: dict |
|
41 | 41 | """ |
|
42 | 42 | clean_environ = dict( |
|
43 |
(k, v) for k, v in environ. |
|
|
43 | (k, v) for k, v in environ.items() | |
|
44 | 44 | if type(v) == str and type(k) == str and not k.startswith('wsgi.') |
|
45 | 45 | ) |
|
46 | 46 |
@@ -1802,7 +1802,7 b' class Config(object):' | |||
|
1802 | 1802 | len(self._values), hex(id(self))) |
|
1803 | 1803 | |
|
1804 | 1804 | def items(self, section): |
|
1805 |
return self._values.get(section, {}). |
|
|
1805 | return self._values.get(section, {}).items() | |
|
1806 | 1806 | |
|
1807 | 1807 | def get(self, section, option): |
|
1808 | 1808 | return self._values.get(section, {}).get(option) |
@@ -144,14 +144,14 b' class GitCommit(base.BaseCommit):' | |||
|
144 | 144 | @LazyProperty |
|
145 | 145 | def tags(self): |
|
146 | 146 | tags = [safe_unicode(name) for name, |
|
147 |
commit_id in self.repository.tags. |
|
|
147 | commit_id in self.repository.tags.items() | |
|
148 | 148 | if commit_id == self.raw_id] |
|
149 | 149 | return tags |
|
150 | 150 | |
|
151 | 151 | @LazyProperty |
|
152 | 152 | def commit_branches(self): |
|
153 | 153 | branches = [] |
|
154 |
for name, commit_id in self.repository.branches. |
|
|
154 | for name, commit_id in self.repository.branches.items(): | |
|
155 | 155 | if commit_id == self.raw_id: |
|
156 | 156 | branches.append(name) |
|
157 | 157 | return branches |
@@ -317,7 +317,7 b' class GitRepository(BaseRepository):' | |||
|
317 | 317 | return OrderedDict() |
|
318 | 318 | |
|
319 | 319 | result = [] |
|
320 |
for ref, sha in self._refs. |
|
|
320 | for ref, sha in self._refs.items(): | |
|
321 | 321 | if ref.startswith(prefix): |
|
322 | 322 | ref_name = ref |
|
323 | 323 | if strip_prefix: |
@@ -412,7 +412,7 b' class GitRepository(BaseRepository):' | |||
|
412 | 412 | @property |
|
413 | 413 | def _ref_tree(self): |
|
414 | 414 | node = tree = {} |
|
415 |
for ref, sha in self._refs. |
|
|
415 | for ref, sha in self._refs.items(): | |
|
416 | 416 | path = ref.split('/') |
|
417 | 417 | for bit in path[:-1]: |
|
418 | 418 | node = node.setdefault(bit, {}) |
@@ -87,7 +87,7 b' class MercurialCommit(base.BaseCommit):' | |||
|
87 | 87 | |
|
88 | 88 | @LazyProperty |
|
89 | 89 | def tags(self): |
|
90 |
tags = [name for name, commit_id in self.repository.tags. |
|
|
90 | tags = [name for name, commit_id in self.repository.tags.items() | |
|
91 | 91 | if commit_id == self.raw_id] |
|
92 | 92 | return tags |
|
93 | 93 | |
@@ -98,7 +98,7 b' class MercurialCommit(base.BaseCommit):' | |||
|
98 | 98 | @LazyProperty |
|
99 | 99 | def bookmarks(self): |
|
100 | 100 | bookmarks = [ |
|
101 |
name for name, commit_id in self.repository.bookmarks. |
|
|
101 | name for name, commit_id in self.repository.bookmarks.items() | |
|
102 | 102 | if commit_id == self.raw_id] |
|
103 | 103 | return bookmarks |
|
104 | 104 | |
@@ -302,7 +302,7 b' class MercurialCommit(base.BaseCommit):' | |||
|
302 | 302 | if os.path.dirname(d) == path] |
|
303 | 303 | |
|
304 | 304 | alias = self.repository.alias |
|
305 |
for k, vals in self._submodules. |
|
|
305 | for k, vals in self._submodules.items(): | |
|
306 | 306 | if vcspath.dirname(k) == path: |
|
307 | 307 | loc = vals[0] |
|
308 | 308 | commit = vals[1] |
@@ -659,8 +659,8 b' class CommentsModel(BaseModel):' | |||
|
659 | 659 | def get_inline_comments_as_list(self, inline_comments, skip_outdated=True, |
|
660 | 660 | version=None): |
|
661 | 661 | inline_comms = [] |
|
662 |
for fname, per_line_comments in inline_comments. |
|
|
663 |
for lno, comments in per_line_comments. |
|
|
662 | for fname, per_line_comments in inline_comments.items(): | |
|
663 | for lno, comments in per_line_comments.items(): | |
|
664 | 664 | for comm in comments: |
|
665 | 665 | if not comm.outdated_at_version(version) and skip_outdated: |
|
666 | 666 | inline_comms.append(comm) |
@@ -236,7 +236,7 b' class BaseModel(object):' | |||
|
236 | 236 | # update with attributes from __json__ |
|
237 | 237 | if callable(_json_attr): |
|
238 | 238 | _json_attr = _json_attr() |
|
239 |
for k, val in _json_attr. |
|
|
239 | for k, val in _json_attr.items(): | |
|
240 | 240 | d[k] = val |
|
241 | 241 | return d |
|
242 | 242 |
@@ -749,7 +749,7 b" def ValidPerms(localizer, type_='repo'):" | |||
|
749 | 749 | # them by they IDs |
|
750 | 750 | new_perms_group = collections.defaultdict(dict) |
|
751 | 751 | del_perms_group = collections.defaultdict(dict) |
|
752 |
for k, v in value.copy(). |
|
|
752 | for k, v in value.copy().items(): | |
|
753 | 753 | if k.startswith('perm_del_member'): |
|
754 | 754 | # delete from org storage so we don't process that later |
|
755 | 755 | del value[k] |
@@ -792,7 +792,7 b" def ValidPerms(localizer, type_='repo'):" | |||
|
792 | 792 | # (read the existing radio button states) |
|
793 | 793 | default_user_id = User.get_default_user_id() |
|
794 | 794 | |
|
795 |
for k, update_value in value. |
|
|
795 | for k, update_value in value.items(): | |
|
796 | 796 | if k.startswith('u_perm_') or k.startswith('g_perm_'): |
|
797 | 797 | obj_type = k[0] |
|
798 | 798 | obj_id = k[7:] |
@@ -1072,7 +1072,7 b' def ValidPattern(localizer):' | |||
|
1072 | 1072 | patterns = [] |
|
1073 | 1073 | |
|
1074 | 1074 | prefix = 'new_pattern' |
|
1075 |
for name, v in value. |
|
|
1075 | for name, v in value.items(): | |
|
1076 | 1076 | pattern_name = '_'.join((prefix, 'pattern')) |
|
1077 | 1077 | if name.startswith(pattern_name): |
|
1078 | 1078 | new_item_id = name[len(pattern_name)+1:] |
@@ -12,7 +12,7 b'' | |||
|
12 | 12 | |
|
13 | 13 | <%def name="diff_block_changeset_table(change)"> |
|
14 | 14 | <div class="diff-container" id="${'diff-container-%s' % (id(change))}"> |
|
15 |
%for FID,(cs1, cs2, change, filenode_path, diff, stats, file_data) in change. |
|
|
15 | %for FID,(cs1, cs2, change, filenode_path, diff, stats, file_data) in change.items(): | |
|
16 | 16 | <div id="${h.FID('',filenode_path)}_target" ></div> |
|
17 | 17 | <div id="${h.FID('',filenode_path)}" class="diffblock margined comm"> |
|
18 | 18 | <div class="code-body"> |
@@ -43,7 +43,7 b' BASE_ENVIRON = {' | |||
|
43 | 43 | |
|
44 | 44 | def assert_all_values_are_str(environ): |
|
45 | 45 | """Checks that all values of a dict are str.""" |
|
46 |
for key, value in environ. |
|
|
46 | for key, value in environ.items(): | |
|
47 | 47 | assert isinstance(value, str), ( |
|
48 | 48 | "Value for key %s: has type %s but 'str' was expected. Value: %s" % |
|
49 | 49 | (key, type(value), repr(value))) |
@@ -51,7 +51,7 b' def assert_all_values_are_str(environ):' | |||
|
51 | 51 | |
|
52 | 52 | def assert_all_keys_are_str(environ): |
|
53 | 53 | """Checks that all keys of a dict are str.""" |
|
54 |
for key, value in environ. |
|
|
54 | for key, value in environ.items(): | |
|
55 | 55 | assert isinstance(value, str), ( |
|
56 | 56 | "Key %s: has type %s but 'str' was expected. " % |
|
57 | 57 | (repr(key), type(key))) |
@@ -181,11 +181,11 b' class TestCommitsInNonEmptyRepo(BackendT' | |||
|
181 | 181 | assert idx == self.repo.get_commit(commit_idx=idx).idx |
|
182 | 182 | |
|
183 | 183 | def test_get_commit_by_branch(self): |
|
184 |
for branch, commit_id in self.repo.branches. |
|
|
184 | for branch, commit_id in self.repo.branches.items(): | |
|
185 | 185 | assert commit_id == self.repo.get_commit(branch).raw_id |
|
186 | 186 | |
|
187 | 187 | def test_get_commit_by_tag(self): |
|
188 |
for tag, commit_id in self.repo.tags. |
|
|
188 | for tag, commit_id in self.repo.tags.items(): | |
|
189 | 189 | assert commit_id == self.repo.get_commit(tag).raw_id |
|
190 | 190 | |
|
191 | 191 | def test_get_commit_parents(self): |
General Comments 0
You need to be logged in to leave comments.
Login now