Skip to content

Commit 9ef9fc4

Browse files
committed
Upgrade the sc2printer script to the new interface.
1 parent 4e1bd64 commit 9ef9fc4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sc2reader/scripts/sc2printer.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
import argparse
77

88
import sc2reader
9-
from sc2reader.utils import get_files
9+
from sc2reader import utils
1010
from sc2reader.exceptions import ReadError
1111

1212
def doFile(filename, arguments):
1313
'''Prints summary information about SC2 replay file'''
1414
try:
15-
replay = sc2reader.read_file(filename, debug=True)
15+
replay = sc2reader.load_replay(filename, debug=True)
1616
except ReadError as e:
17+
raise
18+
return
1719
prev = e.game_events[-1]
1820
print "\nVersion {0} replay:\n\t{1}".format(e.replay.release_string, e.replay.filename)
1921
print "\t{0}, Type={1:X}, Code={2:X}".format(e.msg, e.type,e.code)
@@ -25,6 +27,7 @@ def doFile(filename, arguments):
2527
print e
2628
return
2729
except TypeError as e:
30+
raise
2831
print "Error with '%s': " % filename,
2932
print e
3033
return
@@ -81,9 +84,9 @@ def main():
8184

8285
for path in arguments.paths:
8386
if arguments.recursive:
84-
files = get_files(path)
87+
files = utils.get_replay_files(path)
8588
else:
86-
files = get_files(path, depth=0)
89+
files = utils.get_replay_files(path, depth=0)
8790

8891
for file in files:
8992
print "\n--------------------------------------\n{0}\n".format(file)

0 commit comments

Comments
 (0)