dekshell 0.2.21__py3-none-any.whl → 0.2.22__py3-none-any.whl

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.
@@ -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
  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
@@ -1,12 +1,12 @@
1
- dekshell-0.2.21.dist-info/METADATA,sha256=hMyPkDtXMgxohQMAE8K0woOezydn3-JXNBHnFD9kUdg,573
2
- dekshell-0.2.21.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- dekshell-0.2.21.dist-info/entry_points.txt,sha256=d-kbfULiUTZWIBBsrQF3J_-wESncF-4K2rwHT08grlI,75
1
+ dekshell-0.2.22.dist-info/METADATA,sha256=hcdopnmJAgC5TP6poIc9yTy4ETlQeFMJ-al3Z0kAD6g,573
2
+ dekshell-0.2.22.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ dekshell-0.2.22.dist-info/entry_points.txt,sha256=d-kbfULiUTZWIBBsrQF3J_-wESncF-4K2rwHT08grlI,75
4
4
  dekshell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  dekshell/click/__entry__.py,sha256=CMuxUzXoEe4TcHFZwv-MNFwHnu1HSZCDpXFpqQ814uM,42
6
6
  dekshell/click/__init__.py,sha256=rFzB_exzPQaIcbbms5PdHAU3NGdl2MBaYbq9v7g7BOI,1870
7
7
  dekshell/core/__init__.py,sha256=w-IeR-tO61Mv4ubZyw9LvyagudyD8SXH0YD3yKApNXk,5405
8
8
  dekshell/core/contexts/__init__.py,sha256=ynsfv37azOKfI2UKd0iPl2M6iBW-k5cb1BqSLOWuJpI,482
9
- dekshell/core/contexts/methods.py,sha256=6THhB6X6VqpHKLQIW3bOrd3J9yxHems2PRt8dR6xiT0,9344
9
+ dekshell/core/contexts/methods.py,sha256=J1xYu469PCDiCHcktBzERn_ankONavPmJVYerFBVjzQ,9499
10
10
  dekshell/core/contexts/properties.py,sha256=esr51c6wDTDsuFXF2uj7WfyIGSq9H0dzqDqWzeMTNQE,2382
11
11
  dekshell/core/markers/__init__.py,sha256=yAZJEIK7eeaZvlIDwTFe2d3yKZiTUVGJQbHOnhNFOMQ,1891
12
12
  dekshell/core/markers/base/__init__.py,sha256=Rcc77ToE4cFlJvGwezRez4nAcfbdzgAhDRHaew5wvk0,13456
@@ -25,7 +25,7 @@ dekshell/core/markers/if_.py,sha256=bBG1fDCZd5alE5FSm0QhgHl6ZJn5awiqZAXnPnO-thc,
25
25
  dekshell/core/markers/input.py,sha256=O0yvGtt1uhbpE2gOReLseAmshVpZYMW3zV-OabZt0lw,1182
26
26
  dekshell/core/markers/invoke.py,sha256=To_U_FscoCbf7osvjC5MQTk2gjH5Mu_-06Kb22YQPTo,1441
27
27
  dekshell/core/markers/pip_.py,sha256=mxXa_oqcrk4Qz-HvhlkMoirsl-SbM9Fz610leNqP1o0,832
28
- dekshell/core/markers/redirect.py,sha256=WGaWW-7efaCIOYhs3gQgtKJC4lmFsBx2AQ4bs5Bu_UQ,1828
28
+ dekshell/core/markers/redirect.py,sha256=3vfkRQ2tnQ6rSGGn7csgUlpDi0s2ep5X7JU7NVvo0eI,1984
29
29
  dekshell/core/markers/shell.py,sha256=43BDAAzMdmgZmemkW5buh_w4LL1GDGw-s9fNZo6vhag,1929
30
30
  dekshell/core/markers/var.py,sha256=O-lpWhnLOkKMwF1jR0rVwyHLa8YUWwacCs80wFzwfdQ,4838
31
31
  dekshell/core/markers/while_.py,sha256=e7lI5jsIM-qxNHMY_wUyCMvvesdXQibR5Ez2jNO9csc,1195
@@ -37,4 +37,4 @@ dekshell/utils/cmd.py,sha256=FfWNRRRdiiTs3xoXvaAyZ-3OzsWFRnd3m5k6sIexrhc,1209
37
37
  dekshell/utils/pkg.py,sha256=TgYqRqawoJfjkxt6UAHnp9ttmpjuHiWRFbqxADOS1VE,1337
38
38
  dekshell/utils/serializer.py,sha256=aIdF2Wzo-qHmIshv46jn1XD0X66vQ1JFdU-g3ZFbH2w,386
39
39
  dekshell/utils/shell.py,sha256=0NoA2-SOOMinbmZZipwzL-npBbzPOdWEfdPVYqq5G5g,92
40
- dekshell-0.2.21.dist-info/RECORD,,
40
+ dekshell-0.2.22.dist-info/RECORD,,