dekshell 0.2.34__py3-none-any.whl → 0.2.35__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
  read_lines, seek_py_module_path, come_real_path, status_of_dir, diff_of_dir, path_parent, \
16
16
  split_file, combine_split_files, remove_split_files, meta_split_file, tree, iglob, \
17
17
  iter_dir_type, iter_dir_type_one, \
18
- where, where_list, which, which_list
18
+ where, which, those
19
19
  from dektools.hash import hash_file
20
20
  from dektools.zip import compress_files, decompress_files
21
21
  from dektools.output import pprint, obj2str
@@ -23,7 +23,7 @@ from dektools.net import get_available_port
23
23
  from dektools.func import FuncAnyArgs
24
24
  from dektools.fetch import download_file, download_content
25
25
  from dektools.download import download_from_http
26
- from dektools.ps.process import process_detail, process_kill, process_list_all
26
+ from dektools.ps.process import process_print_all, process_print_detail, process_detail, process_query, process_username
27
27
  from dektools.time import now
28
28
  from dektools.str import shlex_split, shlex_quote, str_split, split_table_line
29
29
  from dektools.format import format_duration
@@ -218,10 +218,9 @@ def _time_mark(begin=True, name=None):
218
218
  path_common_methods = {
219
219
  'cd': _cd,
220
220
  'cwd': lambda: os.getcwd(),
221
- 'which': lambda *x: which(*x) or '',
222
- 'where': lambda *x: where(*x) or '',
223
- 'which_list': which_list,
224
- 'where_list': where_list,
221
+ 'where': where,
222
+ 'which': lambda *x, **y: which(*x, **y) or '',
223
+ 'those': those,
225
224
  'pybin': lambda x, p=None: search_bin_by_path_tree(p or os.getcwd(), x, False),
226
225
  'pym': _pym,
227
226
  'pymd': _pymd,
@@ -243,7 +242,7 @@ default_methods = {
243
242
  'install': _install,
244
243
  'Path': Path,
245
244
  'split': {
246
- 'str': lambda x, y=None: list(str_split(x, y)),
245
+ 'str': lambda x, y=None: str_split(x, y),
247
246
  'tab': split_table_line,
248
247
  },
249
248
  'sh': {
@@ -305,9 +304,10 @@ default_methods = {
305
304
  'end': lambda name=None: _time_mark(False, name),
306
305
  },
307
306
  'pu': {
308
- 'ps': process_list_all,
309
- 'kill': process_kill,
310
- 'pi': process_detail,
307
+ 'ps': process_print_all,
308
+ 'pd': process_print_detail,
309
+ 'detail': process_detail,
310
+ 'query': lambda x: list(process_query(x)),
311
311
  },
312
312
 
313
313
  'sys': {
@@ -4,6 +4,7 @@ import shutil
4
4
  import tempfile
5
5
  import sysconfig
6
6
  import platform
7
+ import getpass
7
8
  from pathlib import Path
8
9
  from sysconfig import get_paths
9
10
  from importlib import metadata
@@ -12,6 +13,8 @@ from dektools.module import ModuleProxy
12
13
  from dektools.time import DateTime
13
14
  from dektools.file import read_text
14
15
  from dektools.env import is_on_cicd
16
+ from dektools.ps.process import process_attrs
17
+ from dektools.extraction.filter.utils import Method, MethodSimple, AttrProxy
15
18
  from ...utils.serializer import serializer
16
19
  from ..redirect import shell_name
17
20
  from ..markers.base.core import get_inner_vars
@@ -82,6 +85,7 @@ default_properties = {
82
85
  'pid': os.getpid(),
83
86
  'ps': os.pathsep,
84
87
  'cicd': is_on_cicd(),
88
+ 'username': getpass.getuser(),
85
89
  },
86
90
  'platform': {
87
91
  'cygwin': sys.platform == 'cygwin',
@@ -100,9 +104,15 @@ default_properties = {
100
104
  'temp': Path(tempfile.gettempdir()),
101
105
  'sep': os.sep
102
106
  },
107
+ 'pu': {
108
+ 'attrs': process_attrs
109
+ },
103
110
  'obj': serializer,
104
111
  'mp': ModuleProxy(),
105
112
  'date': DateTime(),
106
113
  'env': _Env(),
107
114
  'envs': _EnvS(),
115
+ 'm': Method(),
116
+ 'mm': MethodSimple(),
117
+ 'a': AttrProxy(),
108
118
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dekshell
3
- Version: 0.2.34
3
+ Version: 0.2.35
4
4
  Author-Email: sanzenwin <sanzenwin@gmail.com>
5
5
  License: MIT
6
6
  Requires-Python: >=3.8
@@ -1,13 +1,13 @@
1
- dekshell-0.2.34.dist-info/METADATA,sha256=zWGgLEakc8grPiDUwQN0-88q2aJlG-EmPGLfNq648Q4,573
2
- dekshell-0.2.34.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- dekshell-0.2.34.dist-info/entry_points.txt,sha256=d-kbfULiUTZWIBBsrQF3J_-wESncF-4K2rwHT08grlI,75
1
+ dekshell-0.2.35.dist-info/METADATA,sha256=hDvwRVi1ZNokJ-7ORpier5GMGRIADdI1qi8DJyFoU5c,573
2
+ dekshell-0.2.35.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ dekshell-0.2.35.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=lnlGFMv23R9J-W22lcwwBTgO5E8mbSNuu5fPT7HylLo,10518
10
- dekshell/core/contexts/properties.py,sha256=wT_gvK89JDU3NDOwiQKz4e2ukrLG6yXUhBsOk8NMQpE,3123
9
+ dekshell/core/contexts/methods.py,sha256=KxCVtJV3NXFKuCB-MYnQ2EJgFoegRwx5gtTGsmN-64g,10548
10
+ dekshell/core/contexts/properties.py,sha256=R6TBvQAH4IIkLZV8wfroUXguy9cxYsKmPEE_FCV2dA8,3417
11
11
  dekshell/core/markers/__init__.py,sha256=yRQazZ1dxMltFao_RQnDnawSnQcjN_4B930MjJhaZ40,1968
12
12
  dekshell/core/markers/base/__init__.py,sha256=W5f_Mcn9MLM8kOVqu05NUaDpn3xUNURe_NYerUoH6Js,16021
13
13
  dekshell/core/markers/base/core.py,sha256=InsUA3md2gC6GyXQsvARfeNTrfbVD3gGOYxTM8VqqPA,11679
@@ -37,4 +37,4 @@ 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.34.dist-info/RECORD,,
40
+ dekshell-0.2.35.dist-info/RECORD,,