diff --git a/.cache/replit/__replit_disk_meta.json b/.cache/replit/__replit_disk_meta.json index 4f46f61..3a04e9d 100644 --- a/.cache/replit/__replit_disk_meta.json +++ b/.cache/replit/__replit_disk_meta.json @@ -1 +1 @@ -{"nonce":6494760093704306076,"last_updated":{"seconds":1681990364,"nanos":523064000}} +{"nonce":6281290299956684074,"last_updated":{"seconds":1682008736,"nanos":470800000}} diff --git a/build.py b/build.py index efb8210..7aac38a 100644 --- a/build.py +++ b/build.py @@ -10,5 +10,4 @@ def build(): edit() cmd("clear") print("Run these commands next: \n cd package\n python3 -m build\n python3 -m twine upload -r pypi dist/*") -# __token__ cmd("bash") \ No newline at end of file diff --git a/package/README.md b/package/README.md index d21406c..2bde175 100644 --- a/package/README.md +++ b/package/README.md @@ -1,5 +1,7 @@ # Firepup650 Package containing various shorthand things I use, and a few imports I almost always use #### Change log: +###### v.1.0.1: +Added animated typing function, sleep shorthand ###### v.1.0.0: Initial Release! \ No newline at end of file diff --git a/package/dist/firepup650-1.0.0.tar.gz b/package/dist/firepup650-1.0.0.tar.gz deleted file mode 100644 index 5b6140b..0000000 Binary files a/package/dist/firepup650-1.0.0.tar.gz and /dev/null differ diff --git a/package/dist/firepup650-1.0.1-py3-none-any.whl b/package/dist/firepup650-1.0.1-py3-none-any.whl new file mode 100644 index 0000000..1e9571a Binary files /dev/null and b/package/dist/firepup650-1.0.1-py3-none-any.whl differ diff --git a/package/dist/firepup650-1.0.1.tar.gz b/package/dist/firepup650-1.0.1.tar.gz new file mode 100644 index 0000000..f643899 Binary files /dev/null and b/package/dist/firepup650-1.0.1.tar.gz differ diff --git a/package/setup.cfg b/package/setup.cfg index d06aad8..0ec8f51 100644 --- a/package/setup.cfg +++ b/package/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = firepup650 -version = 1.0.0 +version = 1.0.1 author = Firepup650 author_email = firepyp650@gmail.com description = Package containing various shorthand things I use, and a few imports I almost always use diff --git a/package/src/firepup650.egg-info/PKG-INFO b/package/src/firepup650.egg-info/PKG-INFO index 19018f4..cdd344a 100644 --- a/package/src/firepup650.egg-info/PKG-INFO +++ b/package/src/firepup650.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: firepup650 -Version: 1.0.0 +Version: 1.0.1 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 @@ -11,6 +11,8 @@ 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.1: + Added animated typing function, sleep shorthand ###### v.1.0.0: Initial Release! Platform: UNKNOWN diff --git a/package/src/firepup650/__init__.py b/package/src/firepup650/__init__.py index 1ff7f22..62d6029 100644 --- a/package/src/firepup650/__init__.py +++ b/package/src/firepup650/__init__.py @@ -1,5 +1,5 @@ """Firepup650's PYPI Package""" -import os, sys +import os, sys, termios, tty, time import random as r import fkeycapture as fkey def clear() -> None: @@ -78,4 +78,40 @@ def gp(keycount: int = 1, chars: list = ["1" ,"2"], bytes: bool = False) -> str if not bytes: return keys else: - return keys.encode() \ No newline at end of file + 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 key interruptions + tty.setcbreak(sys.stdin) + for char in text: + print(char, end='', flush=True) + time.sleep(delay) + if newline: + print() + # Restore the original terminal settings + termios.tcsetattr(sys.stdin, termios.TCSADRAIN,original_terminal_settings) +def sleep(seconds: float = 0.5) -> None: + """# Function: sleep + Calls `time.sleep(seconds)` + # Inputs: + seconds: float - How long to sleep for (in seconds), defaults to 0.5 + + # Returns: + None + + # Raises: + None""" + time.sleep(seconds) \ No newline at end of file