dekshell 0.2.47__py3-none-any.whl → 0.2.49__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.
@@ -22,7 +22,7 @@ from dektools.hash import hash_file
22
22
  from dektools.web.js.polyfill import atob, btoa
23
23
  from dektools.zip import compress_files, decompress_files
24
24
  from dektools.output import pprint, obj2str
25
- from dektools.net import get_available_port
25
+ from dektools.net import get_available_port, get_local_ip_list, get_interface_ip
26
26
  from dektools.func import FuncAnyArgs
27
27
  from dektools.fetch import download_file, download_content
28
28
  from dektools.download import download_from_http
@@ -239,7 +239,7 @@ path_common_methods = {
239
239
  'where': where,
240
240
  'which': lambda *x, **y: which(*x, **y) or '',
241
241
  'those': those,
242
- 'pybin': lambda x, p=None: search_bin_by_path_tree(p or os.getcwd(), x, False),
242
+ 'pybin': lambda x=None, p=None: search_bin_by_path_tree(p or os.getcwd(), x, False),
243
243
  'pym': _pym,
244
244
  'pymd': _pymd,
245
245
  'pyms': _pyms,
@@ -394,6 +394,8 @@ default_methods = {
394
394
  },
395
395
 
396
396
  'net': {
397
+ 'ip': get_interface_ip,
398
+ 'ips': get_local_ip_list,
397
399
  'port': get_available_port,
398
400
  'fetch': download_file,
399
401
  'download': download_from_http,
dekshell/core/redirect.py CHANGED
@@ -1,12 +1,13 @@
1
1
  import os
2
2
  import sys
3
- import shutil
4
3
  from dektools.sys import sys_paths_relative
5
- from dektools.file import normal_path
4
+ from dektools.file import normal_path, which
6
5
  from ..utils.shell import shell_name
7
6
 
8
7
 
9
- def search_bin_by_path_tree(filepath, bin_name, skip_self=True):
8
+ def search_bin_by_path_tree(filepath, bin_name=None, skip_self=True):
9
+ if not bin_name:
10
+ bin_name = os.path.basename(sys.executable)
10
11
  filepath = normal_path(filepath)
11
12
  cursor = os.path.dirname(filepath) if os.path.isfile(filepath) else filepath
12
13
  while True:
@@ -17,7 +18,7 @@ def search_bin_by_path_tree(filepath, bin_name, skip_self=True):
17
18
  return
18
19
  else:
19
20
  path_scripts = sys_paths_relative(path_venv)['scripts']
20
- path_exe = shutil.which(bin_name, path=path_scripts)
21
+ path_exe = which(bin_name, path_scripts)
21
22
  if path_exe:
22
23
  return path_exe
23
24
  dir_cursor = os.path.dirname(cursor)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dekshell
3
- Version: 0.2.47
3
+ Version: 0.2.49
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.47.dist-info/METADATA,sha256=EDMO6Fw8z-kgnnIGwEYm3zw9FnnTlvyNW78DYhzi1Bw,573
2
- dekshell-0.2.47.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- dekshell-0.2.47.dist-info/entry_points.txt,sha256=d-kbfULiUTZWIBBsrQF3J_-wESncF-4K2rwHT08grlI,75
1
+ dekshell-0.2.49.dist-info/METADATA,sha256=B57a2ZJyDlUu9H5Bd3LO7oy-NnrPQawYhl7uNBznU8A,573
2
+ dekshell-0.2.49.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ dekshell-0.2.49.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=ynsfv37azOKfI2UKd0iPl2M6iBW-k5cb1BqSLOWuJpI,482
9
- dekshell/core/contexts/methods.py,sha256=3Bzfv_t8At5MqR0xD7qT8zye6KQySeXr0HpwuendrdE,11789
9
+ dekshell/core/contexts/methods.py,sha256=t95CU8pjivYq5DtyjH__V7SH3HVj9iSJVI0Oy-esoUQ,11897
10
10
  dekshell/core/contexts/properties.py,sha256=TQonN3T_K2cB2uakq_DVVB13B-IFwoM6t2ZkL_OMekw,3365
11
11
  dekshell/core/markers/__init__.py,sha256=mK6OiZMWmUTrkAL0Bc1XqRTSb-NNhBgpHb7GLivLAlk,2235
12
12
  dekshell/core/markers/base/__init__.py,sha256=0LYnOVNXPBHfRQII00ZGkESTFX82TgHdSaTcHJoebXc,18051
@@ -30,11 +30,11 @@ dekshell/core/markers/shell.py,sha256=43BDAAzMdmgZmemkW5buh_w4LL1GDGw-s9fNZo6vha
30
30
  dekshell/core/markers/var.py,sha256=I1GQqDRDmWKV38Exfn_5MtRDz58FKo_6x8NIVHqPAPU,6901
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=6YCJpG0TkQ4WMt7LBtDD_W1T-C-QkLtGRQw0S60qe54,1058
33
+ dekshell/core/redirect.py,sha256=jgLdcPtc4RKs63Lf2I0LXJRr9jRfNu03aDB_tIWvcrU,1117
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.47.dist-info/RECORD,,
40
+ dekshell-0.2.49.dist-info/RECORD,,