Skip to content

Commit

Permalink
Merge pull request #69 from Night-stars-1:dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Night-stars-1 authored Jun 12, 2024
2 parents 918d331 + 0a79431 commit 99f215e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
2 changes: 2 additions & 0 deletions app/common/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def run(self):
self.result.emit(result)
except StopExecution:
pass
except AssertionError as e:
logger.error(f"{e}")
except Exception:
logger.exception("崩溃信息:")

Expand Down
18 changes: 9 additions & 9 deletions app/view/setting_interface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Author: Night-stars-1 nujj1042633805@gmail.com
Date: 2024-04-07 23:14:47
LastEditTime: 2024-05-09 23:48:19
LastEditTime: 2024-06-12 22:51:45
LastEditors: Night-stars-1 nujj1042633805@gmail.com
"""

Expand Down Expand Up @@ -46,13 +46,13 @@ def __init__(self, parent=None):
parent=self.musicInThisPCGroup,
isPassword=True,
)
self.adbPathCard = LineEditSettingCard(
cfg.adbPath,
"ADB路径",
FIF.PALETTE,
"ADB程序路径",
parent=self.musicInThisPCGroup,
)
# self.adbPathCard = LineEditSettingCard(
# cfg.adbPath,
# "ADB路径",
# FIF.PALETTE,
# "ADB程序路径",
# parent=self.musicInThisPCGroup,
# )
self.adbOrderCard = LineEditSettingCard(
cfg.adbOrder,
"ADB地址",
Expand Down Expand Up @@ -105,7 +105,7 @@ def __initLayout(self):
# add cards to group
self.musicInThisPCGroup.addSettingCard(self.goodsTypeCard)
self.musicInThisPCGroup.addSettingCard(self.uuidCard)
self.musicInThisPCGroup.addSettingCard(self.adbPathCard)
# self.musicInThisPCGroup.addSettingCard(self.adbPathCard)
self.musicInThisPCGroup.addSettingCard(self.adbOrderCard)
self.musicInThisPCGroup.addSettingCard(self.isSpeedCard)
self.musicInThisPCGroup.addSettingCard(self.isAutoPickCard)
Expand Down
4 changes: 2 additions & 2 deletions auto/run_business/buy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Author: Night-stars-1 nujj1042633805@gmail.com
Date: 2024-04-04 17:54:58
LastEditTime: 2024-05-31 20:10:25
LastEditTime: 2024-06-12 23:25:29
LastEditors: Night-stars-1 nujj1042633805@gmail.com
"""

Expand Down Expand Up @@ -227,7 +227,7 @@ def click_bargain_button(num=0):
return True
bgr = get_bgr(screenshot(), (1176, 461))
logger.debug(f"降价界面颜色检查: {bgr}")
if BGRGroup([0, 123, 240], [2, 133, 253]) == bgr:
if BGRGroup([0, 123, 240], [2, 133, 255]) == bgr:
input_tap((1177, 461))
time.sleep(1.0)
elif bgr == [251, 253, 253]:
Expand Down
4 changes: 2 additions & 2 deletions auto/run_business/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Author: Night-stars-1 nujj1042633805@gmail.com
Date: 2024-04-05 17:14:29
LastEditTime: 2024-05-31 20:13:45
LastEditTime: 2024-06-12 23:20:59
LastEditors: Night-stars-1 nujj1042633805@gmail.com
"""

Expand Down Expand Up @@ -41,7 +41,7 @@ def go_business(type: Literal["buy", "sell"] = "buy"):
time.sleep(1.0)
bgr = get_bgr(screenshot(), (1175, 460))
logger.debug(f"进入交易所颜色检查: {bgr}")
if bgr == [2, 133, 253] or bgr == [0, 183, 253] or BGR(225, 225, 225) == bgr:
if bgr == [2, 133, 253] or bgr == [0, 183, 253] or BGR(225, 225, 225) == bgr or bgr == BGR(0, 183, 253):
return True
else:
logger.error("进入交易所失败")
Expand Down
4 changes: 2 additions & 2 deletions auto/run_business/sell.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Author: Night-stars-1 nujj1042633805@gmail.com
Date: 2024-04-05 15:17:19
LastEditTime: 2024-05-31 20:50:51
LastEditTime: 2024-06-12 23:23:01
LastEditors: Night-stars-1 nujj1042633805@gmail.com
"""

Expand Down Expand Up @@ -64,7 +64,7 @@ def click_bargain_button(num=0):
return True
bgr = get_bgr(screenshot(), (1176, 461))
logger.debug(f"抬价界面颜色检查: {bgr}")
if BGRGroup([0, 170, 240], [2, 185, 253]) == bgr:
if BGRGroup([0, 170, 240], [5, 185, 253]) == bgr:
input_tap((1177, 461))
time.sleep(1.0)
elif bgr == [251, 253, 253]:
Expand Down
10 changes: 7 additions & 3 deletions core/models/kmou.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""
Author: Night-stars-1 nujj1042633805@gmail.com
Date: 2024-04-08 22:18:17
LastEditTime: 2024-04-10 00:42:00
LastEditTime: 2024-06-12 23:43:49
LastEditors: Night-stars-1 nujj1042633805@gmail.com
"""

from typing import Any, Dict, Optional
from typing import Any, Dict, Optional, Union

from core.exceptions import StopExecution

from .goods import GoodsModel

Expand All @@ -18,11 +20,13 @@ def __init__(self, **data) -> None:
@classmethod
def model_validate(
self,
obj: Any,
obj: Union[dict, list],
strict: Optional[bool] = None,
from_attributes: Optional[bool] = None,
context: Optional[Dict[str, Any]] = None,
) -> GoodsModel:
if isinstance(obj, dict):
assert obj.get("error") == None, obj["error"]
new_obj = []
for good in obj:
good["type"] = "sell" if good["type"] == "buy" else "buy"
Expand Down

0 comments on commit 99f215e

Please sign in to comment.