dekshell 0.2.14__tar.gz → 0.2.15__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.
- {dekshell-0.2.14 → dekshell-0.2.15}/PKG-INFO +1 -1
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/contexts/methods.py +18 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/pyproject.toml +1 -1
- {dekshell-0.2.14 → dekshell-0.2.15}/README.md +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/click/__entry__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/click/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/contexts/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/contexts/properties.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/base/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/base/core.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/commands.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/comment.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/define.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/echo.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/empty.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/env.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/exec.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/for_.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/function.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/if_.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/input.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/invoke.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/pip_.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/redirect.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/shell.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/var.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/markers/while_.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/plugin/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/core/redirect.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/utils/__init__.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/utils/beep.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/utils/cmd.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/utils/pkg.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/utils/serializer.py +0 -0
- {dekshell-0.2.14 → dekshell-0.2.15}/dekshell/utils/shell.py +0 -0
|
@@ -3,6 +3,7 @@ import shutil
|
|
|
3
3
|
import sys
|
|
4
4
|
import tempfile
|
|
5
5
|
import getpass
|
|
6
|
+
from importlib import import_module
|
|
6
7
|
from functools import reduce
|
|
7
8
|
from itertools import chain
|
|
8
9
|
from pathlib import Path
|
|
@@ -146,6 +147,21 @@ def _cd(path=None):
|
|
|
146
147
|
return path
|
|
147
148
|
|
|
148
149
|
|
|
150
|
+
def _pym(name):
|
|
151
|
+
try:
|
|
152
|
+
m = import_module(name)
|
|
153
|
+
return m.__file__
|
|
154
|
+
except ImportError:
|
|
155
|
+
return None
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def _pymd(name):
|
|
159
|
+
r = _pym(name)
|
|
160
|
+
if r:
|
|
161
|
+
return os.path.dirname(r)
|
|
162
|
+
return None
|
|
163
|
+
|
|
164
|
+
|
|
149
165
|
path_common_methods = {
|
|
150
166
|
'cd': _cd,
|
|
151
167
|
'cwd': lambda: os.getcwd(),
|
|
@@ -154,6 +170,8 @@ path_common_methods = {
|
|
|
154
170
|
'which_list': which_list,
|
|
155
171
|
'where_list': where_list,
|
|
156
172
|
'pybin': lambda x, p=None: search_bin_by_path_tree(p or os.getcwd(), x, False),
|
|
173
|
+
'pym': _pym,
|
|
174
|
+
'pymd': _pymd
|
|
157
175
|
}
|
|
158
176
|
|
|
159
177
|
default_methods = {
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|