Skip to content

Commit 4d9b394

Browse files
committed
fix:补全了缺失的安全的算子。feat:删除了checksum_ok变量
1 parent 104c475 commit 4d9b394

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/mineSweeperGUI.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def save_evf_file_integrated():
123123
self.score_board_manager.with_namespace({
124124
"race_identifier": self.race_identifier,
125125
"mode": self.gameMode,
126-
"checksum_ok": "--",
127126
"is_official": "--",
128127
"is_fair": "--",
129128
"row": self.row,
@@ -237,7 +236,6 @@ def game_state(self, game_state: str):
237236
self.label.paint_cursor = False
238237
self.set_country_flag()
239238
self.score_board_manager.with_namespace({
240-
"checksum_ok": "--",
241239
"is_official": "--",
242240
"is_fair": "--",
243241
"mode": self.gameMode,

src/mineSweeperVideoPlayer.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ def play_video(self, video, new_tab=False):
114114

115115

116116
# 检查evf的checksum,其余录像没有鉴定能力
117-
if isinstance(video, ms.EvfVideo):
118-
self.score_board_manager.with_namespace({
119-
"checksum_ok": self.checksum_guard.
120-
valid_checksum(video.raw_data[:-(len(video.checksum) + 2)], video.checksum),
121-
})
122-
else:
123-
self.score_board_manager.with_namespace({
124-
"checksum_ok": False,
125-
})
117+
# if isinstance(video, ms.EvfVideo):
118+
# self.score_board_manager.with_namespace({
119+
# "checksum_ok": self.checksum_guard.
120+
# valid_checksum(video.raw_data[:-(len(video.checksum) + 2)], video.checksum),
121+
# })
122+
# else:
123+
# self.score_board_manager.with_namespace({
124+
# "checksum_ok": False,
125+
# })
126126
self.score_board_manager.with_namespace({
127127
"is_official": video.is_official,
128128
"is_fair": video.is_fair,

src/safe_eval.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@
191191
'<8>',
192192
'<6>',
193193
'<10>',
194+
'<7>',
195+
'<13>',
196+
'<14>',
197+
'<16>',
198+
'<18>',
194199
"RESUME",
195200
"CACHE",
196201
"LOAD_NAME",
@@ -224,7 +229,6 @@
224229
'SWAP',
225230
'RERAISE',
226231
'UNARY_NOT',
227-
'<13>',
228232
'STORE_SLICE',
229233
'SET_ADD',
230234
'BINARY_SUBSCR',
@@ -320,6 +324,8 @@ def safe_eval(source, globals=None):
320324
a = safe_eval("[i**1.2 for i in [bbbv, right]]", constraints)
321325
a = safe_eval("[log(i) * sin(cos(i)) for i in [bbbv, right]][bbbv-67]", constraints)
322326
a = safe_eval("{i for i in (5,1,sin(cos(88)))}", constraints)
327+
a = safe_eval("f'mode ({bbbv}x{bbbv}/{bbbv})'", constraints)
328+
323329

324330

325331

0 commit comments

Comments
 (0)