replbase 0.0.70__tar.gz → 0.0.72__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.1
2
2
  Name: replbase
3
- Version: 0.0.70
3
+ Version: 0.0.72
4
4
  Summary: "Combination of other REPL tools into a reusable class that generates a REPL"
5
5
  License: MIT
6
6
  Author: Joseph Bochinski
@@ -9,9 +9,10 @@ Requires-Python: >=3.12,<4.0
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.12
12
+ Requires-Dist: jbutils (>=0.1.47,<0.2.0)
12
13
  Requires-Dist: prompt-toolkit (>=3.0.48,<4.0.0)
13
14
  Requires-Dist: ptpython (>=3.0.29,<4.0.0)
14
- Requires-Dist: rich (>=13.9.4,<14.0.0)
15
+ Requires-Dist: rich (>=14.1.0,<15.0.0)
15
16
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
16
17
  Description-Content-Type: text/markdown
17
18
 
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "replbase"
7
- version = "0.0.70"
7
+ version = "0.0.72"
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"
@@ -14,5 +14,9 @@ readme = "README.md"
14
14
  python = "^3.12"
15
15
  prompt-toolkit = "^3.0.48"
16
16
  ptpython = "^3.0.29"
17
- rich = "^13.9.4"
18
17
  tabulate = "^0.9.0"
18
+ jbutils = "^0.1.47"
19
+ rich = "^14.1.0"
20
+
21
+ [tool.poetry.scripts]
22
+ replbase = "replbase.cli:main"
@@ -0,0 +1,27 @@
1
+ """CLI path for Replbase repo"""
2
+
3
+ import argparse
4
+ import os
5
+
6
+ from jbutils import jbutils
7
+ from rich.console import Console
8
+
9
+ DIR = os.path.dirname(__file__)
10
+ SRC_PATH = os.path.join(DIR, "repl_base.py")
11
+
12
+
13
+ def main() -> None:
14
+ """Main function"""
15
+
16
+ parser = argparse.ArgumentParser(description=__doc__)
17
+ parse_args = jbutils.add_common_args(parser, SRC_PATH)
18
+
19
+ args = parse_args()
20
+
21
+ console = Console()
22
+ val = console.input("Enter a value [1]: (y/n)\n")
23
+ console.print(val)
24
+
25
+
26
+ if __name__ == "__main__":
27
+ main()
@@ -152,7 +152,7 @@ class ReplTheme(Theme):
152
152
  exit_kw: str = "bold green"
153
153
  exit_str: str = "cyan"
154
154
  greeting: str = "cyan"
155
- addl_styles: dict = None
155
+ addl_styles: dict | None = None
156
156
 
157
157
  def __post_init__(self) -> None:
158
158
  styles = dict(vars(self))
@@ -166,48 +166,48 @@ class ReplTheme(Theme):
166
166
  class ReplBase:
167
167
  """Dataclass for CLI options"""
168
168
 
169
- debug_enabled: bool = None
169
+ debug_enabled: bool | None = None
170
170
  """Debug mode enabled"""
171
171
 
172
- title: str = None
172
+ title: str | None = None
173
173
  """Title of the CLI REPL Prompt"""
174
174
 
175
- exit_keywords: list[str] = None
175
+ exit_keywords: list[str] | None = None
176
176
  """List of strings that cause the REPL to close, defaults to x, q,
177
177
  exit, and quit"""
178
178
 
179
- init_prompt: str | list[str] = None
179
+ init_prompt: str | list[str] | None = None
180
180
  """Prompt to display at startup"""
181
181
 
182
- color_system: ColorSystem = None
182
+ color_system: ColorSystem | None = None
183
183
  """Color syste for the rich console"""
184
184
 
185
- theme: ReplTheme | dict = None
185
+ theme: ReplTheme | dict | None = None
186
186
 
187
- console: Console = None
187
+ console: Console | None = None
188
188
  """ Rich Console instance """
189
189
 
190
- history: str = None
190
+ history: str | None = None
191
191
  """Path to the prompt history file"""
192
192
 
193
- temp_file: str = None
193
+ temp_file: str | None = None
194
194
  """Path to prompt temporary file"""
195
195
 
196
- style: dict | Style = None
196
+ style: dict | Style | None = None
197
197
  """Style for the prompt"""
198
198
 
199
- ignore_case: bool = None
199
+ ignore_case: bool | None = None
200
200
  """Ignore case setting for the WordCompleter instance"""
201
201
 
202
- commands: dict[str, ReplCommand] = None
202
+ commands: dict[str, ReplCommand] | None = None
203
203
  """Command dictionary for prompt_toolkit. Keys are command names,
204
204
  values are the corresponding description/help text"""
205
205
 
206
206
  docstring_format: str = "google"
207
207
 
208
- parent: ReplBase | dict = None
208
+ parent: ReplBase | dict | None = None
209
209
 
210
- session: PromptSession = None
210
+ session: PromptSession | None = None
211
211
 
212
212
  cmd_defs: dict[str, CommandMeta] = field(default_factory=dict)
213
213
 
@@ -496,7 +496,7 @@ class ReplBase:
496
496
  name = func.__name__
497
497
  self.add_command(name, func, help_txt=help_text)
498
498
 
499
- def setup_cmds_2(self, *cmd_names: list[str], hyphenate: bool = True):
499
+ def setup_cmds_2(self, *cmd_names: str, hyphenate: bool = True):
500
500
  for name in cmd_names:
501
501
  self.gen_command(name, hyphenate=hyphenate)
502
502
 
File without changes
File without changes