libretrofuzz 2.9.2__tar.gz → 2.9.3__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: libretrofuzz
3
- Version: 2.9.2
3
+ Version: 2.9.3
4
4
  Summary: Fuzzy Retroarch thumbnail downloader
5
5
  Home-page: https://github.com/i30817/libretrofuzz
6
6
  License: MIT
@@ -13,13 +13,14 @@ Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.8
14
14
  Classifier: Programming Language :: Python :: 3.9
15
15
  Requires-Dist: beautifulsoup4 (>=4.10.0,<5.0.0)
16
+ Requires-Dist: colorama (>=0.4.6,<0.5.0)
16
17
  Requires-Dist: httpx (>=0.23.0,<0.24.0)
17
18
  Requires-Dist: pillow (>=9.2.0,<10.0.0)
18
19
  Requires-Dist: prompt_toolkit (>=3.0.30,<4.0.0)
19
20
  Requires-Dist: questionary (>=1.10.0,<2.0.0)
20
21
  Requires-Dist: rapidfuzz (>=2.4.2,<3.0.0)
21
22
  Requires-Dist: regex (>=2023.6.3,<2024.0.0)
22
- Requires-Dist: tqdm (>=4.64.0,<5.0.0)
23
+ Requires-Dist: tqdm (>=4.65.0,<5.0.0)
23
24
  Requires-Dist: typer[all] (>=0.5.0,<0.6.0)
24
25
  Project-URL: Bug Tracker, https://github.com/i30817/libretrofuzz/issues
25
26
  Project-URL: Repository, https://github.com/i30817/libretrofuzz
@@ -0,0 +1 @@
1
+ __version__ = '2.9.3'
@@ -102,6 +102,13 @@ class StopProgram(Exception):
102
102
  skip = False
103
103
  escape = False
104
104
  enter = False
105
+
106
+ @contextmanager
107
+ def handleContinueDownload():
108
+ try:
109
+ yield
110
+ except ContinueDownload:
111
+ pass
105
112
  def checkDownload():
106
113
  '''threading.get_native_id() in this and other acesses of these variables
107
114
  confirms all accesses are in synchronous functions on one thread so
@@ -632,9 +639,7 @@ async def downloader(names: [(str,str)],
632
639
  #not a error to pass a empty playlist
633
640
  if len(names) == 0:
634
641
  return
635
-
636
642
  thumbs = Thumbs._make( await downloadgamenames(client, system) )
637
-
638
643
  #before implies that the names of the playlists may be cut, so the hack and meta matching must be disabled
639
644
  if before:
640
645
  hack = False
@@ -777,12 +782,10 @@ async def downloader(names: [(str,str)],
777
782
 
778
783
  async def printwait(wait : Optional[float], waiting_format: str):
779
784
  count = int(wait/0.1)
780
- try:
785
+ with handleContinueDownload():
781
786
  for i in trange(count, dynamic_ncols=True, bar_format=waiting_format, colour='YELLOW', leave=False):
782
787
  checkDownload()
783
788
  await asyncio.sleep(0.1)
784
- except ContinueDownload as e:
785
- pass
786
789
 
787
790
  async def download(client, url, destination, download_format, missing_format, waiting_format, first_wait, wait_before, max_retries):
788
791
  '''returns True if downloaded. To download, it must have waited, if first_wait is True. Exceptions may happen instead of returning False, but they
@@ -805,8 +808,9 @@ async def download(client, url, destination, download_format, missing_format, wa
805
808
  await printwait(wait_before, waiting_format)
806
809
  with tqdm.wrapattr(f, 'write', total=length, dynamic_ncols=True, bar_format=download_format, colour='BLUE', leave=False) as w:
807
810
  async for chunk in r.aiter_raw(4096):
811
+ with handleContinueDownload():
808
812
  checkDownload()
809
- w.write(chunk)
813
+ w.write(chunk)
810
814
  return True
811
815
  except (RequestError,HTTPStatusError) as e:
812
816
  if max_retries <= 0:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "libretrofuzz"
3
- version = "2.9.2"
3
+ version = "2.9.3"
4
4
  description = "Fuzzy Retroarch thumbnail downloader"
5
5
  authors = ["i30817 <i30817@gmail.com>"]
6
6
  license = "MIT"
@@ -14,10 +14,11 @@ questionary = "^1.10.0"
14
14
  typer = {extras = ["all"], version = "^0.5.0"}
15
15
  rapidfuzz = "^2.4.2"
16
16
  httpx = "^0.23.0"
17
- tqdm = "^4.64.0"
17
+ tqdm = "^4.65.0"
18
18
  prompt_toolkit = "^3.0.30"
19
19
  pillow = "^9.2.0"
20
20
  regex = "^2023.6.3"
21
+ colorama = "^0.4.6"
21
22
 
22
23
 
23
24
  [tool.poetry.scripts]
@@ -9,13 +9,14 @@ package_data = \
9
9
 
10
10
  install_requires = \
11
11
  ['beautifulsoup4>=4.10.0,<5.0.0',
12
+ 'colorama>=0.4.6,<0.5.0',
12
13
  'httpx>=0.23.0,<0.24.0',
13
14
  'pillow>=9.2.0,<10.0.0',
14
15
  'prompt_toolkit>=3.0.30,<4.0.0',
15
16
  'questionary>=1.10.0,<2.0.0',
16
17
  'rapidfuzz>=2.4.2,<3.0.0',
17
18
  'regex>=2023.6.3,<2024.0.0',
18
- 'tqdm>=4.64.0,<5.0.0',
19
+ 'tqdm>=4.65.0,<5.0.0',
19
20
  'typer[all]>=0.5.0,<0.6.0']
20
21
 
21
22
  entry_points = \
@@ -24,7 +25,7 @@ entry_points = \
24
25
 
25
26
  setup_kwargs = {
26
27
  'name': 'libretrofuzz',
27
- 'version': '2.9.2',
28
+ 'version': '2.9.3',
28
29
  'description': 'Fuzzy Retroarch thumbnail downloader',
29
30
  'long_description': "**Fuzzy Retroarch thumbnail downloader**\n========================================\n\nIn Retroarch, when you use the manual scanner to get nonstandard games or hacks in playlists, thumbnails often fail to download.\n\nThese programs, for each game label on a playlist, download the most similar named image to display in retroarch.\n\nThere are several options to fit unusual labels and increase fuzziness, but you can just run them to get the most restrictive default (with the least fuzz).\n\nIf you use ``libretro-fuzz``, it will download for a single playlist by asking for the playlist and system if they're not provided.\nIf you use ``libretro-fuzzall``, it will download for all playlists with standard libretro names, and will skip custom playlists.\n\nBesides those differences, if no retroarch.cfg is provided, both programs try to use the default retroarch.cfg.\n\nIf `chafa <https://github.com/hpjansson/chafa>`_ is installed, the program will display new thumbnails of a game, with gray border for images already in use and with green border for new images. Chafa works better with a recent release and on a `sixel <https://en.wikipedia.org/wiki/Sixel>`_ or `kitty <https://sw.kovidgoyal.net/kitty/graphics-protocol/>`_ compatible shell.\n\nExample:\n | ``libretro-fuzz --system 'Commodore - Amiga' --before '_'``\n | then\n | ``libretro-fuzz --system 'Commodore - Amiga' --no-subtitle --before '_'``\n \n The Retroplay WHDLoad set has labels like ``MonkeyIsland2_v1.3_0020`` after a manual scan. These labels *often* don't have subtitles (but not always) and all the metadata is not separated from the name by brackets. Select the playlist that contains those whdloads to download from the libretro amiga thumbnails.\n\nNote that the system name you download from doesn't have to be the same as the playlist name.\n\nIf the thumbnail server contains games from multiple releases for the system (like ``ScummVM``), be careful using extra options since it is easy to end up with 'slightly wrong' covers.\n\nExample:\n ``libretro-fuzz --no-meta --no-merge``\n \n After downloading ``ScummVM`` thumbnails (and not before, to minimize false positives), we'd like to try to pickup a few covers from ``DOS`` thumbnails and skip download if there a risk of mixing thumbnails from ``DOS`` and ``ScummVM`` for a single game.\n Choose the ScummVM playlist and DOS system name, and covers would be downloaded with risk of false positives: CD vs floppy covers, USA vs Japan covers, or another platform vs DOS.\n\nBecause of this increased risk of false positives with options, the default is to count everything except hack metadata as part of the match, only select the names that match exactly (after 'safe' heuristics like removing spaces) and the default pre-selected system name to be the same as the playlist name, which is safest.\n\nFalse positives will then be from using ``--score`` (allows inexact matches) or/and one of the commands that do not count metadata (``--before``, ``--no-meta`` and ``--no-subtitle``). A common scenario is the thumbnail server not having a single thumbnail of the game, and the program selecting the best match it can which is still good enough to pass, like a sequel, prequel, or different release, most often regions/languages. It's not recommended to use ``--score`` less than 100 without ``--filter`` to a specific game.\n\nExample:\n ``libretro-fuzz --system 'Commodore - Amiga' --no-subtitle --before '_' --filter '[Ii]shar*'``\n \n The best way to solve these issues is to upload the right cover to the respective libretro-thumbnail subproject with the correct name of the game variant. Then you can redownload just the updated thumbnails with a label, in this example, because of ``--filter``, the Ishar series in the WHDLoad playlist would redownload.\n\nlibretro-fuzzall/libretro-fuzz [OPTIONS] [CFG]\n :CFG: Path to the retroarch cfg file. If not default, asked from the user.\n \n Linux default: ``~/.config/retroarch/retroarch.cfg``\n \n Windows default: ``%APPDATA%/RetroArch/retroarch.cfg``\n \n MacOS default: ``~/Library/Application Support/RetroArch/config/retroarch.cfg``\n \n --playlist <NAME libretro-fuzz only>\n Playlist name with labels used for thumbnail fuzzy matching. If not provided, asked from the user.\n --system <NAME libretro-fuzz only>\n Directory name in the server to download thumbnails. If not provided, asked from the user.\n --delay-after FLOAT | Seconds after download to skip replacing thumbnails, enter continues. No-op with ``--no-image``.\n | [1<=x<=30]\n --delay FLOAT | Seconds to skip thumbnails download, enter continues.\n | [1<=x<=30]\n --filter GLOB Restricts downloads to game labels globs - not paths - in the playlist, can be used multiple times and resets thumbnails, ``--filter '*'`` redownloads all.\n --score FUZZ | Min fuzz, 0=no-fail, 100=average, 200≃equal,default. No-op with ``--no-fail``.\n | [default: 200; 0<=x<=200]\n --no-fail Download any score. Equivalent to ``--score 0``.\n --no-image Don't show images even with chafa installed.\n --no-merge Disables missing thumbnails download for a label if there is at least one in cache to avoid mixing thumbnails from different server directories on repeated calls. No-op with ``--filter``.\n --no-subtitle Ignores text after last ``' - '`` or ``': '``. ``':'`` can't occur in server names, so if the server has ``'Name_subtitle.png'`` and not ``'Name - subtitle.png'`` (uncommon), this option doesn't help.\n --no-meta Ignores () delimited metadata and may cause false positives. Forced with ``--before``.\n --hack Matches [] delimited metadata and may cause false positives, Best used if the hack has thumbnails. Ignored with ``--before``.\n --before TEXT Use only the part of the label before TEXT to match. TEXT may not be inside of brackets of any kind, may cause false positives but some labels do not have traditional separators. Forces ignoring metadata.\n --address URL | URL with libretro-thumbnails server. For local files, git clone/unzip packs, run ``'python3 -m http.server'`` in parent dir, and use ``--address 'http://localhost:8000'``.\n | [default: https://thumbnails.libretro.com]\n --verbose Shows the failures, score and normalized local and server names in output.\n --install-completion Install completion for the current shell.\n --show-completion Show completion for the current shell, to copy it or customize the installation.\n --help Show this message and exit.\n\n\n\nTo install the program, type on the cmd line\n\n+----------------+---------------------------------------------------------------------------------------------+\n| Latest release | ``pip install --force-reinstall libretrofuzz`` |\n+----------------+---------------------------------------------------------------------------------------------+\n| Current code | ``pip install --force-reinstall https://github.com/i30817/libretrofuzz/archive/master.zip`` |\n+----------------+---------------------------------------------------------------------------------------------+\n\nIn windows, you'll want to check the option to “Add Python to PATH” when installing python, to be able to install and execute the script from any path of the cmd line.\n",
30
31
  'author': 'i30817',
@@ -1 +0,0 @@
1
- __version__ = '2.9.2'
File without changes
File without changes