Skip to content

Commit 41a889c

Browse files
committed
Fixes to sc2printer and team.lineup.
1 parent 3396985 commit 41a889c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

sc2reader/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def load_players(self):
396396

397397
#Create an store an ordered lineup string
398398
for team in self.teams:
399-
team.lineup = sorted(player.play_race[0].upper() for player in team)
399+
team.lineup = ''.join(sorted(player.play_race[0].upper() for player in team))
400400

401401
# Special case FFA games and sort outmatched games in ascending order
402402
team_sizes = [len(team.players) for team in self.teams]

sc2reader/scripts/sc2printer.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def doFile(filename, arguments):
1818
return
1919
prev = e.game_events[-1]
2020
print "\nVersion {0} replay:\n\t{1}".format(e.replay.release_string, e.replay.filename)
21-
print "\t{0}, Type={1:X}, Code={2:X}".format(e.msg, e.type,e.code)
21+
print "\t{0}, Type={1:X}".format(e.msg, e.type)
2222
print "\tPrevious Event: {0}".format(prev.name)
2323
print "\t\t"+prev.bytes.encode('hex')
2424
print "\tFollowing Bytes:"
@@ -43,11 +43,8 @@ def doFile(filename, arguments):
4343
if arguments.date:
4444
print " Date: {0}".format(replay.date)
4545
if arguments.teams:
46-
races = list()
47-
for team in replay.teams:
48-
races.append(''.join([player.pick_race[0] for player in team.players]))
49-
print " Teams: {0}".format("v".join(races))
50-
46+
lineups = [team.lineup for team in replay.teams]
47+
print " Teams: {0}".format("v".join(lineups))
5148
for team in replay.teams:
5249
print " Team {0}\t{1} ({2})".format(team.number,team.players[0].name,team.players[0].pick_race[0])
5350
for player in team.players[1:]:
@@ -84,7 +81,7 @@ def main():
8481

8582
for path in arguments.paths:
8683
if arguments.recursive:
87-
files = utils.get_replay_files(path)
84+
files = utils.get_files(path, extension='SC2Replay')
8885
else:
8986
files = utils.get_replay_files(path, depth=0)
9087

0 commit comments

Comments
 (0)