diff options
author | Ben Brown <ben@demerara.io> | 2022-02-05 16:01:37 +0000 |
---|---|---|
committer | Ben Brown <ben@demerara.io> | 2022-02-05 16:13:05 +0000 |
commit | 0ffd6856e172020e824ed61e7a6d00779c5999af (patch) | |
tree | 263fbbc75281dc137366064bdfce4b0072f7ad90 | |
parent | cad5b2c2bbbac7015f3f2bf66f8af01bdbf943f8 (diff) | |
download | lorry-0ffd6856e172020e824ed61e7a6d00779c5999af.tar.gz |
Make flake8 happy
-rwxr-xr-x | lorry | 10 | ||||
-rwxr-xr-x | lorry.gzip-importer | 2 | ||||
-rwxr-xr-x | lorry.raw-file-importer | 2 | ||||
-rwxr-xr-x | lorry.zip-importer | 26 |
4 files changed, 20 insertions, 20 deletions
@@ -61,7 +61,7 @@ def quote_url(url): """ valid_chars = string.digits + string.ascii_letters + "%_" - transl = lambda x: x if x in valid_chars else "_" + transl = lambda x: x if x in valid_chars else "_" # noqa E731 return "".join([transl(x) for x in url]) @@ -374,7 +374,7 @@ class Lorry(cliapp.Application): repositoryformatversion = 0 filemode = true bare = true -""" +""" # noqa: 374 ) for entry in [ "HEAD", @@ -451,7 +451,7 @@ class Lorry(cliapp.Application): self.write_update_count(temp_repo, next_update_count) active_repo = temp_repo - except: + except: # noqa: E722 if active_repo is not None: os.rename(temp_repo, post_fail_backup_dir) self.output.write( @@ -946,7 +946,7 @@ class Lorry(cliapp.Application): pullurl = "%s/%s.git" % (self.settings["mirror-base-url-push"], project_name) try: self.run_program(["git", "fetch", pullurl, raw_file_refspecs], cwd=gitdir) - except: + except Exception: # TODO: Be more specific about which exceptions are fine pass @@ -1106,7 +1106,7 @@ class Lorry(cliapp.Application): self.progress( "%s: pruned %d unreachable commit(s)" % (marks_name, n_pruned) ) - except: + except: # noqa: E722 # On failure, delete temporary file os.unlink(marks_temp_name) raise diff --git a/lorry.gzip-importer b/lorry.gzip-importer index 4f4fb61..1830ff9 100755 --- a/lorry.gzip-importer +++ b/lorry.gzip-importer @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -## Copyright 2015, 2019-2020 Codethink Limited +# Copyright 2015, 2019-2020 Codethink Limited # gzip archive frontend for git-fast-import diff --git a/lorry.raw-file-importer b/lorry.raw-file-importer index c438e60..791e735 100755 --- a/lorry.raw-file-importer +++ b/lorry.raw-file-importer @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -## Copyright 2021 Codethink Limited +# Copyright 2021 Codethink Limited # raw file archive using git-lfs frontend for git-fast-import diff --git a/lorry.zip-importer b/lorry.zip-importer index 972ab2d..da70a08 100755 --- a/lorry.zip-importer +++ b/lorry.zip-importer @@ -1,17 +1,17 @@ #!/usr/bin/env python3 -## Copyright 2005-2015 Linus Torvalds and others -## Copyright 2015, 2019, 2020 Codethink Limited -## -## Based on git's contrib/fast-import/import-zips.py; modified for Lorry. - -## zip archive frontend for git-fast-import -## -## For example: -## -## mkdir project; cd project; git init -## python import-zips.py *.zip -## git log --stat import-zips +# Copyright 2005-2015 Linus Torvalds and others +# Copyright 2015, 2019, 2021 Codethink Limited +# +# Based on git's contrib/fast-import/import-zips.py; modified for Lorry. + +# zip archive frontend for git-fast-import +# +# For example: +# +# mkdir project; cd project; git init +# python import-zips.py *.zip +# git log --stat import-zips import calendar import os.path @@ -83,7 +83,7 @@ def export(zipfile, fast_import): info = zip.getinfo(name) commit_time = max(commit_time, zip_info_mtime(info)) - if common_prefix == None: + if common_prefix is None: common_prefix = name[: name.rfind("/") + 1] else: while not name.startswith(common_prefix): |