SadieDragon / TPR-Hints-Tool

A tool to take notes on the hints provided in the current release 1.2 of the Twilight Princess Randomizer.
0 stars 1 forks source link

Bug: The regex for (quality) is not strict enough #86

Closed SadieDragon closed 1 month ago

SadieDragon commented 1 month ago

Overview

The regex string '\((.*?)\)' is grabbing everything wrapped in parentheses, when the text could be Water Bombs (5) (not required)

Tasks to Complete

Further Information

It was found while patching the following error: (which may also be a real problem)

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\[redacted]\Lib\tkinter\__init__.py", line 1967, in __call__   
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "c:\Users\Sadie\Documents\Coding\Python\Random Script\Spoiler Log Scan\TPR-Hints-Tool\hints\gui\pick_spoiler.py", line 85, in <lambda>
    button.config(command=lambda: dump_and_autofill(spoiler_log,
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Sadie\Documents\Coding\Python\Random Script\Spoiler Log Scan\TPR-Hints-Tool\hints\data\parse\spoiler_log.py", line 34, in dump_and_autofill    parse_hints(data, notebook)
  File "c:\Users\Sadie\Documents\Coding\Python\Random Script\Spoiler Log Scan\TPR-Hints-Tool\hints\data\parse\hints.py", line 37, in parse_hints
    JovaniTab(notebook, sign_text=hint_text)
  File "c:\Users\Sadie\Documents\Coding\Python\Random Script\Spoiler Log Scan\TPR-Hints-Tool\hints\gui\shopping\jovani.py", line 26, in __init__
    self.auto_fill(sign_text)
  File "c:\Users\Sadie\Documents\Coding\Python\Random Script\Spoiler Log Scan\TPR-Hints-Tool\hints\gui\shopping\jovani.py", line 52, in auto_fill
    self.checkboxes[index].config(state='disabled')
    ~~~~~~~~~~~~~~~^^^^^^^
IndexError: list index out of range
SadieDragon commented 1 month ago

jaq gave me .*\((.*?)\).* ; somehow that fixed the bug, entirely. ... How?

SadieDragon commented 1 month ago

I patched in my own regex which just checks [a-z] for clarity.