dekshell 0.2.21__tar.gz → 0.2.22__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.
Files changed (39) hide show
  1. {dekshell-0.2.21 → dekshell-0.2.22}/PKG-INFO +1 -1
  2. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/contexts/methods.py +9 -1
  3. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/redirect.py +8 -2
  4. {dekshell-0.2.21 → dekshell-0.2.22}/pyproject.toml +1 -1
  5. {dekshell-0.2.21 → dekshell-0.2.22}/README.md +0 -0
  6. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/__init__.py +0 -0
  7. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/click/__entry__.py +0 -0
  8. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/click/__init__.py +0 -0
  9. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/__init__.py +0 -0
  10. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/contexts/__init__.py +0 -0
  11. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/contexts/properties.py +0 -0
  12. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/__init__.py +0 -0
  13. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/base/__init__.py +0 -0
  14. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/base/core.py +0 -0
  15. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/base/shell.py +0 -0
  16. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/commands.py +0 -0
  17. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/comment.py +0 -0
  18. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/define.py +0 -0
  19. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/echo.py +0 -0
  20. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/empty.py +0 -0
  21. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/env.py +0 -0
  22. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/exec.py +0 -0
  23. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/for_.py +0 -0
  24. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/function.py +0 -0
  25. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/if_.py +0 -0
  26. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/input.py +0 -0
  27. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/invoke.py +0 -0
  28. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/pip_.py +0 -0
  29. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/shell.py +0 -0
  30. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/var.py +0 -0
  31. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/markers/while_.py +0 -0
  32. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/plugin/__init__.py +0 -0
  33. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/core/redirect.py +0 -0
  34. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/utils/__init__.py +0 -0
  35. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/utils/beep.py +0 -0
  36. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/utils/cmd.py +0 -0
  37. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/utils/pkg.py +0 -0
  38. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/utils/serializer.py +0 -0
  39. {dekshell-0.2.21 → dekshell-0.2.22}/dekshell/utils/shell.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dekshell
3
- Version: 0.2.21
3
+ Version: 0.2.22
4
4
  Author-Email: sanzenwin <sanzenwin@gmail.com>
5
5
  License: MIT
6
6
  Requires-Python: >=3.8
@@ -175,6 +175,14 @@ def _pymd(name):
175
175
  return None
176
176
 
177
177
 
178
+ def _pyms(path=None):
179
+ if not path:
180
+ path = _eval_mixin('fp', None)
181
+ if not path:
182
+ path = os.getcwd()
183
+ return seek_py_module_path(path)
184
+
185
+
178
186
  def _time_mark(begin=True, name=None):
179
187
  var_prefix = '__time_marker__'
180
188
  if name is None:
@@ -202,7 +210,7 @@ path_common_methods = {
202
210
  'pybin': lambda x, p=None: search_bin_by_path_tree(p or os.getcwd(), x, False),
203
211
  'pym': _pym,
204
212
  'pymd': _pymd,
205
- 'pyms': seek_py_module_path,
213
+ 'pyms': _pyms,
206
214
  }
207
215
 
208
216
  default_methods = {
@@ -11,13 +11,19 @@ class MarkerRedirect(MarkerBase):
11
11
  def execute(self, context, command, marker_node, marker_set):
12
12
  filepath = self.split_raw(command, 1, self.tag_head)[1]
13
13
  if not filepath:
14
- filepath = self.eval(context, 'fp')
14
+ filepath = self.get_filepath(context)
15
15
  path_shell = redirect_shell_by_path_tree(filepath)
16
16
  self.execute_core(context, marker_node, marker_set, path_shell)
17
17
 
18
18
  def execute_core(self, context, marker_node, marker_set, path_shell):
19
19
  raise NotImplementedError
20
20
 
21
+ def get_filepath(self, context):
22
+ try:
23
+ return self.eval(context, "fp")
24
+ except NameError:
25
+ return os.getcwd()
26
+
21
27
 
22
28
  class RedirectMarker(MarkerRedirect):
23
29
  tag_head = "redirect"
@@ -27,7 +33,7 @@ class RedirectMarker(MarkerRedirect):
27
33
  if path_shell:
28
34
  shell_properties = make_shell_properties(path_shell)
29
35
  if shell_properties['shell'] != current_shell:
30
- fp = self.eval(context, "fp")
36
+ fp = self.get_filepath(context)
31
37
  fpp = os.path.dirname(fp).replace('/', os.sep)
32
38
  shell = shell_properties['sh']['rfc' if os.getcwd() == fpp else 'rf']
33
39
  args, kwargs = self.eval(context, f'({key_args}, {key_kwargs})')
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dekshell"
3
- version = "0.2.21"
3
+ version = "0.2.22"
4
4
  description = ""
5
5
  authors = [
6
6
  { name = "sanzenwin", email = "sanzenwin@gmail.com" },
File without changes