Skip to content

Commit 6580ebb

Browse files
committed
Fix various issues related to issue #180.
1 parent 6f30900 commit 6580ebb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sc2reader/engine/plugins/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def handleCommandEvent(self, event, replay):
2828
if not getattr(replay, 'marked_error', None):
2929
replay.marked_error = True
3030
event.logger.error(replay.filename)
31-
event.logger.error("Release String: "+replay.release_string)
31+
event.logger.error("Release String: " + replay.release_string)
3232
for player in replay.players:
3333
event.logger.error("\t{0}".format(player))
3434

@@ -254,7 +254,7 @@ def load_message_game_player(self, event, replay):
254254
event.player = replay.human[event.pid]
255255
event.player.events.append(event)
256256
elif event.pid != 16:
257-
self.logger.error("Bad pid ({0}) for event {1} at {2} [{3}].".format(event.pid, event.__class__, Length(seconds=event.second), event.frames))
257+
self.logger.error("Bad pid ({0}) for event {1} at {2} [{3}].".format(event.pid, event.__class__, Length(seconds=event.second), event.frame))
258258
else:
259259
pass # This is a global event
260260

sc2reader/scripts/sc2parse.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,31 +66,31 @@ def main():
6666
print("")
6767
print(path)
6868
print('{build} - {real_type} on {map_name} - Played {start_time}'.format(**e.replay.__dict__))
69-
print('[ERROR]', e.message)
69+
print('[ERROR] {}', e)
7070
for event in e.game_events[-5:]:
7171
print('{0} - {1}'.format(hex(event.type), event.bytes.encode('hex')))
72-
print(e.buffer.read_range(e.location, e.location+50).encode('hex'))
72+
print(e.buffer.read_range(e.location, e.location + 50).encode('hex'))
7373
print
7474
except Exception as e:
7575
print("")
7676
print(path)
7777
try:
7878
replay = sc2reader.load_replay(path, debug=True, load_level=2)
7979
print('{build} - {real_type} on {map_name} - Played {start_time}'.format(**replay.__dict__))
80-
print('[ERROR] {0}'.format(e.message))
80+
print('[ERROR] {0}'.format(e))
8181
for pid, attributes in replay.attributes.items():
8282
print("{0} {1}".format(pid, attributes))
83-
for pid, info in enumerate(replay.raw_data['replay.details'].players):
83+
for pid, info in enumerate(replay.players):
8484
print("{0} {1}".format(pid, info))
85-
for message in replay.raw_data['replay.message.events'].messages:
85+
for message in replay.messages:
8686
print("{0} {1}".format(message.pid, message.text))
8787
traceback.print_exc()
8888
print("")
8989
except Exception as e2:
9090
replay = sc2reader.load_replay(path, debug=True, load_level=0)
9191
print('Total failure parsing {release_string}'.format(**replay.__dict__))
92-
print('[ERROR] {0}'.format(e.message))
93-
print('[ERROR] {0}'.format(e2.message))
92+
print('[ERROR] {0}'.format(e))
93+
print('[ERROR] {0}'.format(e2))
9494
traceback.print_exc()
9595
print
9696

0 commit comments

Comments
 (0)