fss-cli 0.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fss_cli/__init__.py +24 -0
- fss_cli/_accounts.py +29 -0
- fss_cli/_app.py +663 -0
- fss_cli/_cat.py +391 -0
- fss_cli/_command.py +368 -0
- fss_cli/_concurrent.py +181 -0
- fss_cli/_content.py +94 -0
- fss_cli/_copy_file.py +65 -0
- fss_cli/_cp.py +740 -0
- fss_cli/_diagnostics.py +12 -0
- fss_cli/_du.py +90 -0
- fss_cli/_find.py +109 -0
- fss_cli/_head_tail.py +128 -0
- fss_cli/_info.py +179 -0
- fss_cli/_listing.py +289 -0
- fss_cli/_logging.py +72 -0
- fss_cli/_ls.py +435 -0
- fss_cli/_manifest.py +264 -0
- fss_cli/_metadata.py +70 -0
- fss_cli/_mkdir.py +97 -0
- fss_cli/_mv.py +146 -0
- fss_cli/_path.py +62 -0
- fss_cli/_post_copy.py +191 -0
- fss_cli/_progress.py +132 -0
- fss_cli/_recursive_cp.py +908 -0
- fss_cli/_recursive_rm.py +335 -0
- fss_cli/_results.py +115 -0
- fss_cli/_rm.py +149 -0
- fss_cli/_rmdir.py +148 -0
- fss_cli/_size.py +95 -0
- fss_cli/_sources.py +178 -0
- fss_cli/_stat.py +196 -0
- fss_cli/_test.py +59 -0
- fss_cli/_tree.py +208 -0
- fss_cli/_unlink.py +90 -0
- fss_cli/_walk.py +141 -0
- fss_cli-0.11.0.dist-info/METADATA +144 -0
- fss_cli-0.11.0.dist-info/RECORD +40 -0
- fss_cli-0.11.0.dist-info/WHEEL +4 -0
- fss_cli-0.11.0.dist-info/licenses/LICENSE +661 -0
fss_cli/__init__.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Library-only POSIX-shaped commands for async fsspec filesystems."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
from ._app import (
|
|
6
|
+
App,
|
|
7
|
+
AppCapabilities,
|
|
8
|
+
AsyncFilesystemSource,
|
|
9
|
+
CommandCallback,
|
|
10
|
+
CommandContext,
|
|
11
|
+
RecursionCapabilities,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
# Library default: records reach only the handlers a host configures.
|
|
15
|
+
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"App",
|
|
19
|
+
"AppCapabilities",
|
|
20
|
+
"AsyncFilesystemSource",
|
|
21
|
+
"CommandCallback",
|
|
22
|
+
"CommandContext",
|
|
23
|
+
"RecursionCapabilities",
|
|
24
|
+
]
|
fss_cli/_accounts.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Best-effort POSIX identity display shared by listing and stat."""
|
|
2
|
+
|
|
3
|
+
try:
|
|
4
|
+
import grp
|
|
5
|
+
import pwd
|
|
6
|
+
|
|
7
|
+
_HAS_ACCOUNT_DB = True
|
|
8
|
+
except ImportError: # pragma: no cover - POSIX-only account databases.
|
|
9
|
+
_HAS_ACCOUNT_DB = False
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def owner_name(uid: int) -> str:
|
|
13
|
+
"""Resolve ``uid`` to a local ``pwd`` account name, numeric when unavailable."""
|
|
14
|
+
if not _HAS_ACCOUNT_DB:
|
|
15
|
+
return str(uid)
|
|
16
|
+
try:
|
|
17
|
+
return pwd.getpwuid(uid).pw_name
|
|
18
|
+
except (KeyError, OverflowError, OSError):
|
|
19
|
+
return str(uid)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def group_name(gid: int) -> str:
|
|
23
|
+
"""Resolve ``gid`` to a local ``grp`` account name, numeric when unavailable."""
|
|
24
|
+
if not _HAS_ACCOUNT_DB:
|
|
25
|
+
return str(gid)
|
|
26
|
+
try:
|
|
27
|
+
return grp.getgrgid(gid).gr_name
|
|
28
|
+
except (KeyError, OverflowError, OSError):
|
|
29
|
+
return str(gid)
|