Skip to content

Commit

Permalink
fix linting error suggested by latest version of black
Browse files Browse the repository at this point in the history
  • Loading branch information
jsheunis committed May 23, 2024
1 parent 27034bd commit 55ef5e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
14 changes: 9 additions & 5 deletions datalad_catalog/extractors/catalog_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,15 @@ def ri2url(ri):
f["hostname"],
":" if f["port"] else "",
f["port"],
f["path"]
if op.isabs(f["path"])
else "/{}".format(f["path"])
if f["path"].startswith("~")
else "/~/{}".format(f["path"]),
(
f["path"]
if op.isabs(f["path"])
else (
"/{}".format(f["path"])
if f["path"].startswith("~")
else "/~/{}".format(f["path"])
)
),
)
elif isinstance(ri, dsn.PathRI):
# this has no chance of being resolved outside this machine
Expand Down
22 changes: 14 additions & 8 deletions datalad_catalog/extractors/catalog_runprov.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ def get_file_id(rec):
rec["key"]
if "key" in rec
else "SHA1-s{}--{}".format(
rec["bytesize"]
if "bytesize" in rec
else 0
if rec["type"] == "symlink"
else os.stat(rec["path"]).st_size,
rec["gitshasum"]
if "gitshasum" in rec
else Digester(digests=["sha1"])(rec["path"])["sha1"],
(
rec["bytesize"]
if "bytesize" in rec
else (
0
if rec["type"] == "symlink"
else os.stat(rec["path"]).st_size
)
),
(
rec["gitshasum"]
if "gitshasum" in rec
else Digester(digests=["sha1"])(rec["path"])["sha1"]
),
)
)
return "datalad:{}".format(id_)
Expand Down

0 comments on commit 55ef5e5

Please sign in to comment.