replbase 0.0.26__tar.gz → 0.0.28__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.
- {replbase-0.0.26 → replbase-0.0.28}/PKG-INFO +1 -1
- {replbase-0.0.26 → replbase-0.0.28}/pyproject.toml +1 -1
- {replbase-0.0.26 → replbase-0.0.28}/replbase/repl_base.py +13 -1
- {replbase-0.0.26 → replbase-0.0.28}/LICENSE +0 -0
- {replbase-0.0.26 → replbase-0.0.28}/README.md +0 -0
- {replbase-0.0.26 → replbase-0.0.28}/replbase/__init__.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "replbase"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.28"
|
|
8
8
|
description = "\"Combination of other REPL tools into a reusable class that generates a REPL\""
|
|
9
9
|
authors = [ "Joseph Bochinski <stirgejr@gmail.com>",]
|
|
10
10
|
license = "MIT"
|
|
@@ -127,6 +127,14 @@ def convert_size(size_bytes):
|
|
|
127
127
|
return f"{s}{size_name[i]}"
|
|
128
128
|
|
|
129
129
|
|
|
130
|
+
def setvar(name: str, var: Any) -> None:
|
|
131
|
+
globals()[name] = var
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def setfunc(func: Callable) -> None:
|
|
135
|
+
globals()[func.__name__] = func
|
|
136
|
+
|
|
137
|
+
|
|
130
138
|
@dataclass
|
|
131
139
|
class ReplTheme(Theme):
|
|
132
140
|
title: str = "bold cyan"
|
|
@@ -484,7 +492,11 @@ class ReplBase:
|
|
|
484
492
|
"""Starts an interactive session from within the class"""
|
|
485
493
|
if kwargs:
|
|
486
494
|
globals().update(kwargs)
|
|
487
|
-
embed(
|
|
495
|
+
embed(
|
|
496
|
+
globals(),
|
|
497
|
+
locals(),
|
|
498
|
+
history_filename=os.path.expanduser(f"~/.{self.title}_history"),
|
|
499
|
+
)
|
|
488
500
|
|
|
489
501
|
def show_help(self) -> None:
|
|
490
502
|
"""Print out the provided help text"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|