dekshell 0.2.55__py3-none-any.whl → 0.2.57__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.
@@ -15,7 +15,7 @@ from dektools.file import sure_dir, write_file, read_text, remove_path, sure_par
15
15
  format_path_desc, read_file, split_ext, path_ext, clear_dir, copy_recurse_ignore, path_is_empty, \
16
16
  read_lines, seek_py_module_path, come_real_path, status_of_dir, diff_of_dir, path_parent, \
17
17
  split_file, combine_split_files, remove_split_files, meta_split_file, tree, iglob, \
18
- iter_dir_type, iter_dir_type_one, rc4_file, \
18
+ iter_dir_type, iter_dir_type_one, rc4_file, iter_relative_path, \
19
19
  where, which, those
20
20
  from dektools.venvx.active import activate_venv, is_venv_active
21
21
  from dektools.venvx.tools import find_venv_path, is_venv_path
@@ -321,6 +321,7 @@ default_methods = {
321
321
 
322
322
  'lsa': iter_dir_type,
323
323
  'lso': lambda path='.', file=None: iter_dir_type_one(path, file, ''),
324
+ 'lsr': iter_relative_path,
324
325
  'ls': lambda x='.': os.listdir(x),
325
326
 
326
327
  'iglob': iglob,
dekshell/core/redirect.py CHANGED
@@ -2,6 +2,7 @@ import os
2
2
  import sys
3
3
  from dektools.sys import sys_paths_relative
4
4
  from dektools.file import normal_path, which
5
+ from dektools.venvx.tools import find_venv_path
5
6
  from ..utils.shell import shell_name
6
7
 
7
8
 
@@ -11,16 +12,15 @@ def search_bin_by_path_tree(filepath, bin_name=None, skip_self=True):
11
12
  filepath = normal_path(filepath)
12
13
  cursor = os.path.dirname(filepath) if os.path.isfile(filepath) else filepath
13
14
  while True:
14
- for venv_name in ('venv', 'env', '.venv'):
15
- path_venv = os.path.join(cursor, venv_name)
16
- if os.path.isdir(path_venv):
17
- if skip_self and sys.prefix == path_venv:
18
- return
19
- else:
20
- path_scripts = sys_paths_relative(path_venv)['scripts']
21
- path_exe = which(bin_name, path_scripts)
22
- if path_exe:
23
- return path_exe
15
+ path_venv = find_venv_path(cursor)
16
+ if path_venv:
17
+ if skip_self and sys.prefix == path_venv:
18
+ return None
19
+ else:
20
+ path_scripts = sys_paths_relative(path_venv)['scripts']
21
+ path_exe = which(bin_name, path_scripts)
22
+ if path_exe:
23
+ return path_exe
24
24
  dir_cursor = os.path.dirname(cursor)
25
25
  if dir_cursor == cursor:
26
26
  break
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dekshell
3
- Version: 0.2.55
3
+ Version: 0.2.57
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.55.dist-info/METADATA,sha256=D0M4rNapFo_2Qki9huigS2b36kdgLaA14u0qtio3hoI,573
2
- dekshell-0.2.55.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- dekshell-0.2.55.dist-info/entry_points.txt,sha256=d-kbfULiUTZWIBBsrQF3J_-wESncF-4K2rwHT08grlI,75
1
+ dekshell-0.2.57.dist-info/METADATA,sha256=UC4cwt4pfDK_oWoNqI4swWU2ZpySRj8hUcm1SXE0LPE,573
2
+ dekshell-0.2.57.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ dekshell-0.2.57.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=r-AHdO9CEEVvTN20-8Jozr6Zh8XSv_BnktYRwrlhtrE,2046
7
7
  dekshell/core/__init__.py,sha256=isDEKwk1odLdvTQNCILCtVNBuXp1uFVPz_uTDNihkVU,5547
8
8
  dekshell/core/contexts/__init__.py,sha256=oBZhmXtSoOBgZPAHu6wiMCCW-yIdkC5mqSXqbvKYUy4,490
9
- dekshell/core/contexts/methods.py,sha256=-z94TUMKM7a2Jr3GqtXJhLbMMQEWWM0ji33Gfoz3Euk,12284
9
+ dekshell/core/contexts/methods.py,sha256=OngRFg2FTG21RjVvd2kguHbYTSLbmvfYQRof4xk7KNI,12339
10
10
  dekshell/core/contexts/properties.py,sha256=TQonN3T_K2cB2uakq_DVVB13B-IFwoM6t2ZkL_OMekw,3365
11
11
  dekshell/core/markers/__init__.py,sha256=1oq4wlBOJV56hsshPe0ZZZMvoItCV2Xs2RN08HTrbiY,2255
12
12
  dekshell/core/markers/base/__init__.py,sha256=CHD9vb8yGjnALimCwZJ2refbPB7zAE4FgQKLoRwzLrE,18037
@@ -30,11 +30,11 @@ dekshell/core/markers/shell.py,sha256=43BDAAzMdmgZmemkW5buh_w4LL1GDGw-s9fNZo6vha
30
30
  dekshell/core/markers/var.py,sha256=yA2T8dq4vbfyeaV1KOUt3YZp51WTC623NviMAJTOdOQ,8182
31
31
  dekshell/core/markers/while_.py,sha256=Q0SaElyXSrxg-wS_rfCcxMsmw9jf-0SgN1ICn860T4A,1201
32
32
  dekshell/core/plugin/__init__.py,sha256=jAB_KnnHJsyJR_zIfBU_HNLngyhcyyqVv05PdlNZtF8,428
33
- dekshell/core/redirect.py,sha256=jgLdcPtc4RKs63Lf2I0LXJRr9jRfNu03aDB_tIWvcrU,1117
33
+ dekshell/core/redirect.py,sha256=BTaEMRcKgaLG0j0lUc0QvEYRyaY4QUKboAbOJUqdQfw,1059
34
34
  dekshell/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  dekshell/utils/beep.py,sha256=teuQgHbWDr8BD1xCJ4Pt79X6N1-eq1tTlyGunK6wBIM,120
36
36
  dekshell/utils/cmd.py,sha256=K9FbXgHcGFchHA58xI0_t4YK4yb8XkWbxsNoztYRx3Y,518
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.55.dist-info/RECORD,,
40
+ dekshell-0.2.57.dist-info/RECORD,,