efs-cli 1.2.2__tar.gz → 1.2.3__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.2.2/src/efs_cli.egg-info → efs_cli-1.2.3}/PKG-INFO +1 -1
- efs_cli-1.2.3/src/efs_cli/__init__.py +2 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/src/efs_cli/cli.py +6 -5
- {efs_cli-1.2.2 → efs_cli-1.2.3/src/efs_cli.egg-info}/PKG-INFO +1 -1
- efs_cli-1.2.2/src/efs_cli/__init__.py +0 -2
- {efs_cli-1.2.2 → efs_cli-1.2.3}/LICENSE +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/README.md +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/pyproject.toml +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/setup.cfg +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/src/efs_cli.egg-info/SOURCES.txt +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/src/efs_cli.egg-info/dependency_links.txt +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/src/efs_cli.egg-info/entry_points.txt +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/src/efs_cli.egg-info/requires.txt +0 -0
- {efs_cli-1.2.2 → efs_cli-1.2.3}/src/efs_cli.egg-info/top_level.txt +0 -0
|
@@ -2,6 +2,7 @@ from . import __version__ as version
|
|
|
2
2
|
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
|
+
from shutil import which
|
|
5
6
|
import os
|
|
6
7
|
import pathlib
|
|
7
8
|
from tempfile import NamedTemporaryFile
|
|
@@ -12,7 +13,7 @@ CONFIG_PATH = os.path.expanduser("~/.efs-cli_config.json")
|
|
|
12
13
|
if os.path.exists(os.path.expanduser("~/.config/")):
|
|
13
14
|
CONFIG_PATH = os.path.expanduser("~/.config/efs-cli.json")
|
|
14
15
|
|
|
15
|
-
DEFAULT_EDITOR = "
|
|
16
|
+
DEFAULT_EDITOR = "nano"
|
|
16
17
|
|
|
17
18
|
def exception_handler(func):
|
|
18
19
|
def wrapper(*args, **kwargs):
|
|
@@ -39,13 +40,13 @@ def get_conf():
|
|
|
39
40
|
|
|
40
41
|
if conf:
|
|
41
42
|
editor = conf.get("editor", DEFAULT_EDITOR)
|
|
42
|
-
|
|
43
|
+
editor = editor.split(" ")[0]
|
|
44
|
+
if which(editor):
|
|
45
|
+
conf.update({"editor": editor})
|
|
46
|
+
else:
|
|
43
47
|
print("editor path does not exist")
|
|
44
48
|
print(f"using default editor, {DEFAULT_EDITOR}")
|
|
45
49
|
conf.update({"editor": DEFAULT_EDITOR})
|
|
46
|
-
if "sudo" in editor or "rm" in editor:
|
|
47
|
-
print("no 'sudo' or 'rm' allowed in editor path")
|
|
48
|
-
sys.exit(1)
|
|
49
50
|
|
|
50
51
|
return conf
|
|
51
52
|
|
|
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
|