forked from importers/git-importer
cleanups
This commit is contained in:
parent
28d5c6e606
commit
b0ffb01c59
@ -15,7 +15,7 @@ def config(filename="database.ini", section="production"):
|
||||
db[param[0]] = param[1]
|
||||
else:
|
||||
raise Exception(
|
||||
"Section {0} not found in the {1} file".format(section, filename)
|
||||
f"Section {section} not found in the {filename} file"
|
||||
)
|
||||
|
||||
return db
|
||||
|
@ -255,7 +255,7 @@ class DBRevision:
|
||||
self._files.sort(key=lambda x: x["name"])
|
||||
return self._files
|
||||
|
||||
def calc_delta(self, current_rev: Optional[DBRevision]):
|
||||
def calc_delta(self, current_rev: DBRevision | None):
|
||||
"""Calculate the list of files to download and to delete.
|
||||
Param current_rev is the revision that's currently checked out.
|
||||
If it's None, the repository is empty.
|
||||
|
@ -40,7 +40,7 @@ class GitExporter:
|
||||
def check_repo_state(self, flats, branch_state):
|
||||
state_data = dict()
|
||||
if os.path.exists(self.state_file):
|
||||
with open(self.state_file, "r") as f:
|
||||
with open(self.state_file) as f:
|
||||
state_data = yaml.safe_load(f)
|
||||
if type(state_data) != dict:
|
||||
state_data = {}
|
||||
|
@ -138,7 +138,7 @@ class TreeBuilder:
|
||||
self.requests.add(node.revision.request_id)
|
||||
|
||||
class FindMergeWalker(AbstractWalker):
|
||||
def __init__(self, builder: TreeBuilder, requests: Dict) -> None:
|
||||
def __init__(self, builder: TreeBuilder, requests: dict) -> None:
|
||||
super().__init__()
|
||||
self.source_revisions = dict()
|
||||
self.builder = builder
|
||||
|
Loading…
Reference in New Issue
Block a user