Pythoner 0.1.0__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.
- pythoner/__init__.py +0 -0
- pythoner/cli.py +55 -0
- pythoner-0.1.0.dist-info/METADATA +32 -0
- pythoner-0.1.0.dist-info/RECORD +6 -0
- pythoner-0.1.0.dist-info/WHEEL +4 -0
- pythoner-0.1.0.dist-info/entry_points.txt +3 -0
pythoner/__init__.py
ADDED
|
File without changes
|
pythoner/cli.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from os import name
|
|
3
|
+
from subprocess import run
|
|
4
|
+
|
|
5
|
+
from prompt_toolkit import prompt
|
|
6
|
+
from prompt_toolkit.lexers import PygmentsLexer
|
|
7
|
+
from pygments.lexers import PythonLexer
|
|
8
|
+
from termcolor import colored
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def main():
|
|
12
|
+
platform = name
|
|
13
|
+
|
|
14
|
+
print(sys.version)
|
|
15
|
+
|
|
16
|
+
while True:
|
|
17
|
+
pyi = prompt("> ", lexer=PygmentsLexer(PythonLexer))
|
|
18
|
+
|
|
19
|
+
if pyi.lower() in ("exit", "exit()"):
|
|
20
|
+
break
|
|
21
|
+
|
|
22
|
+
elif pyi.lower() in ("cls", "clear"):
|
|
23
|
+
if platform == "nt":
|
|
24
|
+
run("cls", shell=True)
|
|
25
|
+
else:
|
|
26
|
+
run("clear", shell=True)
|
|
27
|
+
|
|
28
|
+
elif pyi.startswith(("pip ", "uv ")):
|
|
29
|
+
run(
|
|
30
|
+
pyi,
|
|
31
|
+
shell=True,
|
|
32
|
+
stdin=sys.stdin,
|
|
33
|
+
stdout=sys.stdout,
|
|
34
|
+
stderr=sys.stderr,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
else:
|
|
38
|
+
try:
|
|
39
|
+
exec(pyi)
|
|
40
|
+
|
|
41
|
+
except IndentationError:
|
|
42
|
+
block = [pyi]
|
|
43
|
+
|
|
44
|
+
while True:
|
|
45
|
+
extra = prompt("-> ", lexer=PygmentsLexer(PythonLexer))
|
|
46
|
+
|
|
47
|
+
if not extra:
|
|
48
|
+
break
|
|
49
|
+
|
|
50
|
+
block.append(extra)
|
|
51
|
+
|
|
52
|
+
exec("\n".join(block))
|
|
53
|
+
|
|
54
|
+
except Exception as e:
|
|
55
|
+
print(colored(f"{type(e).__name__}: {e}", "red"))
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: Pythoner
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A custom python REPL
|
|
5
|
+
Author: Cade
|
|
6
|
+
Author-email: Cade <cadey.matignas@gmail.com>
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Dist: prompt-toolkit>=3.0.38
|
|
11
|
+
Requires-Dist: pygments>=2.16.1
|
|
12
|
+
Requires-Dist: termcolor>=2.4.0
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Project-URL: Homepage, https://github.com/cadeymatignas-source/pysh
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# Pythoner
|
|
18
|
+
|
|
19
|
+
## A custom python REPL
|
|
20
|
+
|
|
21
|
+
Pythoner is a custom python REPL extracted from Pysh (You should go check that out too. Link is homepage) It has
|
|
22
|
+
|
|
23
|
+
- cls/clear function
|
|
24
|
+
- pip and uv intregration
|
|
25
|
+
- block handling
|
|
26
|
+
- syntax highlighting
|
|
27
|
+
|
|
28
|
+
### Notes
|
|
29
|
+
|
|
30
|
+
- It is not a calculator
|
|
31
|
+
- You have to manually indent
|
|
32
|
+
- It is like writing a python file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
pythoner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
pythoner/cli.py,sha256=936RFTuFYuT9bgCNaCbhPRE4CZ_3G11XX08shahCOeg,1036
|
|
3
|
+
pythoner-0.1.0.dist-info/WHEEL,sha256=VOHKyukui3UMeyUkkBf5F7N5xN_6X6W7zHVvalNVVvI,81
|
|
4
|
+
pythoner-0.1.0.dist-info/entry_points.txt,sha256=ODuMCM4fuirbia0HBTWXW11CbWM8jH1b0uzGsFDZRHY,48
|
|
5
|
+
pythoner-0.1.0.dist-info/METADATA,sha256=CH6cVdzSWLHBQkoBZ5Jl4to-3iwGnW2NxkkFRxeBWkQ,876
|
|
6
|
+
pythoner-0.1.0.dist-info/RECORD,,
|