anifetch-cli 1.0.6__tar.gz → 1.0.7__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.
Files changed (22) hide show
  1. {anifetch_cli-1.0.6/src/anifetch_cli.egg-info → anifetch_cli-1.0.7}/PKG-INFO +2 -2
  2. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/README.md +1 -1
  3. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/pyproject.toml +1 -1
  4. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/cli.py +13 -0
  5. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/renderer.py +2 -6
  6. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7/src/anifetch_cli.egg-info}/PKG-INFO +2 -2
  7. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/LICENSE +0 -0
  8. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/setup.cfg +0 -0
  9. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/__init__.py +0 -0
  10. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/__main__.py +0 -0
  11. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/ansi2txt.py +0 -0
  12. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/ansi_process.py +0 -0
  13. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/ansi_process2.py +0 -0
  14. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/assets/example.mp4 +0 -0
  15. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/core.py +0 -0
  16. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/keyreader.py +0 -0
  17. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch/utils.py +0 -0
  18. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch_cli.egg-info/SOURCES.txt +0 -0
  19. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch_cli.egg-info/dependency_links.txt +0 -0
  20. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch_cli.egg-info/entry_points.txt +0 -0
  21. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch_cli.egg-info/requires.txt +0 -0
  22. {anifetch_cli-1.0.6 → anifetch_cli-1.0.7}/src/anifetch_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anifetch-cli
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Animated terminal fetch with video and audio support.
5
5
  Author-email: Notenlish <notenlish@gmail.com>
6
6
  Maintainer: Immelancholy
@@ -385,4 +385,4 @@ I dont remember where I got the example.mp4 video from, if you know the source o
385
385
 
386
386
  ## Star History
387
387
 
388
- [![Star History Chart](https://api.star-history.com/svg?repos=Notenlish/anifetch&type=Date)](https://www.star-history.com/#Notenlish/anifetch&Date)
388
+ [![Star History Chart](https://star-history.dera.page/svg?repos=Notenlish/anifetch&type=Date)](https://star-history.dera.page/#Notenlish/anifetch&Date)
@@ -358,4 +358,4 @@ I dont remember where I got the example.mp4 video from, if you know the source o
358
358
 
359
359
  ## Star History
360
360
 
361
- [![Star History Chart](https://api.star-history.com/svg?repos=Notenlish/anifetch&type=Date)](https://www.star-history.com/#Notenlish/anifetch&Date)
361
+ [![Star History Chart](https://star-history.dera.page/svg?repos=Notenlish/anifetch&type=Date)](https://star-history.dera.page/#Notenlish/anifetch&Date)
@@ -22,7 +22,7 @@
22
22
  "fastfetch",
23
23
  "anifetch",
24
24
  ]
25
- version = "1.0.6"
25
+ version = "1.0.7"
26
26
  description = "Animated terminal fetch with video and audio support."
27
27
  # If I put everyone here it messes with the "author" meta section.
28
28
  authors = [{ name = "Notenlish", email = "notenlish@gmail.com" }]
@@ -3,9 +3,21 @@ Anifetch CLI module for parsing command line arguments.
3
3
  """
4
4
 
5
5
  import argparse
6
+ import math
6
7
  from .utils import get_version_of_anifetch
7
8
 
8
9
 
10
+ def positive_float(value):
11
+ """argparse type: a finite number strictly greater than 0."""
12
+ try:
13
+ number = float(value)
14
+ except (TypeError, ValueError):
15
+ raise argparse.ArgumentTypeError(f"{value!r} is not a number")
16
+ if not math.isfinite(number) or number <= 0:
17
+ raise argparse.ArgumentTypeError(f"{value!r} must be greater than 0")
18
+ return number
19
+
20
+
9
21
  parser = argparse.ArgumentParser(
10
22
  prog="Anifetch",
11
23
  description="Allows you to use fastfetch/neofetch with video in terminal.",
@@ -57,6 +69,7 @@ parser.add_argument(
57
69
  "-pr",
58
70
  "--playback-rate",
59
71
  default=10,
72
+ type=positive_float,
60
73
  help="Default is 10. Ignored when a sound is playing so that desync doesn't happen. Sets the playback rate of the animation. Not to be confused with the 'framerate' option. This basically sets for how long the script will wait before rendering new frame, while the framerate option affects how many frames are generated via ffmpeg.",
61
74
  )
62
75
  parser.add_argument(
@@ -55,7 +55,7 @@ class Renderer:
55
55
  self,
56
56
  base_path: str,
57
57
  cache_path: str,
58
- framerate_to_use: int,
58
+ framerate_to_use: float,
59
59
  top: int,
60
60
  left: int,
61
61
  right: int,
@@ -82,7 +82,7 @@ class Renderer:
82
82
  ):
83
83
  self.base_path: str = base_path
84
84
  self.cache_path: str = cache_path
85
- self.framerate_to_use: int = framerate_to_use
85
+ self.framerate_to_use: float = framerate_to_use
86
86
  self.top: int = top
87
87
  self.left: int = left
88
88
  self.right: int = right
@@ -118,10 +118,6 @@ class Renderer:
118
118
  self.template_buffer: list[str] = []
119
119
  self._make_truncated_template(self.last_terminal_width)
120
120
 
121
- num_lines = bottom - top
122
- sleep_time = 1 / framerate_to_use
123
- self.adjusted_sleep_time: float = sleep_time / num_lines
124
-
125
121
  self.resize_requested: bool = False
126
122
  self.resize_in_progress: bool = False
127
123
  self.resize_delay: float = 0.033 # seconds
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anifetch-cli
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Animated terminal fetch with video and audio support.
5
5
  Author-email: Notenlish <notenlish@gmail.com>
6
6
  Maintainer: Immelancholy
@@ -385,4 +385,4 @@ I dont remember where I got the example.mp4 video from, if you know the source o
385
385
 
386
386
  ## Star History
387
387
 
388
- [![Star History Chart](https://api.star-history.com/svg?repos=Notenlish/anifetch&type=Date)](https://www.star-history.com/#Notenlish/anifetch&Date)
388
+ [![Star History Chart](https://star-history.dera.page/svg?repos=Notenlish/anifetch&type=Date)](https://star-history.dera.page/#Notenlish/anifetch&Date)
File without changes
File without changes