fated 0.2.1__tar.gz → 0.2.2__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.
- {fated-0.2.1/fated.egg-info → fated-0.2.2}/PKG-INFO +1 -1
- {fated-0.2.1 → fated-0.2.2}/fate/__init__.py +1 -1
- {fated-0.2.1 → fated-0.2.2}/fate/__pycache__/__init__.cpython-311.pyc +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/__pycache__/effects.cpython-311.pyc +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/__pycache__/utils.cpython-311.pyc +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/effects.py +3 -3
- {fated-0.2.1 → fated-0.2.2}/fate/utils.py +3 -2
- {fated-0.2.1 → fated-0.2.2/fated.egg-info}/PKG-INFO +1 -1
- {fated-0.2.1 → fated-0.2.2}/pyproject.toml +1 -1
- {fated-0.2.1 → fated-0.2.2}/LICENSE +0 -0
- {fated-0.2.1 → fated-0.2.2}/MANIFEST.in +0 -0
- {fated-0.2.1 → fated-0.2.2}/README.md +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/__init__.py.bak +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/__pycache__/animation.cpython-311.pyc +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/__pycache__/styles.cpython-311.pyc +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/animation.py +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/shortcuts.py +0 -0
- {fated-0.2.1 → fated-0.2.2}/fate/styles.py +0 -0
- {fated-0.2.1 → fated-0.2.2}/fated.egg-info/SOURCES.txt +0 -0
- {fated-0.2.1 → fated-0.2.2}/fated.egg-info/dependency_links.txt +0 -0
- {fated-0.2.1 → fated-0.2.2}/fated.egg-info/requires.txt +0 -0
- {fated-0.2.1 → fated-0.2.2}/fated.egg-info/top_level.txt +0 -0
- {fated-0.2.1 → fated-0.2.2}/setup.cfg +0 -0
- {fated-0.2.1 → fated-0.2.2}/setup.py +0 -0
Binary file
|
Binary file
|
Binary file
|
@@ -27,8 +27,8 @@ def typewriter(text: str, speed: int = 10, end: str = '') -> str:
|
|
27
27
|
def render_frame(content, step):
|
28
28
|
return content[:step]
|
29
29
|
|
30
|
-
# Run the animation
|
31
|
-
animate_text(text, render_frame, delay)
|
30
|
+
# Run the animation without printing the final text
|
31
|
+
animate_text(text, render_frame, delay, print_final=False)
|
32
32
|
|
33
33
|
# Return the full text plus any end character
|
34
34
|
return text + end
|
@@ -84,7 +84,7 @@ def fade_in(text: str, speed: int = 5) -> str:
|
|
84
84
|
def render_frame(content, step):
|
85
85
|
return content[:step]
|
86
86
|
|
87
|
-
animate_text(text, render_frame, delay)
|
87
|
+
animate_text(text, render_frame, delay, print_final=False)
|
88
88
|
return text
|
89
89
|
|
90
90
|
|
@@ -101,7 +101,7 @@ def create_effect(func: Callable) -> Callable:
|
|
101
101
|
return wrapper
|
102
102
|
|
103
103
|
|
104
|
-
def animate_text(text: str, render_func: Callable, delay: float = 0.05) -> str:
|
104
|
+
def animate_text(text: str, render_func: Callable, delay: float = 0.05, print_final: bool = False) -> str:
|
105
105
|
"""
|
106
106
|
Base function for text animations that handles rendering to the terminal.
|
107
107
|
|
@@ -109,6 +109,7 @@ def animate_text(text: str, render_func: Callable, delay: float = 0.05) -> str:
|
|
109
109
|
text: The text to animate
|
110
110
|
render_func: A function that takes (text, step) and returns what to print at each step
|
111
111
|
delay: Time delay between animation frames in seconds
|
112
|
+
print_final: Whether to print the final text after animation (default: False)
|
112
113
|
|
113
114
|
Returns:
|
114
115
|
The final text after animation completes
|
@@ -126,7 +127,7 @@ def animate_text(text: str, render_func: Callable, delay: float = 0.05) -> str:
|
|
126
127
|
if step < len(text):
|
127
128
|
time.sleep(delay)
|
128
129
|
|
129
|
-
# Add newline at the end of the animation
|
130
|
+
# Add newline at the end of the animation without printing the text again
|
130
131
|
sys.stdout.write('\n')
|
131
132
|
return text
|
132
133
|
except KeyboardInterrupt:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|