From 2faec15eddea2706f64b5b3a29da3f95c421905e Mon Sep 17 00:00:00 2001 From: DrkYoda <97921718+DrkYoda@users.noreply.github.com> Date: Thu, 28 Sep 2023 19:36:35 -0500 Subject: [PATCH] Add ability to parse integer amounts Fixes #50 --- main.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index f8f7e74..3a583f2 100644 --- a/main.py +++ b/main.py @@ -63,6 +63,8 @@ - Fixed issue #43 v 1.2.4 - Fixed issue #45 +v 1.2.5 + - Fixed issue #50 **************************************************************************************************** """ # MODULES @@ -73,7 +75,6 @@ import logging from pathlib import Path import re -from shutil import move from time import perf_counter, process_time from typing import List from rich.console import Console @@ -444,7 +445,7 @@ def switch_key_and_values(name_map: dict[str, dict[str, list[str]]], key_txt: st game_number_regex = re.compile(r"(?P\d{13})") hand_time_regex = re.compile(r"(?P.+:\d+)") seats_regex = re.compile( - r" #(?P\d+) \"(?P.+?) @ (?P[-\w]+)\" \((?P\d+\.\d{2})\)" + r" #(?P\d+) \"(?P.+?) @ (?P[-\w]+)\" \((?P\d+\.\d{2}|\d+)\)" ) post_regex = re.compile( r"\"(?P.+?) @ (?P[-\w]+)\" (?Pposts a .+) " @@ -453,18 +454,18 @@ def switch_key_and_values(name_map: dict[str, dict[str, list[str]]], key_txt: st round_regex = re.compile(r"(?P^\w.+):.+") cards_regex = re.compile(r"\[(?P.+)\]") addon_regex = re.compile( - r"(?P.+?) @ (?P[-\w]+)\" adding (?P\d+\.\d{2})" + r"(?P.+?) @ (?P[-\w]+)\" adding (?P\d+\.\d{2}|\d+)" ) hero_hand_regex = re.compile(r"Your hand is (?P.+)") non_bet_action_regex = re.compile( - r"\"(?P.+?) @ (?P[-\w]+)\" (?P\w+(?![ a-z]+\d+\.\d{2}))" + r"\"(?P.+?) @ (?P[-\w]+)\" (?P\w+(?![ a-z]+(?:\d+\.\d{2}|\d+)))" ) bet_action_regex = re.compile( r"\"(?P.+?) @ (?P[-\w]+)\" (?!collected)(?!shows)(?P\w+) " - r"[a-z]*\s*(?P\d+\.\d{2})\s*(?P[a-z ]+)*" + r"[a-z]*\s*(?P\d+\.\d{2}|\d+)\s*(?P[a-z ]+)*" ) uncalled_regex = re.compile( - r"Uncalled bet of (?P\d+\.\d{2}) .+ \"(?P.+?) @ (?P[-\w]+)\"" + r"Uncalled bet of (?P\d+\.\d{2}|\d+) .+ \"(?P.+?) @ (?P[-\w]+)\"" ) show_regex = re.compile( r"\"(?P.+?) @ (?P[-\w]+)\" " @@ -472,7 +473,7 @@ def switch_key_and_values(name_map: dict[str, dict[str, list[str]]], key_txt: st ) winner_regex = re.compile( r"\"(?P.+?) @ (?P[-\w]+)\" (?Pcollected) " - r"(?P\d+\.\d{2}).+" + r"(?P\d+\.\d{2}|\d+).+" ) log_dir = Path("./Logs") log_dir.mkdir(exist_ok=True)