Compare commits
No commits in common. "b3ebc340ca02bfb577f12c9b679c4cad75576566" and "ef4ba93ea20210b7c4ec6ba39ae6274f3e7a7aed" have entirely different histories.
b3ebc340ca
...
ef4ba93ea2
25 changed files with 281 additions and 1379 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,8 +1,9 @@
|
|||
.cache/*
|
||||
.cache/**
|
||||
__pycache__/**
|
||||
.upm
|
||||
venv/**
|
||||
**/__pycache__/**
|
||||
.pythonlibs/**
|
||||
.config/**
|
||||
replit*txt
|
||||
.replit
|
||||
.config/**
|
||||
|
|
10
.replit
Normal file
10
.replit
Normal file
|
@ -0,0 +1,10 @@
|
|||
entrypoint = "main.py"
|
||||
modules = ["python-3.10:v18-20230807-322e88b"]
|
||||
|
||||
hidden = [".*", "replit*","*.sh"]
|
||||
|
||||
[nix]
|
||||
channel = "stable-23_05"
|
||||
|
||||
[deployment]
|
||||
run = ["sh", "-c", "python3 main.py"]
|
2
.replit.backup
Normal file
2
.replit.backup
Normal file
|
@ -0,0 +1,2 @@
|
|||
run = "python main.py"
|
||||
entrypoint = "package/src/fpsql/__init__.py"
|
88
README.md
88
README.md
|
@ -1,77 +1,17 @@
|
|||
# Firepup650
|
||||
Package containing various shorthand things I use, and a few imports I almost always use
|
||||
### Change log:
|
||||
#### v.1.0.35:
|
||||
Adds a few missing docstrings and fixes a bug with the menu function
|
||||
#### v.1.0.34:
|
||||
Adds methods to hide/show the cursor and a menu system
|
||||
#### v.1.0.33:
|
||||
Finally fixes `clear`'s ascii option, and adds windows compatibility to the same
|
||||
#### v.1.0.32 (Breaking change!):
|
||||
BREAKING CHANGE: `input` -> `inputCast`
|
||||
|
||||
Adds the `makeError` function, and fixes some mypy complaints
|
||||
#### v.1.0.31:
|
||||
Adds the `isMath` function provided by @python660 on Replit Ask
|
||||
#### v.1.0.30:
|
||||
# FPSQL
|
||||
An easy to use SQLite package
|
||||
#### Change log:
|
||||
###### v.1.0.5:
|
||||
Double check mypy problems and resolve them
|
||||
###### v.1.0.4:
|
||||
Fix all mypy stub issues
|
||||
#### v.1.0.29:
|
||||
###### v.1.0.3:
|
||||
Provide a mypy stub file
|
||||
#### v.1.0.28:
|
||||
Updates `Color` to flush print by default.
|
||||
#### v.1.0.27:
|
||||
Renames many methods, old names are still avalible for backwards compatiblity however. Also, SQL was moved to it's own package entirely.
|
||||
#### v.1.0.26:
|
||||
Adds `remove_prefix` and `remove_suffix`, name mangles internal variables in `sql`, fixes a bug in `console.warn`, adds `__VERSION__`, `__NEW__`, and `__LICENSE__`, adds many aliases for `help()`.
|
||||
#### v.1.0.25:
|
||||
Fix all bugs related to version `1.0.24`'s patch.
|
||||
#### v.1.0.24:
|
||||
Fixes a bug in `sql`'s `addTable` function.
|
||||
#### v.1.0.23:
|
||||
Adds `sql` (class) and all it's functions
|
||||
#### v.1.0.22:
|
||||
Adds `flush_print`.
|
||||
#### v.1.0.21:
|
||||
Adds `bad_cast_message` to `input` and `replit_input`.
|
||||
#### v.1.0.20:
|
||||
Fixes a bug where `replit_input` didn't cast to `cast`.
|
||||
#### v.1.0.19:
|
||||
Updates `replit_input` to call (new) custom `input` that supports type casting under the hood.
|
||||
#### v.1.0.18:
|
||||
Adds Ease Of Use stuff to `bcolors`.
|
||||
#### v.1.0.17:
|
||||
Adds `cprint`.
|
||||
#### v.1.0.16:
|
||||
Same as `v.1.0.15`. Should be fixed now.
|
||||
#### v.1.0.15:
|
||||
Same as `v.1.0.14`, but I can't use the same number
|
||||
#### v.1.0.14:
|
||||
Hopefully fixes poetry not showing certain project info.
|
||||
#### v.1.0.13:
|
||||
Adds `replit_input`
|
||||
#### v.1.0.12:
|
||||
Description fix for `gp`, add `gh`.
|
||||
#### v.1.0.11:
|
||||
Fix a bug in the `gp` method.
|
||||
#### v.1.0.10:
|
||||
Add the `REPLIT` color to `bcolors`, and add `replit_cursor` to the module.
|
||||
#### v.1.0.9:
|
||||
Small tweaks, nothing major.
|
||||
#### v.1.0.8:
|
||||
Cat install collections. This better fix it.
|
||||
###### v.1.0.7:
|
||||
Adds `console` (class), `bcolors` (class), and `Color` (function). Fixes type hinting on various things (Lots of thanks to [@bigminiboss](https://pypi.org/user/bigminiboss/)!).
|
||||
#### v.1.0.6:
|
||||
Hopefully, fixes an issue where the package doesn't install it's dependencies (Again. Hopefully.)
|
||||
#### v.1.0.5:
|
||||
Hopefully, fixes an issue where the package doesn't install it's dependencies
|
||||
#### v.1.0.4:
|
||||
Subscript errors
|
||||
#### v.1.0.3:
|
||||
Dependant errors
|
||||
#### v.1.0.2:
|
||||
Random shorthand (literally)
|
||||
#### v.1.0.1:
|
||||
Added animated typing function, sleep shorthand
|
||||
#### v.1.0.0:
|
||||
###### v.1.0.2:
|
||||
Fix internal vars
|
||||
###### v.1.0.1:
|
||||
Actual release
|
||||
###### v.1.0.0:
|
||||
Initial Release!
|
||||
###### v.1.0.26:
|
||||
Mistake release :facepalm:
|
5
askpass.sh
Executable file
5
askpass.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
case "$1" in
|
||||
Username*) exec echo "$NAME" ;;
|
||||
Password*) exec echo "$PASS" ;;
|
||||
esac
|
7
fix.sh
Executable file
7
fix.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
echo "Fixing poetry..."
|
||||
pip install --upgrade poetry > /dev/null
|
||||
echo "Updating/Installing dependencies..."
|
||||
poetry update > /dev/null
|
||||
echo "Logging completion..."
|
||||
touch /tmp/updated.txt
|
||||
echo "Done!"
|
4
git_log.txt
Normal file
4
git_log.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
error: unable to read askpass response from 'replit-git-askpass'
|
||||
error: unable to read askpass response from 'replit-git-askpass'
|
||||
remote: Push to create is not enabled for users.
|
||||
fatal: unable to access 'https://git--firecat650.repl.co/Firepup650/FPSQL.git/': The requested URL returned error: 403
|
4
lspfix.sh
Executable file
4
lspfix.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
unzip pylsp.sh -d venv/lib/python3.8/site-packages
|
||||
sed -i 6d .config/pip/pip.conf
|
||||
pip install ujson docstring_to_markdown jedi
|
||||
mv pylsp venv/bin
|
20
main.py
20
main.py
|
@ -7,25 +7,13 @@ system("clear")
|
|||
# system("./fix.sh")
|
||||
# system("clear")
|
||||
print("Should be nothing from here")
|
||||
import package.src.firepup650 as fp
|
||||
from package.src.fpsql import sql
|
||||
|
||||
print("Until here (Half-second sleep)")
|
||||
fp.sleep(0.5)
|
||||
bob = fp.menu({"Yes": "Y", "No": ""}, "(If owner) Build?")
|
||||
print("Until here")
|
||||
bob = input("(If owner) Build (Y|*)? ").upper()
|
||||
system("clear")
|
||||
if environ["REPL_OWNER"] == "Firepup650" and bob == "Y":
|
||||
build()
|
||||
exit()
|
||||
else:
|
||||
print(
|
||||
fp.menu(
|
||||
{
|
||||
"a": "hi",
|
||||
"Some fairly long second test case": ["a", "b", "c"],
|
||||
"A third test": 0,
|
||||
},
|
||||
"Test menu",
|
||||
)
|
||||
)
|
||||
fp.console.warn("Test Warning")
|
||||
fp.e("No demo yet!")
|
||||
exit("No demo yet!")
|
||||
|
|
|
@ -1,77 +1,17 @@
|
|||
# Firepup650
|
||||
Package containing various shorthand things I use, and a few imports I almost always use
|
||||
### Change log:
|
||||
#### v.1.0.35:
|
||||
Adds a few missing docstrings and fixes a bug with the menu function
|
||||
#### v.1.0.34:
|
||||
Adds methods to hide/show the cursor and a menu system
|
||||
#### v.1.0.33:
|
||||
Finally fixes `clear`'s ascii option, and adds windows compatibility to the same
|
||||
#### v.1.0.32 (Breaking change!):
|
||||
BREAKING CHANGE: `input` -> `inputCast`
|
||||
|
||||
Adds the `makeError` function, and fixes some mypy complaints
|
||||
#### v.1.0.31:
|
||||
Adds the `isMath` function provided by @python660 on Replit Ask
|
||||
#### v.1.0.30:
|
||||
# FPSQL
|
||||
An easy to use SQLite package
|
||||
#### Change log:
|
||||
###### v.1.0.5:
|
||||
Double check mypy problems and resolve them
|
||||
###### v.1.0.4:
|
||||
Fix all mypy stub issues
|
||||
#### v.1.0.29:
|
||||
###### v.1.0.3:
|
||||
Provide a mypy stub file
|
||||
#### v.1.0.28:
|
||||
Updates `Color` to flush print by default.
|
||||
#### v.1.0.27:
|
||||
Renames many methods, old names are still avalible for backwards compatiblity however. Also, SQL was moved to it's own package entirely.
|
||||
#### v.1.0.26:
|
||||
Adds `remove_prefix` and `remove_suffix`, name mangles internal variables in `sql`, fixes a bug in `console.warn`, adds `__VERSION__`, `__NEW__`, and `__LICENSE__`, adds many aliases for `help()`.
|
||||
#### v.1.0.25:
|
||||
Fix all bugs related to version `1.0.24`'s patch.
|
||||
#### v.1.0.24:
|
||||
Fixes a bug in `sql`'s `addTable` function.
|
||||
#### v.1.0.23:
|
||||
Adds `sql` (class) and all it's functions
|
||||
#### v.1.0.22:
|
||||
Adds `flush_print`.
|
||||
#### v.1.0.21:
|
||||
Adds `bad_cast_message` to `input` and `replit_input`.
|
||||
#### v.1.0.20:
|
||||
Fixes a bug where `replit_input` didn't cast to `cast`.
|
||||
#### v.1.0.19:
|
||||
Updates `replit_input` to call (new) custom `input` that supports type casting under the hood.
|
||||
#### v.1.0.18:
|
||||
Adds Ease Of Use stuff to `bcolors`.
|
||||
#### v.1.0.17:
|
||||
Adds `cprint`.
|
||||
#### v.1.0.16:
|
||||
Same as `v.1.0.15`. Should be fixed now.
|
||||
#### v.1.0.15:
|
||||
Same as `v.1.0.14`, but I can't use the same number
|
||||
#### v.1.0.14:
|
||||
Hopefully fixes poetry not showing certain project info.
|
||||
#### v.1.0.13:
|
||||
Adds `replit_input`
|
||||
#### v.1.0.12:
|
||||
Description fix for `gp`, add `gh`.
|
||||
#### v.1.0.11:
|
||||
Fix a bug in the `gp` method.
|
||||
#### v.1.0.10:
|
||||
Add the `REPLIT` color to `bcolors`, and add `replit_cursor` to the module.
|
||||
#### v.1.0.9:
|
||||
Small tweaks, nothing major.
|
||||
#### v.1.0.8:
|
||||
Cat install collections. This better fix it.
|
||||
###### v.1.0.7:
|
||||
Adds `console` (class), `bcolors` (class), and `Color` (function). Fixes type hinting on various things (Lots of thanks to [@bigminiboss](https://pypi.org/user/bigminiboss/)!).
|
||||
#### v.1.0.6:
|
||||
Hopefully, fixes an issue where the package doesn't install it's dependencies (Again. Hopefully.)
|
||||
#### v.1.0.5:
|
||||
Hopefully, fixes an issue where the package doesn't install it's dependencies
|
||||
#### v.1.0.4:
|
||||
Subscript errors
|
||||
#### v.1.0.3:
|
||||
Dependant errors
|
||||
#### v.1.0.2:
|
||||
Random shorthand (literally)
|
||||
#### v.1.0.1:
|
||||
Added animated typing function, sleep shorthand
|
||||
#### v.1.0.0:
|
||||
###### v.1.0.2:
|
||||
Fix internal vars
|
||||
###### v.1.0.1:
|
||||
Actual release
|
||||
###### v.1.0.0:
|
||||
Initial Release!
|
||||
###### v.1.0.26:
|
||||
Mistake release :facepalm:
|
|
@ -1,8 +1,8 @@
|
|||
[tool.poetry]
|
||||
name = "firepup650"
|
||||
version = "1.0.35"
|
||||
name = "fpsql"
|
||||
version = "1.0.5"
|
||||
authors = ["Firepup650 <firepyp650@gmail.com>"]
|
||||
description = "Package containing various shorthand things I use, and a few imports I almost always use"
|
||||
description = "An easy to use SQLite package"
|
||||
readme = "README.md"
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
|
@ -14,15 +14,14 @@ classifiers = [
|
|||
"Natural Language :: English",
|
||||
]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/F1repup650/firepup650-PYPI"
|
||||
repository = "https://github.com/F1repup650/firepup650-SQL"
|
||||
|
||||
[tool.poetry.urls]
|
||||
"Bug Tracker" = "https://github.com/F1repup650/firepup650-PYPI/issues"
|
||||
Replit = "https://replit.com/@Firepup650/firepup650-PYPI-Package"
|
||||
"Bug Tracker" = "https://github.com/F1repup650/firepup650-SQL/issues"
|
||||
Replit = "https://replit.com/@Firepup650/firepup650-SQL-Package"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.8"
|
||||
fkeycapture = "^1.2.7"
|
||||
fpsql = "^1, !=1.0.26"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
fkeycapture>=1.2.7
|
||||
fpsql>=1.0.0,!=1.0.26
|
|
@ -1,15 +1,15 @@
|
|||
[metadata]
|
||||
name = firepup650
|
||||
version = 1.0.35
|
||||
name = fpsql
|
||||
version = 1.0.5
|
||||
author = Firepup650
|
||||
author_email = firepyp650@gmail.com
|
||||
description = Package containing various shorthand things I use, and a few imports I almost always use
|
||||
description = An easy to use SQLite package
|
||||
long_description = file: README.md
|
||||
long_description_content_type = text/markdown
|
||||
url = https://github.com/F1repup650/firepup650-PYPI
|
||||
url = https://github.com/F1repup650/firepup650-SQL
|
||||
project_urls =
|
||||
Bug Tracker = https://github.com/F1repup650/firepup650-PYPI/issues
|
||||
replit = https://replit.com/@Firepup650/firepup650-PYPI-Package
|
||||
Bug Tracker = https://github.com/F1repup650/firepup650-SQL/issues
|
||||
replit = https://replit.com/@Firepup650/firepup650-SQL-Package
|
||||
classifiers =
|
||||
Programming Language :: Python :: 3
|
||||
License :: OSI Approved :: MIT License
|
||||
|
@ -24,9 +24,6 @@ package_dir =
|
|||
= src
|
||||
packages = find:
|
||||
python_requires = >=3.8
|
||||
install_requires =
|
||||
fkeycapture
|
||||
fpsql
|
||||
|
||||
[options.packages.find]
|
||||
where = src
|
|
@ -1,43 +0,0 @@
|
|||
Metadata-Version: 2.1
|
||||
Name: firepup650
|
||||
Version: 1.0.9
|
||||
Summary: Package containing various shorthand things I use, and a few imports I almost always use
|
||||
Home-page: https://github.com/F1repup650/firepup650-PYPI
|
||||
Author: Firepup650
|
||||
Author-email: firepyp650@gmail.com
|
||||
License: UNKNOWN
|
||||
Project-URL: Bug Tracker, https://github.com/F1repup650/firepup650-PYPI/issues
|
||||
Project-URL: replit, https://replit.com/@Firepup650/firepup650-PYPI-Package
|
||||
Description: # Firepup650
|
||||
Package containing various shorthand things I use, and a few imports I almost always use
|
||||
#### Change log:
|
||||
###### v.1.0.9:
|
||||
Small tweaks, nothing major.
|
||||
###### v.1.0.8:
|
||||
Can't install collections. This better fix it.
|
||||
###### v.1.0.7:
|
||||
Adds `console` (class), `bcolors` (class), and `Color` (function). Fixes type hinting on various things (Lots of thanks to @bigminiboss!).
|
||||
###### v.1.0.6:
|
||||
Hopefully, fixes an issue where the package doesn't install it's dependencies (Again. Hopefully.)
|
||||
###### v.1.0.5:
|
||||
Hopefully, fixes an issue where the package doesn't install it's dependencies
|
||||
###### v.1.0.4:
|
||||
Subscript errors
|
||||
###### v.1.0.3:
|
||||
Dependant errors
|
||||
###### v.1.0.2:
|
||||
Random shorthand (litterally)
|
||||
###### v.1.0.1:
|
||||
Added animated typing function, sleep shorthand
|
||||
###### v.1.0.0:
|
||||
Initial Release!
|
||||
Platform: UNKNOWN
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Environment :: Console
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: Natural Language :: English
|
||||
Requires-Python: >=3.8
|
||||
Description-Content-Type: text/markdown
|
|
@ -1,11 +0,0 @@
|
|||
LICENSE
|
||||
README.md
|
||||
pyproject.toml
|
||||
setup.cfg
|
||||
setup.py
|
||||
src/firepup650/__init__.py
|
||||
src/firepup650.egg-info/PKG-INFO
|
||||
src/firepup650.egg-info/SOURCES.txt
|
||||
src/firepup650.egg-info/dependency_links.txt
|
||||
src/firepup650.egg-info/requires.txt
|
||||
src/firepup650.egg-info/top_level.txt
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1 +0,0 @@
|
|||
fkeycapture
|
|
@ -1 +0,0 @@
|
|||
firepup650
|
|
@ -1,881 +0,0 @@
|
|||
"""Firepup650's PYPI Package"""
|
||||
import os, sys, termios, tty, time, sqlite3, ast, pydoc # type: ignore[import]
|
||||
import random as r
|
||||
import fkeycapture as fkey
|
||||
import fpsql as fql
|
||||
from warnings import warn as ww
|
||||
from typing import NoReturn, TypeVar, Type, Optional, List, Any, Union
|
||||
from collections.abc import Iterable
|
||||
|
||||
|
||||
def alias(func):
|
||||
"""# Function: alias
|
||||
!Wrapper
|
||||
Overwrites the docstring for a function to the specified function
|
||||
# Inputs:
|
||||
func
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
|
||||
def decorator(f):
|
||||
f.__doc__ = (
|
||||
"This method is an alias of the following method:\n\n"
|
||||
+ pydoc.text.document(func)
|
||||
)
|
||||
return f
|
||||
|
||||
return decorator
|
||||
|
||||
|
||||
__VERSION__ = "1.0.34"
|
||||
__NEW__ = "Adds methods to hide/show the cursor and a menu system"
|
||||
__LICENSE__ = "MIT"
|
||||
|
||||
|
||||
def flushPrint(*args) -> None:
|
||||
"""# Function: flushPrint
|
||||
Prints and flushes the provided args.
|
||||
# Inputs:
|
||||
*args - The args to print
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
print(*args, end="", flush=True)
|
||||
|
||||
|
||||
flush_print = flushPrint
|
||||
|
||||
|
||||
def clear(ascii: bool = True) -> None:
|
||||
"""# Function: clear
|
||||
Clears the screen
|
||||
# Inputs:
|
||||
ascii: bool - Controls whether or not we clear with ascii, defaults to True
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if not ascii:
|
||||
os.system("clear||cls")
|
||||
else:
|
||||
flushPrint("\033[H\033[2J")
|
||||
|
||||
|
||||
@alias(os.system)
|
||||
def cmd(command: str) -> int:
|
||||
"""# Function: cmd
|
||||
Runs bash commands
|
||||
# Inputs:
|
||||
command: str - The command to run
|
||||
|
||||
# Returns:
|
||||
int - Status code returned by the command
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
status = os.system(command)
|
||||
return status
|
||||
|
||||
|
||||
def randint(low: int = 0, high: int = 10) -> int:
|
||||
"""# Funcion: randint
|
||||
A safe randint function
|
||||
# Inputs:
|
||||
low: int - The bottom number, defaults to 0
|
||||
high: int - The top number, defaults to 10
|
||||
|
||||
# Returns:
|
||||
int - A number between high and low
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
return r.randint(min(low, high), max(low, high))
|
||||
|
||||
|
||||
@alias(sys.exit)
|
||||
def e(code: Union[str, int, None] = None) -> NoReturn:
|
||||
"""# Function: e
|
||||
Exits with the provided code
|
||||
# Inputs:
|
||||
code: Union[str, int, None] - The status code to exit with, defaults to None
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
sys.exit(code)
|
||||
|
||||
|
||||
def gp(
|
||||
keycount: int = 1, chars: list = ["1", "2"], bytes: bool = False
|
||||
) -> Union[str, bytes]:
|
||||
"""# Function: gp
|
||||
Get keys and print them.
|
||||
# Inputs:
|
||||
keycount: int - Number of keys to get, defaults to 1
|
||||
chars: list - List of keys to accept, defaults to ["1", "2"]
|
||||
bytes: bool - Wether to return the kyes as bytes, defaults to False
|
||||
|
||||
# Returns:
|
||||
Union[str, bytes] - Keys pressed
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
got = 0
|
||||
keys = ""
|
||||
while got < keycount:
|
||||
key = fkey.getchars(1, chars) # type: str #type: ignore
|
||||
keys = f"{keys}{key}"
|
||||
flushPrint(key)
|
||||
got += 1
|
||||
print()
|
||||
if not bytes:
|
||||
return keys
|
||||
else:
|
||||
return keys.encode()
|
||||
|
||||
|
||||
def gh(
|
||||
keycount: int = 1, chars: list = ["1", "2"], char: str = "*", bytes: bool = False
|
||||
) -> Union[str, bytes]:
|
||||
"""# Function: gh
|
||||
Get keys and print `char` in their place.
|
||||
# Inputs:
|
||||
keycount: int - Number of keys to get, defaults to 1
|
||||
chars: list - List of keys to accept, defaults to ["1", "2"]
|
||||
char: str - Character to use to obfuscate the keys, defaults to *
|
||||
bytes: bool - Wether to return the kyes as bytes, defaults to False
|
||||
|
||||
# Returns:
|
||||
Union[str, bytes] - Keys pressed
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
got = 0
|
||||
keys = ""
|
||||
while got < keycount:
|
||||
key = fkey.getchars(1, chars) # type: str#type: ignore
|
||||
keys = f"{keys}{key}"
|
||||
flushPrint("*")
|
||||
got += 1
|
||||
print()
|
||||
if not bytes:
|
||||
return keys
|
||||
else:
|
||||
return keys.encode()
|
||||
|
||||
|
||||
def printt(text: str, delay: float = 0.1, newline: bool = True) -> None:
|
||||
"""# Function: printt
|
||||
Print out animated text!
|
||||
# Inputs:
|
||||
text: str - Text to print (could technicaly be a list)
|
||||
delay: float - How long to delay between characters, defaults to 0.1
|
||||
newline: bool - Wether or not to add a newline at the end of the text, defaults to True
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
# Store the current terminal settings
|
||||
original_terminal_settings = termios.tcgetattr(sys.stdin)
|
||||
# Change terminal settings to prevent any interruptions
|
||||
tty.setcbreak(sys.stdin)
|
||||
for char in text:
|
||||
flushPrint(char)
|
||||
time.sleep(delay)
|
||||
if newline:
|
||||
print()
|
||||
# Restore the original terminal settings
|
||||
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, original_terminal_settings)
|
||||
|
||||
|
||||
@alias(time.sleep)
|
||||
def sleep(seconds: float = 0.5) -> None:
|
||||
"""# Function: sleep
|
||||
Calls `time.sleep(seconds)`
|
||||
# Inputs:
|
||||
seconds: float - How long to sleep for, defaults to 0.5
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
time.sleep(seconds)
|
||||
|
||||
|
||||
@alias(r.seed)
|
||||
def rseed(seed: Any = None, version: int = 2) -> None:
|
||||
"""# Function: rseed
|
||||
reseed the random number generator
|
||||
# Inputs:
|
||||
seed: Any - The seed, defaults to None
|
||||
version: int - Version of the seed (1 or 2), defaults to 2
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
r.seed(seed, version)
|
||||
|
||||
|
||||
setattr(Iterable, "__class_getitem__", lambda x: None)
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
def robj(iterable: Iterable[T]) -> T:
|
||||
"""# Function: robj
|
||||
Returns a random object from the provided iterable
|
||||
# Input:
|
||||
iterable: Iterable[T] - Any valid Iterable
|
||||
|
||||
# Returns:
|
||||
T - A random object of type `T` from the provided iterable
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
return r.choice(iterable) # type: ignore[arg-type]
|
||||
|
||||
|
||||
def Color(
|
||||
r: int = 0, g: int = 0, b: int = 0, bcolor: bool = False, flush: bool = True
|
||||
) -> Union[None, str]:
|
||||
"""# Function: Color
|
||||
Set the text to a specific color.
|
||||
# Inputs:
|
||||
r: int - The red value, range of 0-255, defaults to 0
|
||||
g: int - The green value, range of 0-255, defaults to 0
|
||||
b: int - The blue value, range of 0-255, defaults to 0
|
||||
bcolor: bool - Wether to return the color as a str, defaults to False
|
||||
fulsh: bool - Wether to flushPrint the color, defaults to True
|
||||
|
||||
# Returns:
|
||||
Union[None, str] - The color code if `bcolor` is True. Otherwise, returns nothing
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if r < 0:
|
||||
r = 0
|
||||
if r > 255:
|
||||
r = 255
|
||||
if g < 0:
|
||||
g = 0
|
||||
if g > 255:
|
||||
g = 255
|
||||
if b < 0:
|
||||
b = 0
|
||||
if b > 255:
|
||||
b = 255
|
||||
if bcolor:
|
||||
return f"\033[38;2;{r};{g};{b}m"
|
||||
elif flush:
|
||||
flushPrint("\003[0m")
|
||||
flushPrint(f"\033[38;2;{r};{g};{b}m")
|
||||
else:
|
||||
print("\003[0m")
|
||||
print(f"\033[38;2;{r};{g};{b}m")
|
||||
return None
|
||||
|
||||
|
||||
class bcolors:
|
||||
"""
|
||||
This class contains various pre-defined color codes.
|
||||
"""
|
||||
|
||||
INVERSE = "\033[8m"
|
||||
|
||||
@staticmethod
|
||||
def fINVERSE() -> None:
|
||||
"""INVERTs foreground and background colors"""
|
||||
print("\033[8m", end="")
|
||||
|
||||
RESET = "\033[0m"
|
||||
RWHITE: str = f"\033[0m{Color(255,255,255,bcolor=True)}"
|
||||
WHITE: str = f"{Color(255,255,255,bcolor=True)}"
|
||||
FAILINVERSE: str = f"{Color(255,bcolor=True)}\033[49m\033[7m"
|
||||
|
||||
@staticmethod
|
||||
def fWHITE() -> None:
|
||||
"""Sets the text color to WHITE"""
|
||||
print(f"{Color(255,255,255,bcolor=True)}", end="")
|
||||
|
||||
@staticmethod
|
||||
def fRWHITE() -> None:
|
||||
"""RESETs the text color, then sets it to WHITE"""
|
||||
print(f"\033[0m{Color(255,255,255,bcolor=True)}", end="")
|
||||
|
||||
@staticmethod
|
||||
def fFAILINVERSE() -> None:
|
||||
"""Sets the text color RED, then inverses it."""
|
||||
print(f"{Color(255,bcolor=True)}\033[49m\033[7m", end="")
|
||||
|
||||
@staticmethod
|
||||
def fRESET() -> None:
|
||||
"""RESETs the formatting"""
|
||||
print("\033[0m", end="")
|
||||
|
||||
BROWN: str = f"{Color(205,127,50,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fBROWN() -> None:
|
||||
"""Sets the text color to BROWN"""
|
||||
print(f"{Color(205,127,50,bcolor=True)}", end="")
|
||||
|
||||
WARNING: str = f"{Color(236,232,26,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fWARNING() -> None:
|
||||
"""Sets the text color to YELLOW"""
|
||||
print(f"{Color(236,232,26,bcolor=True)}", end="")
|
||||
|
||||
FAIL: str = f"{Color(255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fFAIL() -> None:
|
||||
"""Sets the text color to RED"""
|
||||
print(f"{Color(255,bcolor=True)}", end="")
|
||||
|
||||
OK: str = f"{Color(g=255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fOK() -> None:
|
||||
"""Sets the text color to GREEN"""
|
||||
print(f"{Color(g=255,bcolor=True)}", end="")
|
||||
|
||||
CYAN: str = f"{Color(g=255,b=255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fCYAN() -> None:
|
||||
"""Sets the text color to CYAN"""
|
||||
print(f"{Color(g=255,b=255,bcolor=True)}", end="")
|
||||
|
||||
WOOD: str = f"{Color(120,81,45,bcolor=True)}\033[46m\033[7m"
|
||||
|
||||
@staticmethod
|
||||
def fWOOD() -> None:
|
||||
"""Sets the text color to CYAN, and the background to a WOODen color"""
|
||||
print(f"{Color(120,81,45,bcolor=True)}\033[46m\033[7m", end="")
|
||||
|
||||
REPLIT: str = f"{Color(161, 138, 26, True)}"
|
||||
|
||||
@staticmethod
|
||||
def fREPLIT() -> None:
|
||||
"""Sets the text color to 161,138,26 in RGB"""
|
||||
print(f"{Color(162, 138, 26, True)}")
|
||||
|
||||
GREEN = OK
|
||||
fGREEN = fOK
|
||||
YELLOW = WARNING
|
||||
fYELLOW = fWARNING
|
||||
RED = FAIL
|
||||
fRED = fFAIL
|
||||
|
||||
class bold:
|
||||
"""
|
||||
Contains bold versions of the other color codes
|
||||
"""
|
||||
|
||||
BROWN: str = f"\033[1m{Color(205,127,50,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fBROWN() -> None:
|
||||
"""Sets the text color to BROWN"""
|
||||
print(f"\033[1m{Color(205,127,50,bcolor=True)}", end="")
|
||||
|
||||
WARNING: str = f"\033[1m{Color(236,232,26,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fWARNING() -> None:
|
||||
"""Sets the text color to YELLOW"""
|
||||
print(f"\033[1m{Color(236,232,26,bcolor=True)}", end="")
|
||||
|
||||
FAIL: str = f"\033[1m{Color(255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fFAIL() -> None:
|
||||
"""Sets the text color to RED"""
|
||||
print(f"\033[1m{Color(255,bcolor=True)}", end="")
|
||||
|
||||
OK: str = f"\033[1m{Color(g=255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fOK() -> None:
|
||||
"""Sets the text color to GREEN"""
|
||||
print(f"\033[1m{Color(g=255,bcolor=True)}", end="")
|
||||
|
||||
CYAN: str = f"\033[1m{Color(g=255,b=255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fCYAN() -> None:
|
||||
"""Sets the text color to CYAN"""
|
||||
print(f"\033[1m{Color(g=255,b=255,bcolor=True)}", end="")
|
||||
|
||||
WOOD: str = f"\033[1m{Color(120,81,45,bcolor=True)}\033[46m\033[7m"
|
||||
|
||||
@staticmethod
|
||||
def fWOOD() -> None:
|
||||
"""Sets the text color to CYAN, and the background to a WOODen color"""
|
||||
print(f"\033[1m{Color(120,81,45,bcolor=True)}\033[46m\033[7m", end="")
|
||||
|
||||
WHITE: str = f"\033[1m{Color(255,255,255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fWHITE() -> None:
|
||||
"""Sets the text color to WHITE"""
|
||||
print(f"\033[1m{Color(255,255,255,bcolor=True)}", end="")
|
||||
|
||||
RWHITE: str = f"\033[0m\033[1m{Color(255,255,255,bcolor=True)}"
|
||||
|
||||
@staticmethod
|
||||
def fRWHITE() -> None:
|
||||
"""RESETs the text color, then sets it to WHITE"""
|
||||
print(f"\033[0m\033[1m{Color(255,255,255,bcolor=True)}", end="")
|
||||
|
||||
REPLIT: str = f"\033[1m{Color(161, 138, 26, True)}"
|
||||
|
||||
@staticmethod
|
||||
def fREPLIT() -> None:
|
||||
"""Sets the text color to 161,138,26 in RGB"""
|
||||
print(f"\033[1m{Color(162, 138, 26, True)}")
|
||||
|
||||
GREEN = OK
|
||||
fGREEN = fOK
|
||||
YELLOW = WARNING
|
||||
fYELLOW = fWARNING
|
||||
RED = FAIL
|
||||
fRED = fFAIL
|
||||
|
||||
|
||||
replitCursor: str = f"{bcolors.REPLIT}{bcolors.RESET}"
|
||||
replit_cursor = replitCursor
|
||||
|
||||
cast = TypeVar("cast")
|
||||
|
||||
|
||||
def inputCast(prompt: str = "", cast: Type = str, badCastMessage: str = "") -> cast: # type: ignore[type-var]
|
||||
"""# Function: input
|
||||
Displays your `prompt`, supports casting by default, with handling!
|
||||
# Inputs:
|
||||
prompt: str - The prompt, defaults to ""
|
||||
cast: Type - The Type to cast the input to, defaults to str
|
||||
badCastMessage: str - The message to dispaly upon reciving input that can't be casted to `cast`, can be set to `"None"` to not have one, defaults to f"That is not a vaild {cast.__name__}, please try again."
|
||||
|
||||
# Returns:
|
||||
cast - The user's input, casted to `cast`
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if not badCastMessage:
|
||||
badCastMessage = f"That is not a vaild {cast.__name__}, please try again."
|
||||
ret = ""
|
||||
abc = ""
|
||||
while ret == "":
|
||||
try:
|
||||
abc = input(prompt)
|
||||
cast(abc)
|
||||
ret = abc
|
||||
break
|
||||
except ValueError:
|
||||
if badCastMessage != "None":
|
||||
print(badCastMessage)
|
||||
return cast(ret)
|
||||
|
||||
|
||||
def replitInput(prompt: str = "", cast: Type = str, badCastMessage: str = "") -> cast: # type: ignore[type-var]
|
||||
"""# Function: replitInput
|
||||
Displays your `prompt` with the replit cursor on the next line, supports casting by default, with handling!
|
||||
# Inputs:
|
||||
prompt: str - The prompt, defaults to ""
|
||||
cast: Type - The Type to cast the input to, defaults to str
|
||||
badCastMessage: str - The message to dispaly upon reciving input that can't be casted to `cast`, can be set to "No message" to not have one, defaults to f"That is not a vaild {cast.__name__}, please try again."
|
||||
|
||||
# Returns:
|
||||
cast - The user's input, casted to `cast`
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if prompt:
|
||||
print(prompt)
|
||||
return inputCast(f"{replitCursor} ", cast, badCastMessage)
|
||||
|
||||
|
||||
replit_input = replitInput
|
||||
|
||||
|
||||
def cprint(text: str = "") -> None:
|
||||
"""# Function: cprint
|
||||
Displays your `text` in a random color (from bcolors).
|
||||
# Inputs:
|
||||
text: str - The text to color, defaults to ""
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
colordict = {
|
||||
"GREEN": bcolors.GREEN,
|
||||
"RED": bcolors.RED,
|
||||
"YELLOW": bcolors.YELLOW,
|
||||
"CYAN": bcolors.CYAN,
|
||||
"REPLIT": bcolors.REPLIT,
|
||||
"BROWN": bcolors.BROWN,
|
||||
"WHITE": bcolors.WHITE,
|
||||
}
|
||||
colornames = ["GREEN", "RED", "YELLOW", "CYAN", "REPLIT", "BROWN", "WHITE"]
|
||||
color = colordict[robj(colornames)]
|
||||
print(f"{color}{text}")
|
||||
|
||||
|
||||
class ProgramWarnings(UserWarning):
|
||||
"""Warnings Raised for user defined Warnings in `console.warn` by default."""
|
||||
|
||||
|
||||
class AssertationWarning(UserWarning):
|
||||
"""Warnings Raised for assertion errors in `console.assert_()`."""
|
||||
|
||||
|
||||
class console:
|
||||
"""Limited Functionality version of JavaScript's console functions"""
|
||||
|
||||
__counters__: dict = {"default": 0}
|
||||
__warnings__: List[str] = []
|
||||
|
||||
@alias(print)
|
||||
@staticmethod
|
||||
def log(*args, **kwargs) -> None:
|
||||
"""print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
|
||||
|
||||
Prints the values to a stream, or to sys.stdout by default.
|
||||
Optional keyword arguments:
|
||||
file: a file-like object (stream); defaults to the current sys.stdout.
|
||||
sep: string inserted between values, default a space.
|
||||
end: string appended after the last value, default a newline.
|
||||
flush: whether to forcibly flush the stream."""
|
||||
print(*args, **kwargs)
|
||||
|
||||
@alias(print)
|
||||
@staticmethod
|
||||
def info(*args, **kwargs) -> None:
|
||||
"""print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
|
||||
|
||||
Prints the values to a stream, or to sys.stdout by default.
|
||||
Optional keyword arguments:
|
||||
file: a file-like object (stream); defaults to the current sys.stdout.
|
||||
sep: string inserted between values, default a space.
|
||||
end: string appended after the last value, default a newline.
|
||||
flush: whether to forcibly flush the stream."""
|
||||
print(*args, **kwargs)
|
||||
|
||||
@alias(print)
|
||||
@staticmethod
|
||||
def debug(*args, **kwargs) -> None:
|
||||
"""print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
|
||||
|
||||
Prints the values to a stream, or to sys.stdout by default.
|
||||
Optional keyword arguments:
|
||||
file: a file-like object (stream); defaults to the current sys.stdout.
|
||||
sep: string inserted between values, default a space.
|
||||
end: string appended after the last value, default a newline.
|
||||
flush: whether to forcibly flush the stream."""
|
||||
print(*args, **kwargs)
|
||||
|
||||
@staticmethod
|
||||
def warn(warning: Any, class_: Optional[Type[Warning]] = ProgramWarnings) -> None:
|
||||
"""# Function: console.warn
|
||||
Issue a warning
|
||||
# Inputs:
|
||||
warning: Any - The variable to use as a warning
|
||||
class_: class - The class to raise the warning from, defaults to ProgramWarnings
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
ind = 1
|
||||
while warning in console.__warnings__:
|
||||
warning = f"{warning}({ind})"
|
||||
ind += 1
|
||||
console.__warnings__.append(warning)
|
||||
ww(warning, class_, 2)
|
||||
|
||||
@staticmethod
|
||||
def error(*args, **kwargs) -> None:
|
||||
"""print(value, ..., sep=' ', end='\n', file=sys.stderr, flush=False)
|
||||
|
||||
Prints the values to sys.stderr.
|
||||
Optional keyword arguments:
|
||||
sep: string inserted between values, default a space.
|
||||
end: string appended after the last value, default a newline.
|
||||
flush: whether to forcibly flush the stream."""
|
||||
print(bcolors.FAIL, *args, bcolors.RESET, file=sys.stderr, **kwargs)
|
||||
|
||||
@staticmethod
|
||||
def assert_(condition: bool, message: str = "Assertion Failed") -> None:
|
||||
"""# Function: console.assert_
|
||||
Makes an assertion check
|
||||
# Inputs:
|
||||
condition: bool - The condition to run an assert check on
|
||||
message: str - The message to raise if the assertion is False, defaults to "Assertion Failed"
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if not condition:
|
||||
console.warn(message, AssertationWarning)
|
||||
|
||||
@staticmethod
|
||||
def count(label: str = "default") -> None:
|
||||
"""# Function: console.count
|
||||
Increment a counter by one
|
||||
# Inputs:
|
||||
label: str - The counter to increment, defaults to "default"
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if console.__counters__[label]:
|
||||
console.__counters__[label] += 1
|
||||
else:
|
||||
console.__counters__[label] = 1
|
||||
print(f"{label}: {console.__counters__[label]}")
|
||||
|
||||
@staticmethod
|
||||
def countReset(label: str = "default") -> None:
|
||||
"""# Function: console.countReset
|
||||
Reset a counter to 0
|
||||
# Inputs:
|
||||
label: str - The counter to reset, defaults to "default"
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
console.__counters__[label] = 0
|
||||
|
||||
@alias(clear)
|
||||
@staticmethod
|
||||
def clear(ascii: bool = False) -> None:
|
||||
"""# Function: console.clear
|
||||
Clears the screen
|
||||
# Inputs:
|
||||
ascii: bool - Wether to use ASCII to clear the screen, defaults to False
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
clear(ascii)
|
||||
|
||||
|
||||
sql: Type = fql.sql
|
||||
|
||||
|
||||
def removePrefix(text: str, prefix: str) -> str:
|
||||
"""# Function: removePrefix
|
||||
If `prefix` is at the beginning of `text`, return `text` without `prefix`, otherwise return `text`
|
||||
# Inputs:
|
||||
text: str - The text to remove the prefix from
|
||||
prefix: str - The prefix to remove from the text
|
||||
|
||||
# Returns:
|
||||
str - `text` without `prefix`
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if text.startswith(prefix):
|
||||
return text[len(prefix) :]
|
||||
return text
|
||||
|
||||
|
||||
remove_prefix = removePrefix
|
||||
|
||||
|
||||
def removeSuffix(text: str, suffix: str) -> str:
|
||||
"""# Function: removeSuffix
|
||||
If `suffix` is at the end of `text`, return `text` without `suffix`, otherwise return `text`
|
||||
# Inputs:
|
||||
text: str - The text to remove the suffix from
|
||||
suffix: str - The suffix to remove from the text
|
||||
|
||||
# Returns:
|
||||
str - `text` without `suffix`
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if text.endswith(suffix):
|
||||
return text[: -len(suffix)]
|
||||
return text
|
||||
|
||||
|
||||
remove_suffix = removeSuffix
|
||||
|
||||
|
||||
def isMath(equation: str) -> bool:
|
||||
"""# Function: isMath
|
||||
Checks whether a given `equation` is actually an equation or not
|
||||
Function provided by @python660 on Replit Ask
|
||||
# Inputs:
|
||||
equation: str - The string to check to see if it is an equation
|
||||
|
||||
# Returns:
|
||||
bool - Whether the given equation is a math problem
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
return all([True if char in "1234567890*/+-.^%!" else False for char in equation])
|
||||
|
||||
|
||||
def makeError(
|
||||
name: str, message: object, module: str = "builtins", raise_: bool = True
|
||||
) -> Union[NoReturn, object]:
|
||||
"""# Function: isMath
|
||||
Makes a custom error using the provided parts
|
||||
# Inputs:
|
||||
name: str - The name of the error
|
||||
message: object - The error content
|
||||
module: str - The module to say the error came from, defaults to "builtins"
|
||||
raise_: bool - Wether to raise the error or return it, defaults to rasing
|
||||
|
||||
# Returns:
|
||||
Union[NoReturn, object] - Raises an error (NoReturn) or returns the error
|
||||
|
||||
# Raises:
|
||||
If raises_, then User Provided Error, else None"""
|
||||
if raise_:
|
||||
raise type(name, (Exception,), {"__module__": module, "__name__": name})(
|
||||
message
|
||||
)
|
||||
else:
|
||||
return type(name, (Exception,), {"__module__": module, "__name__": name})(
|
||||
message
|
||||
)
|
||||
|
||||
|
||||
class cur:
|
||||
"""Contains functions to hide and show the cursor"""
|
||||
|
||||
@staticmethod
|
||||
def hide() -> None:
|
||||
"""# Function: cur.hide
|
||||
Hides the cursor
|
||||
# Inputs:
|
||||
None
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
flushPrint("\033[?25l")
|
||||
|
||||
@staticmethod
|
||||
def show() -> None:
|
||||
"""# Function: cur.show
|
||||
Shows the cursor
|
||||
# Inputs:
|
||||
None
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
flushPrint("\033[?25h")
|
||||
|
||||
|
||||
def hidden(func):
|
||||
"""# Function: hidden
|
||||
A wrapper that hides the cursor
|
||||
# Inputs:
|
||||
function
|
||||
|
||||
# Returns:
|
||||
wrapper
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
|
||||
def wrapper(*args, **kwargs):
|
||||
cur.hide()
|
||||
try:
|
||||
out = func(*args, **kwargs) # type: ignore
|
||||
except Exception as E:
|
||||
cur.show()
|
||||
raise E
|
||||
cur.show()
|
||||
return out
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
@hidden
|
||||
def menu(options: dict, title: str = "") -> object:
|
||||
"""# Function: menu
|
||||
Uses a nice interactive for the provided options
|
||||
# Inputs:
|
||||
options: dict - A dictionary of options and their return values
|
||||
|
||||
# Returns:
|
||||
object - The user's selected option
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if type(options) != dict:
|
||||
raise ValueError(f"options must be a dictionary (passed a {type(options)})")
|
||||
if len(options) <= 1:
|
||||
raise ValueError(
|
||||
f"options must contain at least two choices (passed {len(options)})"
|
||||
)
|
||||
choices = list(options)
|
||||
limit = len(choices)
|
||||
current = 0
|
||||
selected = False
|
||||
UP = [fkey.KEYS["UP"], b"w", b"a", fkey.KEYS["LEFT"]]
|
||||
DOWN = [fkey.KEYS["DOWN"], b"s", b"d", fkey.KEYS["RIGHT"]]
|
||||
indicatorSize = len(str(limit)) * 2 + 1
|
||||
menuWidth = max(
|
||||
[max([len(choice) for choice in choices]) + 4, indicatorSize * 2 + 7]
|
||||
)
|
||||
while not selected:
|
||||
clear()
|
||||
flushPrint(
|
||||
(title + "\n" if title else "")
|
||||
+ f"╔{'═'*menuWidth}╗\n"
|
||||
+ f"║ {f'{current+1}'}{' '*(len(str(limit))-len(str(current+1)))}/{limit}{' '*int(menuWidth/2-indicatorSize-2.5)}↑{' '*int((menuWidth-indicatorSize)/2-(0 if indicatorSize!=3 else 1))} ║\n"
|
||||
+ f"║←{' '*int(((menuWidth-len(choices[current]))/2)-1)}{choices[current]}{' '*int((menuWidth-len(choices[current]))/2-.5)}→║\n"
|
||||
+ f"║{' '*int((menuWidth-1)/2)}↓{' '*int((menuWidth-1)/2+.5)}║\n"
|
||||
+ f"╚{'═'*menuWidth}╝\n"
|
||||
)
|
||||
key = fkey.get(bytes=True, osReader=True)
|
||||
if key in UP:
|
||||
current -= 1
|
||||
elif key in DOWN:
|
||||
current += 1
|
||||
elif key in [fkey.KEYS["ENTER"]]:
|
||||
break
|
||||
if current > limit - 1:
|
||||
current = 0
|
||||
if current < 0:
|
||||
current = limit - 1
|
||||
return options[choices[current]]
|
|
@ -1,176 +0,0 @@
|
|||
from collections.abc import Iterable
|
||||
from typing import Any, List, NoReturn, Optional, Type, TypeVar, Union
|
||||
|
||||
def alias(Function): ...
|
||||
|
||||
__VERSION__: str
|
||||
__NEW__: str
|
||||
__LICENSE__: str
|
||||
|
||||
def flushPrint(*args) -> None: ...
|
||||
|
||||
flush_print = flushPrint
|
||||
|
||||
def clear(ascii: bool = ...) -> None: ...
|
||||
def cmd(command: str) -> int: ...
|
||||
def randint(low: int = ..., high: int = ...) -> int: ...
|
||||
def e(code: Union[str, int, None] = ...) -> NoReturn: ...
|
||||
def gp(
|
||||
keycount: int = ..., chars: list = ..., bytes: bool = ...
|
||||
) -> Union[str, bytes]: ...
|
||||
def gh(
|
||||
keycount: int = ..., chars: list = ..., char: str = ..., bytes: bool = ...
|
||||
) -> Union[str, bytes]: ...
|
||||
def printt(text: str, delay: float = ..., newline: bool = ...) -> None: ...
|
||||
def sleep(seconds: float = ...) -> None: ...
|
||||
def rseed(seed: Any = ..., version: int = ...) -> None: ...
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
def robj(iterable: Iterable[T]) -> T: ...
|
||||
def Color(
|
||||
r: int = ..., g: int = ..., b: int = ..., bcolor: bool = ..., flush: bool = ...
|
||||
) -> Union[None, str]: ...
|
||||
|
||||
class bcolors:
|
||||
INVERSE: str
|
||||
@staticmethod
|
||||
def fINVERSE() -> None: ...
|
||||
RESET: str
|
||||
RWHITE: str
|
||||
WHITE: str
|
||||
FAILINVERSE: str
|
||||
@staticmethod
|
||||
def fWHITE() -> None: ...
|
||||
@staticmethod
|
||||
def fRWHITE() -> None: ...
|
||||
@staticmethod
|
||||
def fFAILINVERSE() -> None: ...
|
||||
@staticmethod
|
||||
def fRESET() -> None: ...
|
||||
BROWN: str
|
||||
@staticmethod
|
||||
def fBROWN() -> None: ...
|
||||
WARNING: str
|
||||
@staticmethod
|
||||
def fWARNING() -> None: ...
|
||||
FAIL: str
|
||||
@staticmethod
|
||||
def fFAIL() -> None: ...
|
||||
OK: str
|
||||
@staticmethod
|
||||
def fOK() -> None: ...
|
||||
CYAN: str
|
||||
@staticmethod
|
||||
def fCYAN() -> None: ...
|
||||
WOOD: str
|
||||
@staticmethod
|
||||
def fWOOD() -> None: ...
|
||||
REPLIT: str
|
||||
@staticmethod
|
||||
def fREPLIT() -> None: ...
|
||||
GREEN = OK
|
||||
fGREEN = fOK
|
||||
YELLOW = WARNING
|
||||
fYELLOW = fWARNING
|
||||
RED = FAIL
|
||||
fRED = fFAIL
|
||||
|
||||
class bold:
|
||||
BROWN: str
|
||||
@staticmethod
|
||||
def fBROWN() -> None: ...
|
||||
WARNING: str
|
||||
@staticmethod
|
||||
def fWARNING() -> None: ...
|
||||
FAIL: str
|
||||
@staticmethod
|
||||
def fFAIL() -> None: ...
|
||||
OK: str
|
||||
@staticmethod
|
||||
def fOK() -> None: ...
|
||||
CYAN: str
|
||||
@staticmethod
|
||||
def fCYAN() -> None: ...
|
||||
WOOD: str
|
||||
@staticmethod
|
||||
def fWOOD() -> None: ...
|
||||
WHITE: str
|
||||
@staticmethod
|
||||
def fWHITE() -> None: ...
|
||||
RWHITE: str
|
||||
@staticmethod
|
||||
def fRWHITE() -> None: ...
|
||||
REPLIT: str
|
||||
@staticmethod
|
||||
def fREPLIT() -> None: ...
|
||||
GREEN = OK
|
||||
fGREEN = fOK
|
||||
YELLOW = WARNING
|
||||
fYELLOW = fWARNING
|
||||
RED = FAIL
|
||||
fRED = fFAIL
|
||||
|
||||
replitCursor: str
|
||||
replit_cursor = replitCursor
|
||||
cast = TypeVar("cast")
|
||||
|
||||
def inputCast(
|
||||
prompt: str = ..., cast: Type = ..., badCastMessage: str = ...
|
||||
) -> cast: ...
|
||||
def replitInput(
|
||||
prompt: str = ..., cast: Type = ..., badCastMessage: str = ...
|
||||
) -> cast: ...
|
||||
|
||||
replit_input = replitInput
|
||||
|
||||
def cprint(text: str = ...) -> None: ...
|
||||
|
||||
class ProgramWarnings(UserWarning): ...
|
||||
class AssertationWarning(UserWarning): ...
|
||||
|
||||
class console:
|
||||
__counters__: dict
|
||||
__warnings__: List[str]
|
||||
@staticmethod
|
||||
def log(*args, **kwargs) -> None: ...
|
||||
@staticmethod
|
||||
def info(*args, **kwargs) -> None: ...
|
||||
@staticmethod
|
||||
def debug(*args, **kwargs) -> None: ...
|
||||
@staticmethod
|
||||
def warn(warning: Any, class_: Optional[Type[Warning]] = ...) -> None: ...
|
||||
@staticmethod
|
||||
def error(*args, **kwargs) -> None: ...
|
||||
@staticmethod
|
||||
def assert_(condition: bool, message: str = ...) -> None: ...
|
||||
@staticmethod
|
||||
def count(label: str = ...) -> None: ...
|
||||
@staticmethod
|
||||
def countReset(label: str = ...) -> None: ...
|
||||
@staticmethod
|
||||
def clear(ascii: bool = ...) -> None: ...
|
||||
|
||||
sql: Type
|
||||
|
||||
def removePrefix(text: str, prefix: str) -> str: ...
|
||||
|
||||
remove_prefix = removePrefix
|
||||
|
||||
def removeSuffix(text: str, suffix: str) -> str: ...
|
||||
|
||||
remove_suffix = removeSuffix
|
||||
|
||||
def isMath(equation: str) -> bool: ...
|
||||
def makeError(
|
||||
name: str, message: object, module: str = ..., raise_: bool = ...
|
||||
) -> Union[None, object]: ...
|
||||
|
||||
class cur:
|
||||
@staticmethod
|
||||
def hide() -> None: ...
|
||||
@staticmethod
|
||||
def show() -> None: ...
|
||||
|
||||
def hidden(func): ...
|
||||
def menu(options: dict) -> object: ...
|
178
package/src/fpsql/__init__.py
Normal file
178
package/src/fpsql/__init__.py
Normal file
|
@ -0,0 +1,178 @@
|
|||
"""Firepup650's SQL Package"""
|
||||
from typing import Any
|
||||
import sqlite3, ast, pydoc
|
||||
|
||||
|
||||
def alias(Function):
|
||||
def decorator(f):
|
||||
f.__doc__ = (
|
||||
"This method is an alias of the following method:\n\n"
|
||||
+ pydoc.text.document(Function)
|
||||
)
|
||||
return f
|
||||
|
||||
return decorator
|
||||
|
||||
|
||||
__VERSION__ = "1.0.5"
|
||||
__NEW__ = "Double check mypy problems and resolve them"
|
||||
__LICENSE__ = "MIT"
|
||||
|
||||
|
||||
class sql:
|
||||
def addTable(self, tableName: str, mode: int = 0, address: str = "") -> None:
|
||||
"""# Function: sql.addTable
|
||||
Adds a table to the database
|
||||
# Inputs:
|
||||
tableName: str - The name of the table to create
|
||||
mode: int - Not yet implemented
|
||||
address: str - Not yet implemented
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
self.__con.execute(
|
||||
f"""CREATE TABLE IF NOT EXISTS "{tableName}"
|
||||
(id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
value TEXT NOT NULL)"""
|
||||
)
|
||||
self.__con.commit()
|
||||
self.__table = tableName
|
||||
|
||||
def __init__(self, filename: str):
|
||||
"""# Function: sql.__init__
|
||||
Constructs an SQL instance
|
||||
# Inputs:
|
||||
filename: str - The name of the database file to connect to (or `:memory:`)
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
if filename.endswith(".db") or filename == ":memory:":
|
||||
self.__db = filename
|
||||
else:
|
||||
self.__db = filename + ".db"
|
||||
self.__con = sqlite3.connect(self.__db)
|
||||
self.addTable("default")
|
||||
|
||||
def setTable(self, tableName: str) -> None:
|
||||
"""# Function: sql.setTable
|
||||
Sets the currently active table
|
||||
# Inputs:
|
||||
tableName: str - The name of the table to use
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
self.__table = tableName
|
||||
|
||||
def get(self, name: str) -> Any:
|
||||
"""# Function: sql.get
|
||||
Gets the value of a key
|
||||
# Inputs:
|
||||
name: str - The name of the key to retrieve
|
||||
|
||||
# Returns:
|
||||
Any - If the key exists, return it's value (casted), otherwise, return `None`
|
||||
|
||||
# Raises:
|
||||
AttributeError - If the table is unset"""
|
||||
if not self.__table:
|
||||
raise AttributeError("Attempted to read from unset table")
|
||||
cur = self.__con.execute(
|
||||
f"""SELECT value FROM "{self.__table}" WHERE name = ?""", (name,)
|
||||
)
|
||||
data = cur.fetchone()
|
||||
if data:
|
||||
try:
|
||||
return ast.literal_eval(data[0])
|
||||
except:
|
||||
return data[0]
|
||||
return None
|
||||
|
||||
def set(self, name: str, value: object) -> int:
|
||||
"""# Function: sql.set
|
||||
Sets the value of a key
|
||||
# Inputs:
|
||||
name: str - The name of the key to set
|
||||
value: object - The value of the key
|
||||
|
||||
# Returns:
|
||||
int - `1` if the key was created, `2` if it was updated
|
||||
|
||||
# Raises:
|
||||
AttributeError - If the table is unset"""
|
||||
if not self.__table:
|
||||
raise AttributeError("Attempted to write to unset table")
|
||||
if self.get(name):
|
||||
self.__con.execute(
|
||||
f"""UPDATE "{self.__table}" SET value = ? WHERE name = ?""",
|
||||
(str(value), name),
|
||||
)
|
||||
self.__con.commit()
|
||||
return 2
|
||||
else:
|
||||
self.__con.execute(
|
||||
f"""INSERT INTO "{self.__table}" (name, value) VALUES (?, ?)""",
|
||||
(name, str(value)),
|
||||
)
|
||||
self.__con.commit()
|
||||
return 1
|
||||
|
||||
def delete(self, name: str) -> None:
|
||||
"""# Function: sql.delete
|
||||
Deletes a key from the table
|
||||
# Inputs:
|
||||
name: str - The name of the key to delete
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
AttributeError - If the table is unset"""
|
||||
if not self.__table:
|
||||
raise AttributeError("Attempted to delete from unset table")
|
||||
if self.get(name):
|
||||
self.__con.execute(
|
||||
f"""DELETE FROM "{self.__table}" WHERE name = ?""", (name,)
|
||||
)
|
||||
self.__con.commit()
|
||||
|
||||
def deleteAll(self) -> None:
|
||||
"""# Function: sql.delete_all
|
||||
Deletes all keys from the table
|
||||
# Inputs:
|
||||
None
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
AttributeError - If the table is unset"""
|
||||
if not self.__table:
|
||||
raise AttributeError("Attempted to delete from unset table")
|
||||
self.__con.execute(f"""DELETE FROM "{self.__table}" """)
|
||||
self.__con.commit()
|
||||
|
||||
def close(self) -> None:
|
||||
"""# Function: sql.close
|
||||
Closes the database connection
|
||||
# Inputs:
|
||||
None
|
||||
|
||||
# Returns:
|
||||
None
|
||||
|
||||
# Raises:
|
||||
None"""
|
||||
self.__con.close()
|
||||
self.__con = None # type: ignore[assignment]
|
||||
self.__db = ""
|
||||
self.__table = ""
|
17
package/src/fpsql/__init__.pyi
Normal file
17
package/src/fpsql/__init__.pyi
Normal file
|
@ -0,0 +1,17 @@
|
|||
from typing import Any
|
||||
|
||||
def alias(Function): ...
|
||||
|
||||
__VERSION__: str
|
||||
__NEW__: str
|
||||
__LICENSE__: str
|
||||
|
||||
class sql:
|
||||
def addTable(self, tableName: str, mode: int = ..., address: str = ...) -> None: ...
|
||||
def __init__(self, filename: str) -> None: ...
|
||||
def setTable(self, tableName: str) -> None: ...
|
||||
def get(self, name: str) -> Any: ...
|
||||
def set(self, name: str, value: object) -> int: ...
|
||||
def delete(self, name: str) -> None: ...
|
||||
def deleteAll(self) -> None: ...
|
||||
def close(self) -> None: ...
|
71
poetry.lock
generated
71
poetry.lock
generated
|
@ -67,75 +67,6 @@ files = [
|
|||
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fkeycapture"
|
||||
version = "1.2.7"
|
||||
description = "A way to capture keystrokes"
|
||||
optional = false
|
||||
python-versions = ">=3.8,<4.0"
|
||||
files = [
|
||||
{file = "fkeycapture-1.2.7-py3-none-any.whl", hash = "sha256:c09cb715ccf2b9dfc25ecd39bffaf8fa794bc07410f666ac2ec15ebebebaabef"},
|
||||
{file = "fkeycapture-1.2.7.tar.gz", hash = "sha256:5ef9c90aec0420a2e462420a2bc8076a50ffd8566a9a022ac171c0e508f1d58d"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fpsql"
|
||||
version = "1.0.5"
|
||||
description = "An easy to use SQLite package"
|
||||
optional = false
|
||||
python-versions = ">=3.8,<4.0"
|
||||
files = [
|
||||
{file = "fpsql-1.0.5-py3-none-any.whl", hash = "sha256:a31f4bf99d44c0095a8246bfd78bd39cf96d9b3591363a3f6538ca40914679a4"},
|
||||
{file = "fpsql-1.0.5.tar.gz", hash = "sha256:647d148c5a17bca3a147a3bb281cc12dfc36f6f3f3652f22a1b2a1a3b7367c93"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy"
|
||||
version = "1.7.1"
|
||||
description = "Optional static typing for Python"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "mypy-1.7.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:12cce78e329838d70a204293e7b29af9faa3ab14899aec397798a4b41be7f340"},
|
||||
{file = "mypy-1.7.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1484b8fa2c10adf4474f016e09d7a159602f3239075c7bf9f1627f5acf40ad49"},
|
||||
{file = "mypy-1.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31902408f4bf54108bbfb2e35369877c01c95adc6192958684473658c322c8a5"},
|
||||
{file = "mypy-1.7.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f2c2521a8e4d6d769e3234350ba7b65ff5d527137cdcde13ff4d99114b0c8e7d"},
|
||||
{file = "mypy-1.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:fcd2572dd4519e8a6642b733cd3a8cfc1ef94bafd0c1ceed9c94fe736cb65b6a"},
|
||||
{file = "mypy-1.7.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4b901927f16224d0d143b925ce9a4e6b3a758010673eeded9b748f250cf4e8f7"},
|
||||
{file = "mypy-1.7.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2f7f6985d05a4e3ce8255396df363046c28bea790e40617654e91ed580ca7c51"},
|
||||
{file = "mypy-1.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:944bdc21ebd620eafefc090cdf83158393ec2b1391578359776c00de00e8907a"},
|
||||
{file = "mypy-1.7.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9c7ac372232c928fff0645d85f273a726970c014749b924ce5710d7d89763a28"},
|
||||
{file = "mypy-1.7.1-cp311-cp311-win_amd64.whl", hash = "sha256:f6efc9bd72258f89a3816e3a98c09d36f079c223aa345c659622f056b760ab42"},
|
||||
{file = "mypy-1.7.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6dbdec441c60699288adf051f51a5d512b0d818526d1dcfff5a41f8cd8b4aaf1"},
|
||||
{file = "mypy-1.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4fc3d14ee80cd22367caaaf6e014494415bf440980a3045bf5045b525680ac33"},
|
||||
{file = "mypy-1.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c6e4464ed5f01dc44dc9821caf67b60a4e5c3b04278286a85c067010653a0eb"},
|
||||
{file = "mypy-1.7.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:d9b338c19fa2412f76e17525c1b4f2c687a55b156320acb588df79f2e6fa9fea"},
|
||||
{file = "mypy-1.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:204e0d6de5fd2317394a4eff62065614c4892d5a4d1a7ee55b765d7a3d9e3f82"},
|
||||
{file = "mypy-1.7.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:84860e06ba363d9c0eeabd45ac0fde4b903ad7aa4f93cd8b648385a888e23200"},
|
||||
{file = "mypy-1.7.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8c5091ebd294f7628eb25ea554852a52058ac81472c921150e3a61cdd68f75a7"},
|
||||
{file = "mypy-1.7.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40716d1f821b89838589e5b3106ebbc23636ffdef5abc31f7cd0266db936067e"},
|
||||
{file = "mypy-1.7.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5cf3f0c5ac72139797953bd50bc6c95ac13075e62dbfcc923571180bebb662e9"},
|
||||
{file = "mypy-1.7.1-cp38-cp38-win_amd64.whl", hash = "sha256:78e25b2fd6cbb55ddfb8058417df193f0129cad5f4ee75d1502248e588d9e0d7"},
|
||||
{file = "mypy-1.7.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:75c4d2a6effd015786c87774e04331b6da863fc3fc4e8adfc3b40aa55ab516fe"},
|
||||
{file = "mypy-1.7.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2643d145af5292ee956aa0a83c2ce1038a3bdb26e033dadeb2f7066fb0c9abce"},
|
||||
{file = "mypy-1.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75aa828610b67462ffe3057d4d8a4112105ed211596b750b53cbfe182f44777a"},
|
||||
{file = "mypy-1.7.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ee5d62d28b854eb61889cde4e1dbc10fbaa5560cb39780c3995f6737f7e82120"},
|
||||
{file = "mypy-1.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:72cf32ce7dd3562373f78bd751f73c96cfb441de147cc2448a92c1a308bd0ca6"},
|
||||
{file = "mypy-1.7.1-py3-none-any.whl", hash = "sha256:f7c5d642db47376a0cc130f0de6d055056e010debdaf0707cd2b0fc7e7ef30ea"},
|
||||
{file = "mypy-1.7.1.tar.gz", hash = "sha256:fcb6d9afb1b6208b4c712af0dafdc650f518836065df0d4fb1d800f5d6773db2"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
mypy-extensions = ">=1.0.0"
|
||||
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
|
||||
typing-extensions = ">=4.1.0"
|
||||
|
||||
[package.extras]
|
||||
dmypy = ["psutil (>=4.0)"]
|
||||
install-types = ["pip"]
|
||||
mypyc = ["setuptools (>=50)"]
|
||||
reports = ["lxml"]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
version = "1.0.0"
|
||||
|
@ -209,4 +140,4 @@ files = [
|
|||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.10.11"
|
||||
content-hash = "1ce4f94f29be2c2c733383e74920efd5bce719b0dced66421994d1a2c3151c08"
|
||||
content-hash = "04186a7c3ddd06b42b5d9a10747bd64a556fae5b45cc1938ae67dd77ce27b2cd"
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
[tool.poetry]
|
||||
name = "firepup650-source"
|
||||
version = "1.0.0"
|
||||
name = "fpsql-source"
|
||||
version = "0.1.0"
|
||||
description = "Source"
|
||||
authors = ["Firepup650"]
|
||||
authors = ["Firepup Sixfifty <you@example.com>"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10.11"
|
||||
fkeycapture = "^1.2.3"
|
||||
black = "^23.3.0"
|
||||
fpsql = "^1.0.1"
|
||||
mypy = "^1.3.0"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
||||
[tool.black]
|
||||
|
||||
|
|
Loading…
Reference in a new issue