Skip to content

Commit 8ded931

Browse files
committed
added mpyq to the local dir to more quickly get the development version
1 parent 7215284 commit 8ded931

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

mpyq

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 0f6c6b7848ac3dd92147d8036dceec534a27b64b

sc2reader/parsers.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ def load(self, replay, filecontents):
9898

9999
#Get global settings first
100100
replay.speed = data[16]['Game Speed']
101-
102-
#TODO: Do we need the category variable at this point?
103101
replay.category = data[16]['Category']
104-
replay.is_ladder = (replay.category == "Ladder")
105-
replay.is_private = (replay.category == "Private")
106-
107102
replay.type = data[16]['Game Type']
108103

109104
#Set player attributes as available, requires already populated player list

sc2reader/replay.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from collections import defaultdict
33

44
from mpyq import MPQArchive
5+
from mpyq import __version__ as version
6+
print version
57

68
import parsers
79
from utils import ByteStream,PlayerDict
@@ -57,12 +59,12 @@ def __init__(self, replay, partial_parse=True, full_parse=True):
5759
self._parse_header()
5860

5961
#Manually extract the contents of SC2Replay file (bypass the listfile)
60-
archive = MPQArchive(replay, False)
61-
self._files['replay.initData'] = archive.read('replay.initData')
62-
self._files['replay.details'] = archive.read('replay.details')
63-
self._files['replay.attributes.events'] = archive.read('replay.attributes.events')
64-
self._files['replay.message.events'] = archive.read('replay.message.events')
65-
self._files['replay.game.events'] = archive.read('replay.game.events')
62+
archive = MPQArchive(replay, listfile=False)
63+
self._files['replay.initData'] = archive.read_file('replay.initData')
64+
self._files['replay.details'] = archive.read_file('replay.details')
65+
self._files['replay.attributes.events'] = archive.read_file('replay.attributes.events')
66+
self._files['replay.message.events'] = archive.read_file('replay.message.events')
67+
self._files['replay.game.events'] = archive.read_file('replay.game.events')
6668

6769
#These are quickly parsed files that contain most of the game information
6870
#The order is important, I need some way to reinforce it in the future

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
],
2929

3030
requires=['mpyq'],
31-
install_requires=['mpyq'],
31+
install_requires=['mpyq>=0.1.4'],
3232
packages=['sc2reader'],
3333
scripts=['scripts/sc2printer'],
3434
)

test_replays/test_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_ffa():
115115
# Source: http://drop.sc/83
116116
replay = Replay("test_replays/build17811/8.sc2replay")
117117
assert replay.type == "FFA"
118-
assert replay.player['Boom'].result = "Won"
118+
assert replay.player['Boom'].result == "Won"
119119

120120
def test_random_player():
121121
replay = Replay("test_replays/build17811/3.sc2replay")

0 commit comments

Comments
 (0)