dekshell 0.2.8__py3-none-any.whl → 0.2.10__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.
@@ -26,6 +26,7 @@ from dektools.shell import shell_wrapper, is_user_admin
26
26
  from dektools.match import GeneralMatcher, glob2re, glob_compile, glob_match
27
27
  from dektools.cmd.git import git_clean_dir, git_apply, git_parse_modules, git_fetch_min, git_list_remotes, git_head
28
28
  from ...utils.beep import sound_notify
29
+ from ...utils.cmd import ak2cmd
29
30
  from ..markers.base.core import MarkerBase, get_inner_vars
30
31
  from ..markers.invoke import InvokeMarker, GotoMarker
31
32
  from ..redirect import search_bin_by_path_tree
@@ -137,8 +138,15 @@ def _io(x=None):
137
138
  return BytesIO(x) if isinstance(x, bytes) else StringIO(x)
138
139
 
139
140
 
141
+ def _cd(path=None):
142
+ if path is None:
143
+ path = os.path.expanduser('~')
144
+ os.chdir(path)
145
+ return path
146
+
147
+
140
148
  path_common_methods = {
141
- 'cd': os.chdir,
149
+ 'cd': _cd,
142
150
  'cwd': lambda: os.getcwd(),
143
151
  'which': lambda *x: which(*x) or '',
144
152
  'where': lambda *x: where(*x) or '',
@@ -207,7 +215,8 @@ default_methods = {
207
215
  },
208
216
 
209
217
  'sys': {
210
- 'utf8': lambda: sys.stdout.reconfigure(encoding='utf-8')
218
+ 'utf8': lambda: sys.stdout.reconfigure(encoding='utf-8'),
219
+ 'ak':ak2cmd,
211
220
  },
212
221
 
213
222
  'compress': compress_files,
dekshell/utils/cmd.py CHANGED
@@ -21,7 +21,7 @@ def cmd2ak(argv): # arg0 arg-\-1 k0--kwarg0 k1--kwarg1
21
21
  return args, kwargs
22
22
 
23
23
 
24
- def ak2cmd(args, kwargs=None):
24
+ def ak2cmd(args=None, kwargs=None):
25
25
  result = []
26
26
  if args:
27
27
  for arg in args:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dekshell
3
- Version: 0.2.8
3
+ Version: 0.2.10
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.8.dist-info/METADATA,sha256=4N6K8QJYyai4ThQCYaaRcVtyc1-Zbd06je1Sjk8UQgE,572
2
- dekshell-0.2.8.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- dekshell-0.2.8.dist-info/entry_points.txt,sha256=d-kbfULiUTZWIBBsrQF3J_-wESncF-4K2rwHT08grlI,75
1
+ dekshell-0.2.10.dist-info/METADATA,sha256=cRd7RWmafj5szwIsLrVLXREM-GfEgetWHiLzrBiPpIk,573
2
+ dekshell-0.2.10.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ dekshell-0.2.10.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=ZAJtMPFCVClHCPkoP5rmTq1vVLLMQRa8MP-QJXLBgNM,5337
8
8
  dekshell/core/contexts/__init__.py,sha256=ynsfv37azOKfI2UKd0iPl2M6iBW-k5cb1BqSLOWuJpI,482
9
- dekshell/core/contexts/methods.py,sha256=TuuN9Exln31E5R6SP3dBrpefrRymbU2lYMmfggCua4M,7373
9
+ dekshell/core/contexts/methods.py,sha256=nCOhaUdg1uVm1c-70wgHjzF-s3TL6S7E3U52I9nocGE,7539
10
10
  dekshell/core/contexts/properties.py,sha256=6rEQjExvAmZ69OfhPLLIQwnynRzAjX0nIbcBuZ5yuzM,2314
11
11
  dekshell/core/markers/__init__.py,sha256=BRp4z_IkbwV7xQr-5wugd7GCCyGp8k4z_p8qRgVjKxw,1850
12
12
  dekshell/core/markers/base/__init__.py,sha256=To25RVX3h1MluV3OmktVMw2bigex79GjWHUPWtIlczI,13433
@@ -32,8 +32,8 @@ dekshell/core/plugin/__init__.py,sha256=jAB_KnnHJsyJR_zIfBU_HNLngyhcyyqVv05PdlNZ
32
32
  dekshell/core/redirect.py,sha256=6YCJpG0TkQ4WMt7LBtDD_W1T-C-QkLtGRQw0S60qe54,1058
33
33
  dekshell/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  dekshell/utils/beep.py,sha256=teuQgHbWDr8BD1xCJ4Pt79X6N1-eq1tTlyGunK6wBIM,120
35
- dekshell/utils/cmd.py,sha256=akykpgPCovXpvavKF28G-eNM3mOZ4TY0LlSWGozDp34,1204
35
+ dekshell/utils/cmd.py,sha256=FfWNRRRdiiTs3xoXvaAyZ-3OzsWFRnd3m5k6sIexrhc,1209
36
36
  dekshell/utils/pkg.py,sha256=TgYqRqawoJfjkxt6UAHnp9ttmpjuHiWRFbqxADOS1VE,1337
37
37
  dekshell/utils/serializer.py,sha256=aIdF2Wzo-qHmIshv46jn1XD0X66vQ1JFdU-g3ZFbH2w,386
38
38
  dekshell/utils/shell.py,sha256=0NoA2-SOOMinbmZZipwzL-npBbzPOdWEfdPVYqq5G5g,92
39
- dekshell-0.2.8.dist-info/RECORD,,
39
+ dekshell-0.2.10.dist-info/RECORD,,