liveConsole 1.6.0__tar.gz → 1.6.2__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.

Potentially problematic release.


This version of liveConsole might be problematic. Click here for more details.

Files changed (26) hide show
  1. {liveconsole-1.6.0/src/liveConsole.egg-info → liveconsole-1.6.2}/PKG-INFO +1 -1
  2. {liveconsole-1.6.0 → liveconsole-1.6.2}/pyproject.toml +1 -1
  3. {liveconsole-1.6.0 → liveconsole-1.6.2/src/liveConsole.egg-info}/PKG-INFO +1 -1
  4. liveconsole-1.6.2/src/pysole/__init__.py +1 -0
  5. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/mainConsole.py +36 -5
  6. liveconsole-1.6.2/src/pysole/settings.json +25 -0
  7. liveconsole-1.6.0/src/pysole/__init__.py +0 -1
  8. liveconsole-1.6.0/src/pysole/settings.json +0 -25
  9. {liveconsole-1.6.0 → liveconsole-1.6.2}/LICENSE +0 -0
  10. {liveconsole-1.6.0 → liveconsole-1.6.2}/MANIFEST.in +0 -0
  11. {liveconsole-1.6.0 → liveconsole-1.6.2}/README.md +0 -0
  12. {liveconsole-1.6.0 → liveconsole-1.6.2}/setup.cfg +0 -0
  13. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/liveConsole.egg-info/SOURCES.txt +0 -0
  14. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/liveConsole.egg-info/dependency_links.txt +0 -0
  15. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/liveConsole.egg-info/entry_points.txt +0 -0
  16. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/liveConsole.egg-info/requires.txt +0 -0
  17. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/liveConsole.egg-info/top_level.txt +0 -0
  18. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/__main__.py +0 -0
  19. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/commandHistory.py +0 -0
  20. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/helpTab.py +0 -0
  21. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/liveConsole.py +0 -0
  22. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/pysole.py +0 -0
  23. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/styledTextbox.py +0 -0
  24. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/suggestionManager.py +0 -0
  25. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/themes.json +0 -0
  26. {liveconsole-1.6.0 → liveconsole-1.6.2}/src/pysole/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: liveConsole
3
- Version: 1.6.0
3
+ Version: 1.6.2
4
4
  Summary: An IDLE-like debugger to allow for real-time command injection for debugging and testing python code
5
5
  Author-email: Tzur Soffer <tzur.soffer@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "liveConsole"
3
- version = "1.6.0"
3
+ version = "1.6.2"
4
4
  description = "An IDLE-like debugger to allow for real-time command injection for debugging and testing python code"
5
5
  authors = [{ name="Tzur Soffer", email="tzur.soffer@gmail.com" }]
6
6
  license = {text = "MIT"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: liveConsole
3
- Version: 1.6.0
3
+ Version: 1.6.2
4
4
  Summary: An IDLE-like debugger to allow for real-time command injection for debugging and testing python code
5
5
  Author-email: Tzur Soffer <tzur.soffer@gmail.com>
6
6
  License: MIT
@@ -0,0 +1 @@
1
+ from .pysole import probe, _standalone, InteractiveConsole
@@ -23,6 +23,7 @@ class InteractiveConsoleText(StyledTextWindow):
23
23
 
24
24
  self.inputVar = tk.StringVar()
25
25
  self.waitingForInput = False
26
+ self.inputLine = "1.0"
26
27
 
27
28
  # Track current command
28
29
  self.currentCommandLine = 1
@@ -41,6 +42,7 @@ class InteractiveConsoleText(StyledTextWindow):
41
42
  self.bind("<Control-c>", self.cancel)
42
43
  self.bind("<Tab>", self.onTab)
43
44
  self.bind("<BackSpace>", self.onBackspace)
45
+ self.bind("<Delete>", self.onDelete)
44
46
  self.bind("<KeyRelease>", self.onKeyRelease)
45
47
  self.bind("<KeyPress>", self.onKeyPress)
46
48
  self.bind("<Button-1>", self.onClick)
@@ -64,9 +66,13 @@ class InteractiveConsoleText(StyledTextWindow):
64
66
  end = "end-1c"
65
67
 
66
68
  self.delete(start, end)
67
- self.insert(start, newCommand)
69
+ if newCommand:
70
+ self.insert(start, newCommand)
71
+ self.mark_set("insert", "end")
68
72
  self.see("end")
69
-
73
+ # Ensure styling/lexer applied after programmatic change:
74
+ self.updateStyling(start=self.getPromptPosition())
75
+
70
76
  def isCursorInEditableArea(self):
71
77
  """Check if cursor is in the editable command area."""
72
78
  if self.isExecuting:
@@ -120,10 +126,11 @@ class InteractiveConsoleText(StyledTextWindow):
120
126
  def readInput(self):
121
127
  """Return the last entered line when input() is called."""
122
128
  self.waitingForInput = True
129
+ self.inputLine = self.index("end -1c")
123
130
  self.wait_variable(self.inputVar) #< waits until Enter is pressed
124
131
  line = self.inputVar.get()
125
132
  self.inputVar.set("") #< reset
126
- return(line)
133
+ return(line or "\n")
127
134
 
128
135
  def onShiftEnter(self, event):
129
136
  """Handle Shift+Enter - new line with auto-indent."""
@@ -162,15 +169,35 @@ class InteractiveConsoleText(StyledTextWindow):
162
169
 
163
170
  def onBackspace(self, event):
164
171
  """Prevent backspace from deleting the prompt."""
172
+
173
+ if self.waitingForInput: #< During input mode, only allow editing after input start
174
+ if self.compare("insert", "<=", self.inputLine):
175
+ return "break"
176
+ return None
177
+
165
178
  if not self.isCursorInEditableArea():
166
- return("break")
179
+ return "break"
167
180
 
168
181
  # Check if we're at the prompt boundary
169
182
  cursorPos = self.index("insert")
170
183
  promptPos = self.getPromptPosition()
171
184
 
172
185
  if self.compare(cursorPos, "<=", promptPos):
186
+ return "break"
187
+
188
+ return None
189
+
190
+ def onDelete(self, event):
191
+ """Prevent delete from deleting protected content."""
192
+ if self.waitingForInput: #< During input mode, only allow editing after input start
193
+ if self.compare("insert", "<=", self.inputLine):
194
+ return("break")
195
+ return(None)
196
+
197
+ if not self.isCursorInEditableArea():
173
198
  return("break")
199
+
200
+ return(None)
174
201
 
175
202
  def onClick(self, event):
176
203
  """Handle mouse clicks - Ctrl+Click opens help for the clicked word."""
@@ -206,7 +233,11 @@ class InteractiveConsoleText(StyledTextWindow):
206
233
 
207
234
  def onKeyPress(self, event):
208
235
  """Handle key press events."""
209
- # print(event.keysym)
236
+ if self.waitingForInput: #< During input mode, only allow editing after input start
237
+ if (self.compare("insert", "<=", self.inputLine) and event.keysym == "Left"):
238
+ return("break")
239
+ return(None)
240
+
210
241
  if self.suggestionManager.suggestionWindow and \
211
242
  self.suggestionManager.suggestionWindow.winfo_viewable():
212
243
  if event.keysym == "Escape":
@@ -0,0 +1,25 @@
1
+ {
2
+ "THEME": {
3
+ "APPEARANCE": "dark",
4
+ "LEXER_STYLE": "monokai",
5
+ "BACKGROUND": "#1e1e1e",
6
+ "HIGHLIGHTED_BACKGROUND": "#0078d7",
7
+ "FOREGROUND": "white",
8
+ "HIGHLIGHTED_FOREGROUND": "black",
9
+ "INSERTBACKGROUND": "white",
10
+ "PROMPT": "#00ff00",
11
+ "OUTPUT": "#ffffff",
12
+ "ERROR": "#ff0000",
13
+ "RESULT": "#66ccff",
14
+ "SUGGESTION_BOX_BG": "#2d2d2d",
15
+ "SUGGESTION_BOX_SELECTION_BG": "#0066cc",
16
+ "FONT": {
17
+ "FONT": "Consolas",
18
+ "FONT_SIZE": 12
19
+ }
20
+ },
21
+ "BEHAVIOR": {
22
+ "DEFAULT_SIZE": "900x600",
23
+ "PRIMARY_PROMPT": ">>> "
24
+ }
25
+ }
@@ -1 +0,0 @@
1
- from .pysole import probe, InteractiveConsole
@@ -1,25 +0,0 @@
1
- {
2
- "THEME": {
3
- "APPEARANCE": "dark",
4
- "LEXER_STYLE": "dracula",
5
- "BACKGROUND": "#282a36",
6
- "HIGHLIGHTED_BACKGROUND": "#44475a",
7
- "FOREGROUND": "#f8f8f2",
8
- "HIGHLIGHTED_FOREGROUND": "#ffffff",
9
- "INSERTBACKGROUND": "#f8f8f2",
10
- "PROMPT": "#50fa7b",
11
- "OUTPUT": "#f8f8f2",
12
- "ERROR": "#ff5555",
13
- "RESULT": "#8be9fd",
14
- "SUGGESTION_BOX_BG": "#44475a",
15
- "SUGGESTION_BOX_SELECTION_BG": "#6272a4",
16
- "FONT": {
17
- "FONT": "Consolas",
18
- "FONT_SIZE": 12
19
- }
20
- },
21
- "BEHAVIOR": {
22
- "DEFAULT_SIZE": "900x600",
23
- "PRIMARY_PROMPT": ">>> "
24
- }
25
- }
File without changes
File without changes
File without changes
File without changes