Skip to content

Commit 46bb61b

Browse files
committed
Merge pull request #141 from ChrisLundquist/replay-json
[scripts] add replay to json script
2 parents ff60dd0 + d2667ce commit 46bb61b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sc2reader/scripts/sc2json.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import sys
6+
7+
import sc2reader
8+
from sc2reader.plugins.replay import toJSON
9+
10+
def main():
11+
factory = sc2reader.factories.SC2Factory()
12+
factory.register_plugin("Replay", toJSON())
13+
14+
replay_json = factory.load_replay(sys.argv[1])
15+
print replay_json
16+
17+
if __name__ == '__main__':
18+
main()

0 commit comments

Comments
 (0)