Kpenciler commited on
Commit
ea78fab
โ€ข
1 Parent(s): 1058ca8

Upload 5 files

Browse files
Files changed (2) hide show
  1. app_gradio.py +2 -1
  2. utils.py +3 -3
app_gradio.py CHANGED
@@ -3,7 +3,8 @@ from utils import get_calculated_df, get_info, text2oddslist
3
 
4
 
5
  def calculate(amount, text):
6
- df = get_calculated_df(amount, text2oddslist(text))
 
7
  info = get_info(df)
8
 
9
  # dfใฎๆ•ดๅฝข
 
3
 
4
 
5
  def calculate(amount, text):
6
+ odds_list = text2oddslist(text)
7
+ df = get_calculated_df(amount, odds_list)
8
  info = get_info(df)
9
 
10
  # dfใฎๆ•ดๅฝข
utils.py CHANGED
@@ -48,8 +48,9 @@ def _text2oddslist_pc(text: str) -> OdddsList:
48
  def _text2oddslist_mobile(text: str) -> OdddsList:
49
  odds_list: OdddsList = []
50
  lines: list[str] = text.split("\n")
51
- if "้ธๆŠž" in lines:
52
- lines = lines[lines.index("้ธๆŠž") + 1 :]
 
53
  if "ใ™ในใฆใ‚’้ธๆŠž" in lines:
54
  lines = lines[: lines.index("ใ™ในใฆใ‚’้ธๆŠž")]
55
  for i in range(len(lines) // 3):
@@ -90,7 +91,6 @@ def get_calculated_df(amount: int, odds_list: OdddsList) -> pd.DataFrame:
90
  )
91
  df["refound"] = (df["buy"] * df["odds"]).astype(int)
92
  df["profit"] = df["refound"] - amount
93
- df = df
94
  return df
95
 
96
 
 
48
  def _text2oddslist_mobile(text: str) -> OdddsList:
49
  odds_list: OdddsList = []
50
  lines: list[str] = text.split("\n")
51
+ for strat_key in ("้ธๆŠž", "ใ‚ชใƒƒใ‚บ", "็ต„ใฟๅˆใ‚ใ›", "ใ‚ชใƒƒใ‚บใ‚’่ฆ‹ใฆๅ€‹ๅˆฅ้ธๆŠž"):
52
+ if strat_key in lines:
53
+ lines = lines[lines.index(strat_key) + 1 :]
54
  if "ใ™ในใฆใ‚’้ธๆŠž" in lines:
55
  lines = lines[: lines.index("ใ™ในใฆใ‚’้ธๆŠž")]
56
  for i in range(len(lines) // 3):
 
91
  )
92
  df["refound"] = (df["buy"] * df["odds"]).astype(int)
93
  df["profit"] = df["refound"] - amount
 
94
  return df
95
 
96