Skip to content

Commit

Permalink
preflop fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dickreuter committed Jan 14, 2024
1 parent 6c2c62c commit d514529
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,11 @@ disable=raw-checker-failed,
consider-using-f-string,
unnecessary-dunder-call,
trailing-whitespace,

bare-except,
missing-module-docstring,
import-outside-toplevel,
missing-timeout,




Expand Down
2 changes: 1 addition & 1 deletion poker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
warnings.filterwarnings("ignore", category=UserWarning)
warnings.filterwarnings("ignore", category=RuntimeWarning)

version = 6.74
version = 6.76
ui = None


Expand Down
18 changes: 10 additions & 8 deletions poker/scraper/table_screen_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

log = logging.getLogger(__name__)

# pylint: disable=unused-argument,f-string-without-interpolation,bare-except

class TableScreenBased(Table):

Expand Down Expand Up @@ -195,17 +196,18 @@ def check_fast_fold(self, h, p, mouse):
crd1 = crd1.upper()
crd2 = crd2.upper()
sheet_name = str(self.position_utg_plus + 1)
if sheet_name == '6': return True
try:
if sheet_name == '6': return True
if int(sheet_name[0]) > 6:
old = sheet_name[0]
sheet_name = sheet_name.replace(old, '6', 1)
except Exception as e:
pass

sheet = h.preflop_sheet[sheet_name]
sheet['Hand'] = sheet['Hand'].apply(lambda x: str(x).upper())
handlist = set(sheet['Hand'].tolist())

sheet = h.preflop_sheet[sheet_name]
sheet['Hand'] = sheet['Hand'].apply(lambda x: str(x).upper())
handlist = set(sheet['Hand'].tolist())
except KeyError:
log.warning("Fastfold ignored: No preflop sheet found for position: " + str(sheet_name))
return True

found_card = ''

Expand Down Expand Up @@ -369,7 +371,7 @@ def get_other_player_status(self, p, h):

if ((h.previous_decision == "Call" or h.previous_decision == "Call2") and str(h.lastRoundGameID) == str(
h.GameID)) and \
not (self.checkButton == True and self.playersAhead == 0):
not (self.checkButton is True and self.playersAhead == 0):
self.other_player_has_initiative = True
else:
self.other_player_has_initiative = False
Expand Down
3 changes: 2 additions & 1 deletion poker/tests/test_decision.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Tests for decision making"""
import unittest
from unittest.mock import MagicMock

Expand All @@ -8,7 +9,7 @@
from poker.tests import init_table
from poker.tools.strategy_handler import StrategyHandler

# pylint: disable=unused-variable
# pylint: disable=unused-variable,missing-function-docstring,missing-class-docstring,invalid-name
@pytest.mark.skip(reason="Fix access issues")
class TestDecision(unittest.TestCase):
def test_no_test_bluff(self):
Expand Down
2 changes: 2 additions & 0 deletions poker/tools/update_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from poker.tools.helper import get_config

# pylint: disable=unused-variable,missing-function-docstring,missing-class-docstring,invalid-name,missing-timeout

config = get_config()
URL = config.config.get('main', 'db')

Expand Down

0 comments on commit d514529

Please sign in to comment.