File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 33
44import sys
55import sc2reader
6+ import traceback
67
78def main ():
8- for replay in sc2reader .load_replays (sys .argv [1 :], verbose = True ):
9- pass
9+ for argument in sys .argv [1 :]:
10+ for path in sc2reader .utils .get_files (argument ):
11+ try :
12+ replay = sc2reader .load_replay (path , debug = True )
13+ except sc2reader .exceptions .ReadError as e :
14+ print e .replay .filename
15+ print '{build} - {real_type} on {map_name} - Played {start_time}' .format (** e .replay .__dict__ )
16+ print '[ERROR]' , e .message
17+ for event in e .game_events [- 5 :]:
18+ print '{0} - {1}' .format (hex (event .type ),event .bytes .encode ('hex' ))
19+ e .buffer .seek (e .location )
20+ print e .buffer .peek (50 ).encode ('hex' )
21+ print
22+ except Exception as e :
23+ print path
24+ replay = sc2reader .load_replay (path , debug = True , load_level = 1 )
25+ print '{build} - {real_type} on {map_name} - Played {start_time}' .format (** replay .__dict__ )
26+ print '[ERROR]' , e
27+ traceback .print_exc ()
28+ print
29+
30+
31+
1032
1133if __name__ == '__main__' :
1234 main ()
You can’t perform that action at this time.
0 commit comments