efs-cli 1.1.0__tar.gz → 1.1.2__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.1.0 → efs_cli-1.1.2}/PKG-INFO +2 -2
- {efs_cli-1.1.0 → efs_cli-1.1.2}/pyproject.toml +2 -2
- efs_cli-1.1.2/src/efs_cli/__init__.py +2 -0
- {efs_cli-1.1.0 → efs_cli-1.1.2}/src/efs_cli/cli.py +17 -7
- {efs_cli-1.1.0 → efs_cli-1.1.2}/src/efs_cli.egg-info/PKG-INFO +2 -2
- efs_cli-1.1.2/src/efs_cli.egg-info/requires.txt +2 -0
- efs_cli-1.1.0/src/efs_cli/__init__.py +0 -2
- efs_cli-1.1.0/src/efs_cli.egg-info/requires.txt +0 -2
- {efs_cli-1.1.0 → efs_cli-1.1.2}/LICENSE +0 -0
- {efs_cli-1.1.0 → efs_cli-1.1.2}/README.md +0 -0
- {efs_cli-1.1.0 → efs_cli-1.1.2}/setup.cfg +0 -0
- {efs_cli-1.1.0 → efs_cli-1.1.2}/src/efs_cli.egg-info/SOURCES.txt +0 -0
- {efs_cli-1.1.0 → efs_cli-1.1.2}/src/efs_cli.egg-info/dependency_links.txt +0 -0
- {efs_cli-1.1.0 → efs_cli-1.1.2}/src/efs_cli.egg-info/entry_points.txt +0 -0
- {efs_cli-1.1.0 → efs_cli-1.1.2}/src/efs_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: efs-cli
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: EepyFileServer API CLI written in Python
|
|
5
5
|
Author: maxie
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.10
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: requests>=2.30
|
|
20
|
-
Requires-Dist: efs-wrapper>=1.0.
|
|
20
|
+
Requires-Dist: efs-wrapper>=1.0.6
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
# efs-cli (formerly eepyfileserver-cli)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools >= 77.0.3", "requests >= 2.30", "efs-wrapper >= 1.0.
|
|
2
|
+
requires = ["setuptools >= 77.0.3", "requests >= 2.30", "efs-wrapper >= 1.0.6"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -12,7 +12,7 @@ readme = "README.md"
|
|
|
12
12
|
requires-python = ">=3.10"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"requests >= 2.30",
|
|
15
|
-
"efs-wrapper >= 1.0.
|
|
15
|
+
"efs-wrapper >= 1.0.6"
|
|
16
16
|
]
|
|
17
17
|
classifiers = [
|
|
18
18
|
"Programming Language :: Python :: 3",
|
|
@@ -42,8 +42,9 @@ def init_api():
|
|
|
42
42
|
sys.exit(1)
|
|
43
43
|
|
|
44
44
|
base_url = conf.get("base_url")
|
|
45
|
+
custom_api_path = conf.get("custom_api_path", "/api/v1")
|
|
45
46
|
password = conf.get("password", None)
|
|
46
|
-
efs = EepyFileServerPublic(base_url, ignore_initialization = True) if password is None else EepyFileServer(base_url, password, ignore_initialization = True)
|
|
47
|
+
efs = EepyFileServerPublic(base_url, custom_api_path, ignore_initialization = True) if password is None else EepyFileServer(base_url, password, custom_api_path, ignore_initialization = True)
|
|
47
48
|
return efs
|
|
48
49
|
|
|
49
50
|
@exception_handler
|
|
@@ -51,7 +52,7 @@ def config(reset, **__):
|
|
|
51
52
|
conf = get_conf()
|
|
52
53
|
if conf is None or reset:
|
|
53
54
|
with open(CONFIG_PATH, "w") as file:
|
|
54
|
-
json.dump({"base_url": None, "password": None, "editor": "nano"}, file)
|
|
55
|
+
json.dump({"base_url": None, "password": None, "custom_api_path": "/api/v1", "editor": "nano"}, file)
|
|
55
56
|
if reset:
|
|
56
57
|
print("Config reset")
|
|
57
58
|
sys.exit(0)
|
|
@@ -83,9 +84,16 @@ def efs_config(verbose, **__):
|
|
|
83
84
|
print("Config saved successfully")
|
|
84
85
|
|
|
85
86
|
@exception_handler
|
|
86
|
-
def auth(base_url, password, **__):
|
|
87
|
+
def auth(base_url, password, custom_api_path, **__):
|
|
87
88
|
conf = get_conf()
|
|
88
|
-
|
|
89
|
+
if custom_api_path is None:
|
|
90
|
+
custom_api_path = "/api/v1"
|
|
91
|
+
if custom_api_path.endswith("/"):
|
|
92
|
+
custom_api_path = custom_api_path[:-1]
|
|
93
|
+
if base_url.endswith("/"):
|
|
94
|
+
base_url = base_url[:-1]
|
|
95
|
+
|
|
96
|
+
data = {"base_url": base_url, "password": password, "custom_api_path": custom_api_path, "editor": "nano"}
|
|
89
97
|
|
|
90
98
|
if conf is not None:
|
|
91
99
|
conf.update(data)
|
|
@@ -155,9 +163,9 @@ def upload(from_path, to_path, **__):
|
|
|
155
163
|
sys.exit(1)
|
|
156
164
|
|
|
157
165
|
@exception_handler
|
|
158
|
-
def list_files(**__):
|
|
166
|
+
def list_files(path, **__):
|
|
159
167
|
api = init_api()
|
|
160
|
-
print(api.get_filelist())
|
|
168
|
+
print(api.get_filelist(path))
|
|
161
169
|
|
|
162
170
|
@exception_handler
|
|
163
171
|
def remove(file_path, **__):
|
|
@@ -237,6 +245,7 @@ def main():
|
|
|
237
245
|
auth_parser = subparser.add_parser("auth", help="authorize to eepyfileserver", aliases=["login"])
|
|
238
246
|
auth_parser.add_argument("base_url", help="the base url of your eepyfileserver instance")
|
|
239
247
|
auth_parser.add_argument("password", nargs="?", help="password to login in your eepyfileserver instance", default=None)
|
|
248
|
+
auth_parser.add_argument("-c", "--custom-api-path", nargs="?", help="custom api path, default is /api/v1", default=None)
|
|
240
249
|
auth_parser.set_defaults(func=auth)
|
|
241
250
|
|
|
242
251
|
download_parser = subparser.add_parser("download", help="download a file", aliases=["get", "d"])
|
|
@@ -266,6 +275,7 @@ def main():
|
|
|
266
275
|
metadata_parser.set_defaults(func=metadata)
|
|
267
276
|
|
|
268
277
|
list_files_parser = subparser.add_parser("list", help="list current files on efs", aliases=["ls", "files"])
|
|
278
|
+
list_files_parser.add_argument("path", nargs="?", help="the efs path to list files from", default=None)
|
|
269
279
|
list_files_parser.set_defaults(func=list_files)
|
|
270
280
|
|
|
271
281
|
remove_parser = subparser.add_parser("delete", help="delete a file", aliases=["remove", "rm"])
|
|
@@ -284,7 +294,7 @@ def main():
|
|
|
284
294
|
urlfor_parser.add_argument("-c", "--check-if-exists", action="store_true", help="check if the file exists before returning the url")
|
|
285
295
|
urlfor_parser.set_defaults(func=url_for)
|
|
286
296
|
|
|
287
|
-
config_parser = subparser.add_parser("cli-config", help="view or change your cli config", aliases=["conf"])
|
|
297
|
+
config_parser = subparser.add_parser("cli-config", help="view or change your cli config", aliases=["conf", "config"])
|
|
288
298
|
config_parser.add_argument("--reset", action="store_true", help="if set, resets your ENTIRE config")
|
|
289
299
|
config_parser.set_defaults(func=config)
|
|
290
300
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: efs-cli
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: EepyFileServer API CLI written in Python
|
|
5
5
|
Author: maxie
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.10
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: requests>=2.30
|
|
20
|
-
Requires-Dist: efs-wrapper>=1.0.
|
|
20
|
+
Requires-Dist: efs-wrapper>=1.0.6
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
# efs-cli (formerly eepyfileserver-cli)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|