liveConsole 1.7.0__tar.gz → 1.7.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.
- {liveconsole-1.7.0/src/liveConsole.egg-info → liveconsole-1.7.2}/PKG-INFO +1 -1
- {liveconsole-1.7.0 → liveconsole-1.7.2}/pyproject.toml +1 -1
- {liveconsole-1.7.0 → liveconsole-1.7.2/src/liveConsole.egg-info}/PKG-INFO +1 -1
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/pysole.py +37 -9
- {liveconsole-1.7.0 → liveconsole-1.7.2}/LICENSE +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/MANIFEST.in +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/README.md +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/setup.cfg +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/liveConsole.egg-info/SOURCES.txt +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/liveConsole.egg-info/dependency_links.txt +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/liveConsole.egg-info/entry_points.txt +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/liveConsole.egg-info/requires.txt +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/liveConsole.egg-info/top_level.txt +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/__init__.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/__main__.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/commandHistory.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/helpTab.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/liveConsole.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/mainConsole.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/settings.json +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/styledTextbox.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/suggestionManager.py +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/themes.json +0 -0
- {liveconsole-1.7.0 → liveconsole-1.7.2}/src/pysole/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "liveConsole"
|
|
3
|
-
version = "1.7.
|
|
3
|
+
version = "1.7.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"}
|
|
@@ -39,8 +39,9 @@ class InteractiveConsole(ctk.CTk):
|
|
|
39
39
|
"""Main console window application."""
|
|
40
40
|
|
|
41
41
|
def __init__(self, userGlobals=None, userLocals=None, callerFrame=None,
|
|
42
|
-
defaultSize=None, primaryPrompt=None,
|
|
43
|
-
runRemainingCode=False, printStartupCode=
|
|
42
|
+
defaultSize=None, primaryPrompt=None, font=None, fontSize=None,
|
|
43
|
+
runRemainingCode=False, printStartupCode=False,
|
|
44
|
+
removeWaterMark=False):
|
|
44
45
|
super().__init__()
|
|
45
46
|
with open(settingsPath, "r") as f:
|
|
46
47
|
settings = json.load(f)
|
|
@@ -52,6 +53,10 @@ class InteractiveConsole(ctk.CTk):
|
|
|
52
53
|
self.BEHAVIOR["PRIMARY_PROMPT"] = primaryPrompt
|
|
53
54
|
if defaultSize != None:
|
|
54
55
|
self.BEHAVIOR["DEFAULT_SIZE"] = defaultSize
|
|
56
|
+
if font != None:
|
|
57
|
+
self.FONT["FONT"] = font
|
|
58
|
+
if fontSize != None:
|
|
59
|
+
self.FONT["FONT_SIZE"] = fontSize
|
|
55
60
|
|
|
56
61
|
self.title("Live Interactive Console")
|
|
57
62
|
self.geometry(self.BEHAVIOR["DEFAULT_SIZE"])
|
|
@@ -79,7 +84,10 @@ class InteractiveConsole(ctk.CTk):
|
|
|
79
84
|
self._setupOutputRedirect()
|
|
80
85
|
self._setupInputRedirect()
|
|
81
86
|
|
|
87
|
+
self.runRemainingCode = runRemainingCode
|
|
82
88
|
self.printStartupCode = printStartupCode
|
|
89
|
+
self.leadingWhitespaceLen = 0
|
|
90
|
+
self.removeWaterMark = removeWaterMark
|
|
83
91
|
self.startupCode = ()
|
|
84
92
|
if runRemainingCode:
|
|
85
93
|
code_obj = callerFrame.f_code
|
|
@@ -89,8 +97,10 @@ class InteractiveConsole(ctk.CTk):
|
|
|
89
97
|
with open(filename, "r", encoding="utf-8") as f:
|
|
90
98
|
lines = f.readlines()
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
startLineIndex = callerFrame.f_lineno
|
|
101
|
+
startLine = lines[startLineIndex - 1]
|
|
102
|
+
self.leadingWhitespaceLen = len(startLine) - len(startLine.lstrip())
|
|
103
|
+
self.startupCode = lines[startLineIndex:]
|
|
94
104
|
|
|
95
105
|
def _createMenu(self):
|
|
96
106
|
"""Create a menu bar using CTkOptionMenu."""
|
|
@@ -254,10 +264,27 @@ class InteractiveConsole(ctk.CTk):
|
|
|
254
264
|
def probe(self, *args, **kwargs):
|
|
255
265
|
"""Start the console main loop."""
|
|
256
266
|
def runStartup():
|
|
257
|
-
self.
|
|
258
|
-
|
|
267
|
+
if not self.removeWaterMark:
|
|
268
|
+
m = (
|
|
269
|
+
"Welcome to Pysole, if you find me useful, please star me on GitHub:\n"
|
|
270
|
+
"https://github.com/TzurSoffer/Pysole"
|
|
271
|
+
)
|
|
272
|
+
stdPrint(m)
|
|
273
|
+
self.console.newline()
|
|
274
|
+
self.console.writeOutput(m, "instruction")
|
|
275
|
+
time.sleep(0.1)
|
|
276
|
+
if self.runRemainingCode:
|
|
277
|
+
if self.printStartupCode:
|
|
278
|
+
self.console.addPrompt()
|
|
279
|
+
else:
|
|
280
|
+
self.console.newline()
|
|
281
|
+
else:
|
|
282
|
+
self.console.addPrompt()
|
|
283
|
+
elif self.runRemainingCode == True and self.printStartupCode == False:
|
|
284
|
+
self.console.newline()
|
|
285
|
+
|
|
259
286
|
for line in self.startupCode:
|
|
260
|
-
line = line.rstrip()
|
|
287
|
+
line = line.rstrip()[self.leadingWhitespaceLen:]
|
|
261
288
|
while self.console.isExecuting:
|
|
262
289
|
time.sleep(0.01)
|
|
263
290
|
if self.printStartupCode:
|
|
@@ -265,13 +292,14 @@ class InteractiveConsole(ctk.CTk):
|
|
|
265
292
|
else:
|
|
266
293
|
self.console.runCommand(line, printCommand=False)
|
|
267
294
|
|
|
268
|
-
if self.printStartupCode == False:
|
|
295
|
+
if self.runRemainingCode == True and self.printStartupCode == False:
|
|
269
296
|
self.console.resetCurrentLineNumber()
|
|
270
297
|
self.console.addPrompt()
|
|
271
298
|
threading.Thread(target=runStartup).start()
|
|
272
299
|
self.mainloop(*args, **kwargs)
|
|
273
300
|
|
|
274
|
-
def probe(userGlobals=None, userLocals=None, callerFrame=None,
|
|
301
|
+
def probe(userGlobals=None, userLocals=None, callerFrame=None,
|
|
302
|
+
runRemainingCode=False, printStartupCode=False, **kwargs):
|
|
275
303
|
if callerFrame == None:
|
|
276
304
|
callerFrame = inspect.currentframe().f_back
|
|
277
305
|
InteractiveConsole(userGlobals=userGlobals,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|