efs-cli 1.0.8__tar.gz → 1.0.9__tar.gz
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.
- {efs_cli-1.0.8 → efs_cli-1.0.9}/PKG-INFO +1 -1
- efs_cli-1.0.9/src/efs_cli/__init__.py +2 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/src/efs_cli/cli.py +14 -4
- {efs_cli-1.0.8 → efs_cli-1.0.9}/src/efs_cli.egg-info/PKG-INFO +1 -1
- efs_cli-1.0.8/src/efs_cli/__init__.py +0 -2
- {efs_cli-1.0.8 → efs_cli-1.0.9}/LICENSE +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/README.md +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/pyproject.toml +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/setup.cfg +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/src/efs_cli.egg-info/SOURCES.txt +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/src/efs_cli.egg-info/dependency_links.txt +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/src/efs_cli.egg-info/entry_points.txt +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/src/efs_cli.egg-info/requires.txt +0 -0
- {efs_cli-1.0.8 → efs_cli-1.0.9}/src/efs_cli.egg-info/top_level.txt +0 -0
|
@@ -3,6 +3,7 @@ from efs_wrapper import __version__ as wrapper_version
|
|
|
3
3
|
from efs_wrapper.v1 import EepyFileServer, EepyFileServerPublic, DiskUsageObject
|
|
4
4
|
from argparse import ArgumentParser, Namespace
|
|
5
5
|
import os
|
|
6
|
+
from tempfile import NamedTemporaryFile
|
|
6
7
|
import json
|
|
7
8
|
import sys
|
|
8
9
|
|
|
@@ -15,10 +16,12 @@ def exception_handler(func):
|
|
|
15
16
|
try:
|
|
16
17
|
func(*args, **kwargs)
|
|
17
18
|
except Exception as exc:
|
|
18
|
-
if
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if len(exc.args) == 2:
|
|
20
|
+
if isinstance(exc.args[1], int):
|
|
21
|
+
print(f"Error: {exc.args[0]}")
|
|
22
|
+
sys.exit(1)
|
|
21
23
|
print(f"Error: {exc.__class__.__name__}: {exc}")
|
|
24
|
+
sys.exit(1)
|
|
22
25
|
return wrapper
|
|
23
26
|
|
|
24
27
|
def get_conf():
|
|
@@ -66,7 +69,14 @@ def download(from_path, to_path, public, **__):
|
|
|
66
69
|
def read(file_path, **__):
|
|
67
70
|
api = init_api()
|
|
68
71
|
file = api.get_file(file_path)
|
|
69
|
-
|
|
72
|
+
_file = file.fetch_file()
|
|
73
|
+
if sys.platform in ["linux", "darwin"]:
|
|
74
|
+
with NamedTemporaryFile() as tmp:
|
|
75
|
+
tmp.write(_file.load())
|
|
76
|
+
tmp.seek(0)
|
|
77
|
+
os.system(f"less {tmp.name}")
|
|
78
|
+
else:
|
|
79
|
+
print(_file.load().decode("utf-8"))
|
|
70
80
|
|
|
71
81
|
@exception_handler
|
|
72
82
|
def upload(from_path, to_path, **__):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|