xmyshell 0.2.17__tar.gz → 0.2.18__tar.gz

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.
Files changed (28) hide show
  1. {xmyshell-0.2.17/xmyshell.egg-info → xmyshell-0.2.18}/PKG-INFO +10 -1
  2. {xmyshell-0.2.17 → xmyshell-0.2.18}/README.md +9 -0
  3. {xmyshell-0.2.17 → xmyshell-0.2.18}/pyproject.toml +1 -1
  4. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/environment.py +1 -0
  5. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/kernel.py +1 -1
  6. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/meta.py +3 -0
  7. {xmyshell-0.2.17 → xmyshell-0.2.18/xmyshell.egg-info}/PKG-INFO +10 -1
  8. {xmyshell-0.2.17 → xmyshell-0.2.18}/LICENSE +0 -0
  9. {xmyshell-0.2.17 → xmyshell-0.2.18}/setup.cfg +0 -0
  10. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/__init__.py +0 -0
  11. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/__main__.py +0 -0
  12. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/completer.py +0 -0
  13. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/data/commands.json +0 -0
  14. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/init.py +0 -0
  15. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/injection.py +0 -0
  16. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/keybindings.py +0 -0
  17. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/main.py +0 -0
  18. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/stubs/__init__.py +0 -0
  19. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/stubs/__init__.pyi +0 -0
  20. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/stubs/py.typed +0 -0
  21. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/themes.py +0 -0
  22. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/update.py +0 -0
  23. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell/utils.py +0 -0
  24. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell.egg-info/SOURCES.txt +0 -0
  25. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell.egg-info/dependency_links.txt +0 -0
  26. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell.egg-info/entry_points.txt +0 -0
  27. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell.egg-info/requires.txt +0 -0
  28. {xmyshell-0.2.17 → xmyshell-0.2.18}/xmyshell.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xmyshell
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: XmyShell is a shell-like tool built on top of prompt_toolkit which provides a persistent Python runtime.
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -163,6 +163,15 @@ The exit code of the last command.
163
163
  - `exec_duration`
164
164
  The duration which last command took.
165
165
 
166
+ - `last_error`
167
+ The error raised from last Python operation (if exists).
168
+
169
+ - `last_traceback`
170
+ The traceback of last Python operation (if exists).
171
+
172
+ - `ans`
173
+ The result from last print command.
174
+
166
175
  - `SHOW_WELCOME`
167
176
  Toggle whether to show welcome message when staring.
168
177
 
@@ -153,6 +153,15 @@ The exit code of the last command.
153
153
  - `exec_duration`
154
154
  The duration which last command took.
155
155
 
156
+ - `last_error`
157
+ The error raised from last Python operation (if exists).
158
+
159
+ - `last_traceback`
160
+ The traceback of last Python operation (if exists).
161
+
162
+ - `ans`
163
+ The result from last print command.
164
+
156
165
  - `SHOW_WELCOME`
157
166
  Toggle whether to show welcome message when staring.
158
167
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xmyshell"
3
- version = "0.2.17"
3
+ version = "0.2.18"
4
4
  description = "XmyShell is a shell-like tool built on top of prompt_toolkit which provides a persistent Python runtime."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -43,6 +43,7 @@ _init_namespace: dict[str, Any] = {
43
43
  "exec_duration": 0,
44
44
  "last_error": None,
45
45
  "last_traceback": None,
46
+ "ans": None,
46
47
  "shell_prompt": "",
47
48
  "shell_rprompt": "",
48
49
  "prompt_placeholder": "",
@@ -189,10 +189,10 @@ def xmyshell_raw_command(cmd_line: str) -> int | None:
189
189
  result = eval(expr, dict(os.environ), namespace)
190
190
  print(result)
191
191
  namespace["last_error"] = None
192
+ namespace["ans"] = result
192
193
  return 0
193
194
  except Exception as e:
194
195
  import traceback
195
-
196
196
  namespace["last_error"] = e
197
197
  namespace["last_traceback"] = traceback.format_exc()
198
198
  pyerror(f"{type(e).__name__}: {e}")
@@ -57,6 +57,9 @@ Helper Functions:
57
57
  Built-in variables:
58
58
  exit_code - The exit code of the last command.
59
59
  exec_duration - The duration which last command took.
60
+ last_error - The error raised from last Python operation (if exists).
61
+ last_traceback - The traceback of last Python operation (if exists).
62
+ ans - The result from last print command.
60
63
  HOME_DIR - The home directory, similar to "~".
61
64
  PROFILE - The path of config file.
62
65
  SHOW_WELCOME - Toggle whether to show welcome message.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xmyshell
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: XmyShell is a shell-like tool built on top of prompt_toolkit which provides a persistent Python runtime.
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -163,6 +163,15 @@ The exit code of the last command.
163
163
  - `exec_duration`
164
164
  The duration which last command took.
165
165
 
166
+ - `last_error`
167
+ The error raised from last Python operation (if exists).
168
+
169
+ - `last_traceback`
170
+ The traceback of last Python operation (if exists).
171
+
172
+ - `ans`
173
+ The result from last print command.
174
+
166
175
  - `SHOW_WELCOME`
167
176
  Toggle whether to show welcome message when staring.
168
177
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes