Skip to content

Commit

Permalink
Merge branch 'develop' into tooling/add-isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolite authored Jul 18, 2023
2 parents 91b0d3d + 14413aa commit 5363431
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ repos:
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args:
- "--py38-plus"

2 changes: 1 addition & 1 deletion src/rok4/Pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def list_generator(self) -> Iterator[Tuple[Tuple[SlabType, str, int, int], Dict]
roots = {}
s3_cluster = self.storage_s3_cluster

with open(list_file, "r") as listin:
with open(list_file) as listin:
# Lecture des racines
for line in listin:
line = line.rstrip()
Expand Down
12 changes: 4 additions & 8 deletions src/rok4/Storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,11 +941,9 @@ def link(target_path: str, link_path: str, hard: bool = False) -> None:

try:
target_s3_client["client"].put_object(
Body=f"{__OBJECT_SYMLINK_SIGNATURE}{target_bucket}/{target_base_name}".encode(
"utf-8"
),
Bucket=link_bucket,
Key=link_base_name,
Body = f"{__OBJECT_SYMLINK_SIGNATURE}{target_bucket}/{target_base_name}".encode(),
Bucket = link_bucket,
Key = link_base_name
)
except Exception as e:
raise StorageError("S3", e)
Expand All @@ -954,9 +952,7 @@ def link(target_path: str, link_path: str, hard: bool = False) -> None:
ioctx = __get_ceph_ioctx(link_tray)

try:
ioctx.write_full(
link_base_name, f"{__OBJECT_SYMLINK_SIGNATURE}{target_path}".encode("utf-8")
)
ioctx.write_full(link_base_name, f"{__OBJECT_SYMLINK_SIGNATURE}{target_path}".encode())
except Exception as e:
raise StorageError("CEPH", e)

Expand Down

0 comments on commit 5363431

Please sign in to comment.