Skip to content

Commit 873d273

Browse files
committed
fix: improve formatting and readability in get_filesystem and BaseFileIO
1 parent f65d3d5 commit 873d273

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/flowerpower/fs/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,11 @@ def get_filesystem(
600600
if dirfs:
601601
base_path = path.split("://")[1]
602602
if fs.protocol == "dir":
603-
604603
if base_path != fs.path:
605604
fs = DirFileSystem(
606-
path=posixpath.join(fs.path, base_path.replace(fs.path, "").lstrip("/")),
605+
path=posixpath.join(
606+
fs.path, base_path.replace(fs.path, "").lstrip("/")
607+
),
607608
fs=fs.fs,
608609
)
609610
else:

src/flowerpower/plugins/io/base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __post_init__(self):
9292
fs=self.fs,
9393
dirfs=True,
9494
)
95-
95+
9696
self.storage_options = (
9797
self.storage_options or self.fs.storage_options
9898
if self.protocol != "dir"
@@ -120,10 +120,9 @@ def protocol(self):
120120
@property
121121
def _base_path(self) -> str:
122122
"""Get the base path for the filesystem."""
123-
return (
124-
self.path if isinstance(self.path, str) else os.path.commonpath(self.path)
125-
)
126-
123+
return (
124+
self.path if isinstance(self.path, str) else os.path.commonpath(self.path)
125+
)
127126

128127
@property
129128
def _path(self) -> str | list[str]:

0 commit comments

Comments
 (0)