diff --git a/.pylintrc b/.pylintrc index dcfa3649..4495e34b 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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, + diff --git a/poker/main.py b/poker/main.py index bf716897..3d126494 100644 --- a/poker/main.py +++ b/poker/main.py @@ -39,7 +39,7 @@ warnings.filterwarnings("ignore", category=UserWarning) warnings.filterwarnings("ignore", category=RuntimeWarning) -version = 6.74 +version = 6.76 ui = None diff --git a/poker/scraper/table_screen_based.py b/poker/scraper/table_screen_based.py index 1d0ab38e..17ff6609 100644 --- a/poker/scraper/table_screen_based.py +++ b/poker/scraper/table_screen_based.py @@ -12,6 +12,7 @@ log = logging.getLogger(__name__) +# pylint: disable=unused-argument,f-string-without-interpolation,bare-except class TableScreenBased(Table): @@ -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 = '' @@ -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 diff --git a/poker/tests/test_decision.py b/poker/tests/test_decision.py index 5eeb3f53..4d6f277e 100644 --- a/poker/tests/test_decision.py +++ b/poker/tests/test_decision.py @@ -1,3 +1,4 @@ +"""Tests for decision making""" import unittest from unittest.mock import MagicMock @@ -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): diff --git a/poker/tools/update_checker.py b/poker/tools/update_checker.py index dece5418..bcf921b5 100644 --- a/poker/tools/update_checker.py +++ b/poker/tools/update_checker.py @@ -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')