liveConsole 1.5.1__tar.gz → 1.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: liveConsole
3
- Version: 1.5.1
3
+ Version: 1.5.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
@@ -14,7 +14,7 @@ Dynamic: license-file
14
14
  # PYSOLE
15
15
 
16
16
  ## You can finally test your code in real time without using idle!
17
- ### If you found [this repository](https://github.com/TzurSoffer/LiveDebugger) useful, please give it a ⭐!.
17
+ ### If you found [this repository](https://github.com/TzurSoffer/Pysole) useful, please give it a ⭐!.
18
18
 
19
19
  A fully-featured, **live Python console GUI** built with **CustomTkinter** and **Tkinter**, featuring:
20
20
 
@@ -1,7 +1,7 @@
1
1
  # PYSOLE
2
2
 
3
3
  ## You can finally test your code in real time without using idle!
4
- ### If you found [this repository](https://github.com/TzurSoffer/LiveDebugger) useful, please give it a ⭐!.
4
+ ### If you found [this repository](https://github.com/TzurSoffer/Pysole) useful, please give it a ⭐!.
5
5
 
6
6
  A fully-featured, **live Python console GUI** built with **CustomTkinter** and **Tkinter**, featuring:
7
7
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "liveConsole"
3
- version = "1.5.1"
3
+ version = "1.5.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"}
@@ -9,8 +9,8 @@ requires-python = ">=3.7"
9
9
  dependencies = ["customtkinter", "pygments"]
10
10
 
11
11
  [project.scripts]
12
- liveconsole = "liveConsole:main"
13
- pysole = "pysole:main"
12
+ liveconsole = "liveConsole:_standalone"
13
+ pysole = "pysole:_standalone"
14
14
 
15
15
  [build-system]
16
16
  requires = ["setuptools>=61.0", "wheel"]
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: liveConsole
3
- Version: 1.5.1
3
+ Version: 1.5.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
@@ -14,7 +14,7 @@ Dynamic: license-file
14
14
  # PYSOLE
15
15
 
16
16
  ## You can finally test your code in real time without using idle!
17
- ### If you found [this repository](https://github.com/TzurSoffer/LiveDebugger) useful, please give it a ⭐!.
17
+ ### If you found [this repository](https://github.com/TzurSoffer/Pysole) useful, please give it a ⭐!.
18
18
 
19
19
  A fully-featured, **live Python console GUI** built with **CustomTkinter** and **Tkinter**, featuring:
20
20
 
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ liveconsole = liveConsole:_standalone
3
+ pysole = pysole:_standalone
@@ -34,7 +34,7 @@ class StdinRedirect(io.StringIO):
34
34
  class InteractiveConsole(ctk.CTk):
35
35
  """Main console window application."""
36
36
 
37
- def __init__(self, userGlobals=None, userLocals=None):
37
+ def __init__(self, userGlobals=None, userLocals=None, callerFrame=None):
38
38
  super().__init__()
39
39
 
40
40
  # Window setup
@@ -46,11 +46,12 @@ class InteractiveConsole(ctk.CTk):
46
46
 
47
47
  # Get namespace from caller if not provided
48
48
  if userGlobals is None or userLocals is None:
49
- callerFrame = inspect.currentframe().f_back
49
+ if callerFrame == None:
50
+ callerFrame = inspect.currentframe().f_back
50
51
  if userGlobals is None:
51
- userGlobals = callerFrame.f_globals
52
+ userGlobals = callerFrame.f_globals.copy()
52
53
  if userLocals is None:
53
- userLocals = callerFrame.f_locals
54
+ userLocals = callerFrame.f_locals.copy()
54
55
 
55
56
  self.userGlobals = userGlobals
56
57
  self.userLocals = userLocals
@@ -109,24 +110,17 @@ class InteractiveConsole(ctk.CTk):
109
110
  """Start the console main loop."""
110
111
  self.mainloop(*args, **kwargs)
111
112
 
112
- def probe():
113
- InteractiveConsole().probe()
113
+ def probe(userGlobals=None, userLocals=None, callerFrame=None):
114
+ if callerFrame == None:
115
+ callerFrame = inspect.currentframe().f_back
116
+ InteractiveConsole(userGlobals=userGlobals,
117
+ userLocals=userLocals,
118
+ callerFrame=callerFrame).probe()
114
119
 
115
- def main():
116
- from pysole import probe
117
- probe()
120
+ def _standalone():
121
+ import pysole
122
+ pysole.probe(callerFrame=inspect.currentframe().f_back)
118
123
 
119
124
  # Example usage
120
125
  if __name__ == "__main__":
121
- # Example variables and functions for testing
122
- foo = 42
123
-
124
- def greet(name):
125
- print(f"Hello {name}!")
126
- return(f"Greeted {name}")
127
-
128
- # Create the list for testing autocomplete
129
- exampleList = [1, 2, 3, 4, 5]
130
-
131
- # Start the console
132
- probe()
126
+ _standalone()
@@ -1 +0,0 @@
1
- from pysole import probe, InteractiveConsole
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- liveconsole = liveConsole:main
3
- pysole = pysole:main
File without changes
File without changes
File without changes