Merge lp:~jelmer/loggerhead/isort into lp:loggerhead
- isort
- Merge into trunk-rich
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 544 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | lp:~jelmer/loggerhead/isort |
Merge into: | lp:loggerhead |
Diff against target: |
769 lines (+90/-147) 34 files modified
__init__.py (+1/-1) loggerhead-serve (+0/-1) loggerhead.wsgi (+8/-5) loggerhead/apps/__init__.py (+1/-1) loggerhead/apps/branch.py (+7/-10) loggerhead/apps/transport.py (+4/-6) loggerhead/changecache.py (+1/-2) loggerhead/config.py (+1/-1) loggerhead/controllers/__init__.py (+2/-5) loggerhead/controllers/annotate_ui.py (+3/-2) loggerhead/controllers/changelog_ui.py (+1/-2) loggerhead/controllers/diff_ui.py (+2/-3) loggerhead/controllers/download_ui.py (+3/-4) loggerhead/controllers/error_ui.py (+2/-2) loggerhead/controllers/filediff_ui.py (+3/-5) loggerhead/controllers/inventory_ui.py (+2/-8) loggerhead/controllers/revision_ui.py (+1/-3) loggerhead/controllers/search_ui.py (+1/-1) loggerhead/controllers/view_ui.py (+7/-15) loggerhead/daemon.py (+1/-1) loggerhead/highlight.py (+3/-3) loggerhead/history.py (+2/-3) loggerhead/load_test.py (+4/-9) loggerhead/lsprof.py (+2/-1) loggerhead/main.py (+4/-5) loggerhead/templatefunctions.py (+3/-8) loggerhead/tests/test_controllers.py (+3/-13) loggerhead/tests/test_history.py (+2/-6) loggerhead/tests/test_http_head.py (+0/-1) loggerhead/tests/test_load_test.py (+1/-2) loggerhead/tests/test_simple.py (+5/-8) loggerhead/util.py (+7/-7) loggerhead/wholehistory.py (+1/-1) loggerhead/zptsupport.py (+2/-2) |
To merge this branch: | bzr merge lp:~jelmer/loggerhead/isort |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+436635@code.launchpad.net |
Commit message
Sort Python import definitions
Description of the change
Sort Python import definitions with isort
To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '__init__.py' |
2 | --- __init__.py 2022-09-16 15:45:12 +0000 |
3 | +++ __init__.py 2023-01-31 19:23:22 +0000 |
4 | @@ -34,6 +34,7 @@ |
5 | import importlib.metadata as importlib_metadata |
6 | except ImportError: |
7 | import importlib_metadata |
8 | + |
9 | import sys |
10 | |
11 | from packaging.version import Version |
12 | @@ -46,7 +47,6 @@ |
13 | |
14 | import breezy |
15 | from breezy import commands |
16 | - |
17 | from breezy.transport import transport_server_registry |
18 | |
19 | DEFAULT_HOST = '0.0.0.0' |
20 | |
21 | === modified file 'loggerhead-serve' |
22 | --- loggerhead-serve 2020-06-04 20:28:15 +0000 |
23 | +++ loggerhead-serve 2023-01-31 19:23:22 +0000 |
24 | @@ -22,6 +22,5 @@ |
25 | |
26 | from loggerhead.main import main |
27 | |
28 | - |
29 | if __name__ == "__main__": |
30 | main(sys.argv[1:]) |
31 | |
32 | === modified file 'loggerhead.wsgi' |
33 | --- loggerhead.wsgi 2021-11-16 00:59:15 +0000 |
34 | +++ loggerhead.wsgi 2023-01-31 19:23:22 +0000 |
35 | @@ -14,18 +14,21 @@ |
36 | # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
37 | |
38 | |
39 | -import sys |
40 | import os |
41 | import pwd |
42 | +import sys |
43 | + |
44 | sys.path.insert(0, os.path.dirname(__file__)) |
45 | |
46 | +from breezy import config as bzrconfig |
47 | +from breezy.plugin import load_plugins |
48 | +from paste.deploy.config import PrefixMiddleware |
49 | from paste.httpexceptions import HTTPExceptionHandler |
50 | + |
51 | +from loggerhead.apps.error import ErrorHandlerApp |
52 | from loggerhead.apps.transport import BranchesFromTransportRoot |
53 | -from loggerhead.apps.error import ErrorHandlerApp |
54 | from loggerhead.config import LoggerheadConfig |
55 | -from breezy import config as bzrconfig |
56 | -from paste.deploy.config import PrefixMiddleware |
57 | -from breezy.plugin import load_plugins |
58 | + |
59 | |
60 | class NotConfiguredError(Exception): |
61 | pass |
62 | |
63 | === modified file 'loggerhead/apps/__init__.py' |
64 | --- loggerhead/apps/__init__.py 2021-12-06 23:30:25 +0000 |
65 | +++ loggerhead/apps/__init__.py 2023-01-31 19:23:22 +0000 |
66 | @@ -2,7 +2,7 @@ |
67 | |
68 | import os |
69 | |
70 | -from paste import urlparser, fileapp |
71 | +from paste import fileapp, urlparser |
72 | |
73 | from ..util import convert_file_errors |
74 | |
75 | |
76 | === modified file 'loggerhead/apps/branch.py' |
77 | --- loggerhead/apps/branch.py 2021-12-06 23:30:25 +0000 |
78 | +++ loggerhead/apps/branch.py 2023-01-31 19:23:22 +0000 |
79 | @@ -22,28 +22,25 @@ |
80 | |
81 | import breezy.branch |
82 | import breezy.errors |
83 | -from breezy.hooks import Hooks |
84 | import breezy.lru_cache |
85 | from breezy import urlutils |
86 | - |
87 | -from paste import request |
88 | -from paste import httpexceptions |
89 | - |
90 | -from ..apps import static_app, health_app |
91 | +from breezy.hooks import Hooks |
92 | +from paste import httpexceptions, request |
93 | + |
94 | +from .. import util |
95 | +from ..apps import health_app, static_app |
96 | from ..controllers.annotate_ui import AnnotateUI |
97 | -from ..controllers.view_ui import ViewUI |
98 | from ..controllers.atom_ui import AtomUI |
99 | from ..controllers.changelog_ui import ChangeLogUI |
100 | from ..controllers.diff_ui import DiffUI |
101 | -from ..controllers.download_ui import DownloadUI, DownloadTarballUI |
102 | +from ..controllers.download_ui import DownloadTarballUI, DownloadUI |
103 | from ..controllers.filediff_ui import FileDiffUI |
104 | from ..controllers.inventory_ui import InventoryUI |
105 | from ..controllers.revision_ui import RevisionUI |
106 | from ..controllers.revlog_ui import RevLogUI |
107 | from ..controllers.search_ui import SearchUI |
108 | +from ..controllers.view_ui import ViewUI |
109 | from ..history import History |
110 | -from .. import util |
111 | - |
112 | |
113 | _DEFAULT = object() |
114 | |
115 | |
116 | === modified file 'loggerhead/apps/transport.py' |
117 | --- loggerhead/apps/transport.py 2018-10-20 11:09:30 +0000 |
118 | +++ loggerhead/apps/transport.py 2023-01-31 19:23:22 +0000 |
119 | @@ -18,20 +18,18 @@ |
120 | |
121 | import threading |
122 | |
123 | +import breezy.ui |
124 | from breezy import branch, errors, lru_cache, urlutils |
125 | +from breezy.bzr.smart import request |
126 | from breezy.config import LocationConfig |
127 | -from breezy.bzr.smart import request |
128 | -import breezy.ui |
129 | from breezy.transport import get_transport |
130 | from breezy.transport.http import wsgi |
131 | - |
132 | +from paste import httpexceptions, urlparser |
133 | from paste.request import path_info_pop |
134 | -from paste import httpexceptions |
135 | -from paste import urlparser |
136 | |
137 | from .. import util |
138 | +from ..apps import favicon_app, robots_app, static_app |
139 | from ..apps.branch import BranchWSGIApp |
140 | -from ..apps import favicon_app, robots_app, static_app |
141 | from ..controllers.directory_ui import DirectoryUI |
142 | |
143 | |
144 | |
145 | === modified file 'loggerhead/changecache.py' |
146 | --- loggerhead/changecache.py 2021-11-15 14:40:11 +0000 |
147 | +++ loggerhead/changecache.py 2023-01-31 19:23:22 +0000 |
148 | @@ -26,12 +26,11 @@ |
149 | cached a change, it's good forever. |
150 | """ |
151 | |
152 | -import pickle |
153 | import marshal |
154 | import os |
155 | +import pickle |
156 | import tempfile |
157 | import zlib |
158 | - |
159 | from sqlite3 import dbapi2 |
160 | |
161 | # We take an optimistic approach to concurrency here: we might do work twice |
162 | |
163 | === modified file 'loggerhead/config.py' |
164 | --- loggerhead/config.py 2020-06-04 19:43:36 +0000 |
165 | +++ loggerhead/config.py 2023-01-31 19:23:22 +0000 |
166 | @@ -13,9 +13,9 @@ |
167 | # |
168 | """Configuration tools for Loggerhead.""" |
169 | |
170 | -from optparse import OptionParser |
171 | import sys |
172 | import tempfile |
173 | +from optparse import OptionParser |
174 | |
175 | from breezy import config |
176 | |
177 | |
178 | === modified file 'loggerhead/controllers/__init__.py' |
179 | --- loggerhead/controllers/__init__.py 2020-07-08 17:14:19 +0000 |
180 | +++ loggerhead/controllers/__init__.py 2023-01-31 19:23:22 +0000 |
181 | @@ -21,14 +21,11 @@ |
182 | import time |
183 | |
184 | import breezy.errors |
185 | - |
186 | from breezy import osutils |
187 | - |
188 | from paste.httpexceptions import HTTPNotFound, HTTPSeeOther |
189 | -from paste.request import path_info_pop, parse_querystring |
190 | +from paste.request import parse_querystring, path_info_pop |
191 | |
192 | -from .. import templates |
193 | -from .. import util |
194 | +from .. import templates, util |
195 | from ..templatefunctions import templatefunctions |
196 | from ..zptsupport import load_template |
197 | |
198 | |
199 | === modified file 'loggerhead/controllers/annotate_ui.py' |
200 | --- loggerhead/controllers/annotate_ui.py 2022-07-06 12:45:28 +0000 |
201 | +++ loggerhead/controllers/annotate_ui.py 2023-01-31 19:23:22 +0000 |
202 | @@ -16,11 +16,12 @@ |
203 | # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
204 | # |
205 | |
206 | +import itertools |
207 | from datetime import datetime |
208 | -import itertools |
209 | |
210 | +from .. import util |
211 | from ..controllers.view_ui import ViewUI |
212 | -from .. import util |
213 | + |
214 | |
215 | class AnnotateUI(ViewUI): |
216 | |
217 | |
218 | === modified file 'loggerhead/controllers/changelog_ui.py' |
219 | --- loggerhead/controllers/changelog_ui.py 2022-07-06 12:45:28 +0000 |
220 | +++ loggerhead/controllers/changelog_ui.py 2023-01-31 19:23:22 +0000 |
221 | @@ -20,10 +20,9 @@ |
222 | |
223 | import json |
224 | |
225 | +from breezy import osutils, urlutils |
226 | from paste.httpexceptions import HTTPServerError |
227 | |
228 | -from breezy import osutils, urlutils |
229 | - |
230 | from .. import util |
231 | from ..controllers import TemplatedBranchView |
232 | |
233 | |
234 | === modified file 'loggerhead/controllers/diff_ui.py' |
235 | --- loggerhead/controllers/diff_ui.py 2018-10-20 13:45:31 +0000 |
236 | +++ loggerhead/controllers/diff_ui.py 2023-01-31 19:23:22 +0000 |
237 | @@ -16,13 +16,12 @@ |
238 | # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
239 | # |
240 | |
241 | +import time |
242 | from io import BytesIO |
243 | -import time |
244 | - |
245 | -from paste.request import path_info_pop, parse_querystring |
246 | |
247 | from breezy.diff import show_diff_trees |
248 | from breezy.revision import NULL_REVISION |
249 | +from paste.request import parse_querystring, path_info_pop |
250 | |
251 | from ..controllers import TemplatedBranchView |
252 | |
253 | |
254 | === modified file 'loggerhead/controllers/download_ui.py' |
255 | --- loggerhead/controllers/download_ui.py 2022-08-31 14:04:38 +0000 |
256 | +++ loggerhead/controllers/download_ui.py 2023-01-31 19:23:22 +0000 |
257 | @@ -21,14 +21,13 @@ |
258 | import mimetypes |
259 | import urllib |
260 | |
261 | -from breezy.errors import ( |
262 | - NoSuchId, |
263 | - NoSuchRevision, |
264 | - ) |
265 | +from breezy.errors import NoSuchId, NoSuchRevision |
266 | + |
267 | try: |
268 | from breezy.transport import NoSuchFile |
269 | except ImportError: |
270 | from breezy.errors import NoSuchFile |
271 | + |
272 | from breezy import osutils, urlutils |
273 | from paste import httpexceptions |
274 | from paste.request import path_info_pop |
275 | |
276 | === modified file 'loggerhead/controllers/error_ui.py' |
277 | --- loggerhead/controllers/error_ui.py 2018-10-20 13:45:31 +0000 |
278 | +++ loggerhead/controllers/error_ui.py 2023-01-31 19:23:22 +0000 |
279 | @@ -16,11 +16,11 @@ |
280 | # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
281 | # |
282 | |
283 | +import traceback |
284 | from io import StringIO |
285 | -import traceback |
286 | |
287 | +from .. import util |
288 | from ..controllers import TemplatedBranchView |
289 | -from .. import util |
290 | |
291 | |
292 | class ErrorUI(TemplatedBranchView): |
293 | |
294 | === modified file 'loggerhead/controllers/filediff_ui.py' |
295 | --- loggerhead/controllers/filediff_ui.py 2022-08-29 16:33:16 +0000 |
296 | +++ loggerhead/controllers/filediff_ui.py 2023-01-31 19:23:22 +0000 |
297 | @@ -1,14 +1,12 @@ |
298 | from io import BytesIO |
299 | |
300 | -from breezy import ( |
301 | - diff, |
302 | - errors, |
303 | - urlutils, |
304 | - ) |
305 | +from breezy import diff, errors, urlutils |
306 | + |
307 | try: |
308 | from breezy.transport import NoSuchFile |
309 | except ImportError: |
310 | from breezy.errors import NoSuchFile |
311 | + |
312 | from breezy.tree import find_previous_path |
313 | |
314 | from .. import util |
315 | |
316 | === modified file 'loggerhead/controllers/inventory_ui.py' |
317 | --- loggerhead/controllers/inventory_ui.py 2022-07-06 12:45:28 +0000 |
318 | +++ loggerhead/controllers/inventory_ui.py 2023-01-31 19:23:22 +0000 |
319 | @@ -22,20 +22,14 @@ |
320 | import posixpath |
321 | import urllib |
322 | |
323 | -from paste.httpexceptions import HTTPNotFound, HTTPMovedPermanently |
324 | - |
325 | -from breezy import ( |
326 | - errors, |
327 | - osutils, |
328 | - urlutils, |
329 | - ) |
330 | +from breezy import errors, osutils, urlutils |
331 | from breezy.revision import is_null as is_null_rev |
332 | +from paste.httpexceptions import HTTPMovedPermanently, HTTPNotFound |
333 | |
334 | from .. import util |
335 | from ..controllers import TemplatedBranchView |
336 | |
337 | |
338 | - |
339 | def dirname(path): |
340 | if path is not None: |
341 | path = path.rstrip('/') |
342 | |
343 | === modified file 'loggerhead/controllers/revision_ui.py' |
344 | --- loggerhead/controllers/revision_ui.py 2022-07-06 12:45:28 +0000 |
345 | +++ loggerhead/controllers/revision_ui.py 2023-01-31 19:23:22 +0000 |
346 | @@ -19,15 +19,13 @@ |
347 | |
348 | import json |
349 | |
350 | +from breezy import urlutils |
351 | from paste.httpexceptions import HTTPServerError |
352 | |
353 | -from breezy import urlutils |
354 | - |
355 | from .. import util |
356 | from ..controllers import TemplatedBranchView |
357 | from ..controllers.filediff_ui import diff_chunks_for_file |
358 | |
359 | - |
360 | DEFAULT_LINE_COUNT_LIMIT = 3000 |
361 | |
362 | |
363 | |
364 | === modified file 'loggerhead/controllers/search_ui.py' |
365 | --- loggerhead/controllers/search_ui.py 2018-10-20 11:09:30 +0000 |
366 | +++ loggerhead/controllers/search_ui.py 2023-01-31 19:23:22 +0000 |
367 | @@ -16,8 +16,8 @@ |
368 | # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
369 | # |
370 | |
371 | +from .. import search |
372 | from ..controllers import TemplatedBranchView |
373 | -from .. import search |
374 | |
375 | |
376 | class SearchUI(TemplatedBranchView): |
377 | |
378 | === modified file 'loggerhead/controllers/view_ui.py' |
379 | --- loggerhead/controllers/view_ui.py 2022-08-29 16:33:16 +0000 |
380 | +++ loggerhead/controllers/view_ui.py 2023-01-31 19:23:22 +0000 |
381 | @@ -19,28 +19,20 @@ |
382 | |
383 | import os |
384 | |
385 | -from breezy.errors import ( |
386 | - BinaryFile, |
387 | - NoSuchId, |
388 | - NoSuchRevision, |
389 | - ) |
390 | +from breezy.errors import BinaryFile, NoSuchId, NoSuchRevision |
391 | + |
392 | try: |
393 | from breezy.transport import NoSuchFile |
394 | except ImportError: |
395 | from breezy.errors import NoSuchFile |
396 | -from breezy import ( |
397 | - osutils, |
398 | - urlutils, |
399 | - ) |
400 | + |
401 | import breezy.textfile |
402 | - |
403 | -from paste.httpexceptions import ( |
404 | - HTTPBadRequest, |
405 | - HTTPMovedPermanently, |
406 | - HTTPNotFound, |
407 | - ) |
408 | +from breezy import osutils, urlutils |
409 | +from paste.httpexceptions import (HTTPBadRequest, HTTPMovedPermanently, |
410 | + HTTPNotFound) |
411 | |
412 | from ..controllers import TemplatedBranchView |
413 | + |
414 | try: |
415 | from ..highlight import highlight |
416 | except ImportError: |
417 | |
418 | === modified file 'loggerhead/daemon.py' |
419 | --- loggerhead/daemon.py 2018-10-20 11:27:37 +0000 |
420 | +++ loggerhead/daemon.py 2023-01-31 19:23:22 +0000 |
421 | @@ -34,7 +34,7 @@ |
422 | else: |
423 | os._exit(0) # Exit parent of the first child. |
424 | |
425 | - import resource # Resource usage information. |
426 | + import resource # Resource usage information. |
427 | maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1] |
428 | if (maxfd == resource.RLIM_INFINITY): |
429 | maxfd = MAXFD |
430 | |
431 | === modified file 'loggerhead/highlight.py' |
432 | --- loggerhead/highlight.py 2022-04-03 12:41:18 +0000 |
433 | +++ loggerhead/highlight.py 2023-01-31 19:23:22 +0000 |
434 | @@ -16,12 +16,12 @@ |
435 | # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
436 | # |
437 | |
438 | +from html import escape |
439 | + |
440 | import breezy.osutils |
441 | -from html import escape |
442 | - |
443 | from pygments import highlight as _highlight_func |
444 | -from pygments.lexers import guess_lexer, guess_lexer_for_filename, TextLexer |
445 | from pygments.formatters import HtmlFormatter |
446 | +from pygments.lexers import TextLexer, guess_lexer, guess_lexer_for_filename |
447 | from pygments.util import ClassNotFound |
448 | |
449 | DEFAULT_PYGMENT_STYLE = 'colorful' |
450 | |
451 | === modified file 'loggerhead/history.py' |
452 | --- loggerhead/history.py 2022-08-29 16:33:16 +0000 |
453 | +++ loggerhead/history.py 2023-01-31 19:23:22 +0000 |
454 | @@ -34,21 +34,20 @@ |
455 | import textwrap |
456 | import threading |
457 | |
458 | -from breezy import tag |
459 | import breezy.branch |
460 | import breezy.delta |
461 | import breezy.errors |
462 | import breezy.foreign |
463 | import breezy.osutils |
464 | import breezy.revision |
465 | +from breezy import tag |
466 | |
467 | try: |
468 | from breezy.transport import NoSuchFile |
469 | except ImportError: |
470 | from breezy.errors import NoSuchFile |
471 | |
472 | -from . import search |
473 | -from . import util |
474 | +from . import search, util |
475 | from .wholehistory import compute_whole_history_data |
476 | |
477 | |
478 | |
479 | === modified file 'loggerhead/load_test.py' |
480 | --- loggerhead/load_test.py 2022-08-29 16:33:16 +0000 |
481 | +++ loggerhead/load_test.py 2023-01-31 19:23:22 +0000 |
482 | @@ -63,17 +63,12 @@ |
483 | this. |
484 | """ |
485 | |
486 | +import json |
487 | import threading |
488 | import time |
489 | -from queue import Queue, Empty |
490 | - |
491 | -import json |
492 | - |
493 | -from breezy import ( |
494 | - errors, |
495 | - transport, |
496 | - urlutils, |
497 | - ) |
498 | +from queue import Empty, Queue |
499 | + |
500 | +from breezy import errors, transport, urlutils |
501 | |
502 | try: |
503 | from breezy.transport import NoSuchFile |
504 | |
505 | === modified file 'loggerhead/lsprof.py' |
506 | --- loggerhead/lsprof.py 2021-11-15 14:40:11 +0000 |
507 | +++ loggerhead/lsprof.py 2023-01-31 19:23:22 +0000 |
508 | @@ -6,8 +6,9 @@ |
509 | # instead of just the Stats object |
510 | |
511 | import sys |
512 | +import threading |
513 | from threading import get_ident |
514 | -import threading |
515 | + |
516 | from _lsprof import Profiler, profiler_entry |
517 | |
518 | __all__ = ['profile', 'Stats'] |
519 | |
520 | === modified file 'loggerhead/main.py' |
521 | --- loggerhead/main.py 2022-08-08 16:33:50 +0000 |
522 | +++ loggerhead/main.py 2023-01-31 19:23:22 +0000 |
523 | @@ -21,19 +21,18 @@ |
524 | import os |
525 | import sys |
526 | |
527 | +from breezy.location import location_to_url |
528 | from breezy.plugin import load_plugins |
529 | -from breezy.location import location_to_url |
530 | - |
531 | from paste import httpserver |
532 | from paste.httpexceptions import HTTPExceptionHandler, HTTPInternalServerError |
533 | from paste.translogger import TransLogger |
534 | |
535 | from . import __version__ |
536 | -from .apps.transport import ( |
537 | - BranchesFromTransportRoot, UserBranchesFromTransportRoot) |
538 | +from .apps.error import ErrorHandlerApp |
539 | +from .apps.transport import (BranchesFromTransportRoot, |
540 | + UserBranchesFromTransportRoot) |
541 | from .config import LoggerheadConfig |
542 | from .util import Reloader |
543 | -from .apps.error import ErrorHandlerApp |
544 | |
545 | |
546 | def get_config_and_base(args): |
547 | |
548 | === modified file 'loggerhead/templatefunctions.py' |
549 | --- loggerhead/templatefunctions.py 2022-08-08 16:33:50 +0000 |
550 | +++ loggerhead/templatefunctions.py 2023-01-31 19:23:22 +0000 |
551 | @@ -16,18 +16,13 @@ |
552 | |
553 | import os |
554 | |
555 | +import breezy |
556 | import pkg_resources |
557 | - |
558 | -import breezy |
559 | from breezy import urlutils |
560 | |
561 | -from . import ( |
562 | - __version__, |
563 | - __revision__, |
564 | - ) |
565 | +from . import __revision__, __version__ |
566 | +from .util import html_format |
567 | from .zptsupport import zpt |
568 | -from .util import html_format |
569 | - |
570 | |
571 | templatefunctions = {} |
572 | |
573 | |
574 | === modified file 'loggerhead/tests/test_controllers.py' |
575 | --- loggerhead/tests/test_controllers.py 2022-09-17 13:07:55 +0000 |
576 | +++ loggerhead/tests/test_controllers.py 2023-01-31 19:23:22 +0000 |
577 | @@ -20,23 +20,13 @@ |
578 | import tarfile |
579 | import tempfile |
580 | |
581 | -from paste.fixture import ( |
582 | - AppError, |
583 | - ) |
584 | +from paste.fixture import AppError |
585 | from paste.httpexceptions import HTTPNotFound |
586 | - |
587 | -from testtools.matchers import ( |
588 | - Matcher, |
589 | - Mismatch, |
590 | - ) |
591 | +from testtools.matchers import Matcher, Mismatch |
592 | |
593 | from ..apps.branch import BranchWSGIApp |
594 | from ..controllers.annotate_ui import AnnotateUI |
595 | -from .test_simple import ( |
596 | - BasicTests, |
597 | - consume_app, |
598 | - TestWithSimpleTree, |
599 | - ) |
600 | +from .test_simple import BasicTests, TestWithSimpleTree, consume_app |
601 | |
602 | |
603 | class TestInventoryUI(BasicTests): |
604 | |
605 | === modified file 'loggerhead/tests/test_history.py' |
606 | --- loggerhead/tests/test_history.py 2018-10-20 13:45:31 +0000 |
607 | +++ loggerhead/tests/test_history.py 2023-01-31 19:23:22 +0000 |
608 | @@ -17,14 +17,10 @@ |
609 | |
610 | """Direct tests of the loggerhead/history.py module""" |
611 | |
612 | -from breezy.foreign import ( |
613 | - ForeignRevision, |
614 | - ForeignVcs, |
615 | - VcsMapping, |
616 | - ) |
617 | - |
618 | from datetime import datetime |
619 | + |
620 | from breezy import tag, tests |
621 | +from breezy.foreign import ForeignRevision, ForeignVcs, VcsMapping |
622 | |
623 | from .. import history as _mod_history |
624 | |
625 | |
626 | === modified file 'loggerhead/tests/test_http_head.py' |
627 | --- loggerhead/tests/test_http_head.py 2018-10-20 14:21:37 +0000 |
628 | +++ loggerhead/tests/test_http_head.py 2023-01-31 19:23:22 +0000 |
629 | @@ -22,7 +22,6 @@ |
630 | |
631 | from ..apps import http_head |
632 | |
633 | - |
634 | content = [b"<html>", |
635 | b"<head><title>Listed</title></head>", |
636 | b"<body>Content</body>", |
637 | |
638 | === modified file 'loggerhead/tests/test_load_test.py' |
639 | --- loggerhead/tests/test_load_test.py 2021-11-15 14:40:11 +0000 |
640 | +++ loggerhead/tests/test_load_test.py 2023-01-31 19:23:22 +0000 |
641 | @@ -13,8 +13,8 @@ |
642 | """Tests for the load testing code.""" |
643 | |
644 | import socket |
645 | +import threading |
646 | import time |
647 | -import threading |
648 | from queue import Empty |
649 | |
650 | from breezy import tests |
651 | @@ -22,7 +22,6 @@ |
652 | |
653 | from .. import load_test |
654 | |
655 | - |
656 | empty_script = """{ |
657 | "parameters": {}, |
658 | "requests": [] |
659 | |
660 | === modified file 'loggerhead/tests/test_simple.py' |
661 | --- loggerhead/tests/test_simple.py 2022-07-06 12:45:28 +0000 |
662 | +++ loggerhead/tests/test_simple.py 2023-01-31 19:23:22 +0000 |
663 | @@ -17,24 +17,21 @@ |
664 | |
665 | from __future__ import absolute_import |
666 | |
667 | -from html import escape |
668 | import json |
669 | import logging |
670 | import re |
671 | +from html import escape |
672 | from io import BytesIO |
673 | |
674 | +from breezy import config |
675 | from breezy.tests import TestCaseWithTransport |
676 | from configobj import ConfigObj |
677 | -from breezy import config |
678 | +from paste.fixture import TestApp |
679 | +from paste.httpexceptions import HTTPExceptionHandler, HTTPMovedPermanently |
680 | |
681 | from ..apps.branch import BranchWSGIApp |
682 | from ..apps.http_head import HeadMiddleware |
683 | -from paste.fixture import TestApp |
684 | -from paste.httpexceptions import HTTPExceptionHandler, HTTPMovedPermanently |
685 | - |
686 | -from .fixtures import ( |
687 | - SampleBranch, |
688 | - ) |
689 | +from .fixtures import SampleBranch |
690 | |
691 | |
692 | class BasicTests(TestCaseWithTransport): |
693 | |
694 | === modified file 'loggerhead/util.py' |
695 | --- loggerhead/util.py 2022-07-06 12:45:28 +0000 |
696 | +++ loggerhead/util.py 2023-01-31 19:23:22 +0000 |
697 | @@ -24,20 +24,18 @@ |
698 | import base64 |
699 | import datetime |
700 | import logging |
701 | +import os |
702 | import re |
703 | import struct |
704 | +import subprocess |
705 | +import sys |
706 | import threading |
707 | import time |
708 | -import sys |
709 | -import os |
710 | -import subprocess |
711 | - |
712 | from xml.etree import ElementTree as ET |
713 | |
714 | +import bleach |
715 | from breezy import urlutils |
716 | |
717 | -import bleach |
718 | - |
719 | log = logging.getLogger("loggerhead.controllers") |
720 | |
721 | |
722 | @@ -506,8 +504,9 @@ |
723 | def lsprof(f): |
724 | |
725 | def _f(*a, **kw): |
726 | + import cPickle |
727 | + |
728 | from .loggerhead.lsprof import profile |
729 | - import cPickle |
730 | z = time.time() |
731 | ret, stats = profile(f, *a, **kw) |
732 | log.debug('Finished profiled %s in %d msec.' % (f.__name__, |
733 | @@ -650,6 +649,7 @@ |
734 | return application(environ, start_response) |
735 | except (IOError, OSError) as e: |
736 | import errno |
737 | + |
738 | from paste import httpexceptions |
739 | if e.errno == errno.ENOENT: |
740 | raise httpexceptions.HTTPNotFound() |
741 | |
742 | === modified file 'loggerhead/wholehistory.py' |
743 | --- loggerhead/wholehistory.py 2020-05-06 19:18:04 +0000 |
744 | +++ loggerhead/wholehistory.py 2023-01-31 19:23:22 +0000 |
745 | @@ -20,7 +20,7 @@ |
746 | import logging |
747 | import time |
748 | |
749 | -from breezy.revision import is_null, NULL_REVISION |
750 | +from breezy.revision import NULL_REVISION, is_null |
751 | from breezy.tsort import merge_sort |
752 | |
753 | |
754 | |
755 | === modified file 'loggerhead/zptsupport.py' |
756 | --- loggerhead/zptsupport.py 2022-08-08 16:33:50 +0000 |
757 | +++ loggerhead/zptsupport.py 2023-01-31 19:23:22 +0000 |
758 | @@ -16,9 +16,9 @@ |
759 | """Support for Zope Page Templates using the Chameleon library.""" |
760 | |
761 | import os |
762 | +import re |
763 | + |
764 | import pkg_resources |
765 | -import re |
766 | - |
767 | from chameleon import PageTemplate |
768 | |
769 | _zpt_cache = {} |