Skip to content

Commit 79aeb5e

Browse files
committed
Merge pull request #30 from kanwei/master
typos are indeed bad.
2 parents 1a20b3f + ea3e22d commit 79aeb5e

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

README.txt

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ See the sc2replay `wiki`_ for additional usage details (coming soon).
4848
Current Status
4949
---------------
5050

51-
sc2reader is written to parse replays where ``buidl >= 16561`` (generally
51+
sc2reader is written to parse replays where ``build >= 16561`` (generally
5252
version 1.1 replays). This means that the following information can be
5353
extracted:
5454

@@ -69,7 +69,7 @@ Requirements
6969
~~~~~~~~~~~~~
7070

7171
- Python 2.6+, Python 3.0 untested
72-
- The `mpyq`_ MPQ exraction library
72+
- The `mpyq`_ MPQ extraction library
7373
- `pytest`_ testing library (optional)
7474

7575
Basic Install

sc2reader/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
A Starcraft II replay parsing library intended to promote innovation in
77
Starcraft tools and communities. Eventually, it will cover all official
8-
releases and dump easily to JSON for inter-language portabilty.
8+
releases and dump easily to JSON for inter-language portability.
99
1010
sc2reader has been carefully written for clarity to serve as a starting
1111
point for those who want to write their own parsers, potentially in other
@@ -42,7 +42,7 @@ class accepts a key=value list of options to override defaults (see
4242

4343
def __init__(self, **user_options):
4444
""" The constructor makes a copy of the default_options to make sure the
45-
option configuration doesn't propogate back to the default_options.
45+
option configuration doesn't propagate back to the default_options.
4646
It should support any arbitrary number of different Reader objects.
4747
"""
4848
self.options = config.default_options.copy()
@@ -181,7 +181,7 @@ def read_file(self, file_in, **user_options):
181181
# Support file-like objects (with a read method)
182182
if hasattr(file_in, 'read') and hasattr(file_in, 'seek'):
183183

184-
# Base the options off a copy to leave the Reader options uneffected.
184+
# Base the options off a copy to leave the Reader options unaffected.
185185
options = self.options.copy()
186186
options.update(user_options)
187187

@@ -202,7 +202,7 @@ def read_file(self, file_in, **user_options):
202202

203203
"""sc2reader uses a default SC2Reader class instance to provide a package level
204204
interface to its functionality. The package level interface presents the same
205-
functional interface, it just saves the hassel of creating the class object.
205+
functional interface, it just saves the hassle of creating the class object.
206206
"""
207207
__defaultReader = Reader()
208208

sc2reader/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ class Broodling(GameObject, Unit, Zerg):
951951
code = 0xcf01
952952
class Changeling(GameObject, Unit, Zerg):
953953
code = 0x2601
954-
# TODO insta-change beween them
954+
# TODO insta-change between them
955955
class ChangelingZealot(GameObject):
956956
code = 0x2701
957957
class ChangelingMarine(GameObject):

sc2reader/objects.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class Event(object):
269269
name = 'BaseEvent'
270270
def apply(self): pass
271271

272-
"""Abstract Event Type, should not be directly instanciated"""
272+
"""Abstract Event Type, should not be directly instantiated"""
273273
def __init__(self, timestamp, player_id, event_type, event_code):
274274
self.frame = timestamp
275275
self.second = timestamp >> 4
@@ -450,7 +450,7 @@ def apply(self):
450450
obj.visit(self.frame, self.player)
451451

452452
def __str__(self):
453-
return HotkeyEvent.__str__(self) + " - Add; Seletion: %s" % str(self.selected)
453+
return HotkeyEvent.__str__(self) + " - Add; Selection: %s" % str(self.selected)
454454

455455
class GetHotkeyEvent(HotkeyEvent):
456456
name = 'GetHotkeyEvent'
@@ -470,7 +470,7 @@ def apply(self):
470470
obj.visit(self.frame, self.player)
471471

472472
def __str__(self):
473-
return HotkeyEvent.__str__(self) + " - Get; Seletion: %s" % str(self.selected)
473+
return HotkeyEvent.__str__(self) + " - Get; Selection: %s" % str(self.selected)
474474

475475
class SelectionEvent(Event):
476476
name = 'SelectionEvent'

sc2reader/parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def parse_020E_event(self, buffer, frames, type, code, pid):
262262

263263
class CameraParser(object):
264264
def parse_camera87_event(self, buffer, frames, type, code, pid):
265-
#There are up to 3 peices to read depending on values encountered
265+
#There are up to 3 pieces to read depending on values encountered
266266
for i in range(3):
267267
if buffer.read_int(BIG_ENDIAN) & 0xF0 == 0:
268268
break
@@ -273,7 +273,7 @@ def parse_cameraX8_event(self, buffer, frames, type, code, pid):
273273
# No idea why these two cases are ever so slightly different. There
274274
# must be a pattern in here somewhere that I haven't found yet.
275275
#
276-
# TODO: Find out why we occassionally shift by 2 instead of 3
276+
# TODO: Find out why we occasionally shift by 2 instead of 3
277277
if code == 0x88:
278278
flags = buffer.read_byte()
279279
extra = buffer.read_byte()

sc2reader/processors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def Full(replay):
3636
replay.is_ladder = (replay.category == "Ladder")
3737
replay.is_private = (replay.category == "Private")
3838

39-
#If we don't atleast have details and attributes_events we can go no further
39+
#If we don't at least have details and attributes_events we can go no further
4040
if not ('details' in replay.raw and 'attributes_events' in replay.raw):
4141
return replay
4242

@@ -64,7 +64,7 @@ def Full(replay):
6464

6565
# Create the player using the current pid and the player name from
6666
# The details file. This works because players are stored in order
67-
# of pid intside of the details file. Attributes and Details must be
67+
# of pid inside of the details file. Attributes and Details must be
6868
# processed together because Details doesn't index players by or
6969
# store their player ids; Attributes can provide that information
7070
# and allow for accurate pid mapping even with computers, observers,
@@ -126,7 +126,7 @@ def Full(replay):
126126
if 'initData' in replay.raw:
127127
# Assign the default region to computer players for consistency
128128
# We know there will be a default region because there must be
129-
# atleast 1 human player or we wouldn't have a replay.
129+
# at least 1 human player or we wouldn't have a replay.
130130
for player in replay.players:
131131
if player.type == 'Computer':
132132
player.region = default_region
@@ -139,7 +139,7 @@ def Full(replay):
139139
replay.people.append(observer)
140140
replay.person[i+1] = observer
141141

142-
# Miscellenious people processing
142+
# Miscellaneous people processing
143143
replay.humans = filter(lambda p: p.type == 'Human', replay.people)
144144

145145
if 'message_events' in replay.raw:
@@ -258,7 +258,7 @@ def Full(replay):
258258

259259
# If there are any big teams left or more than one 1 person
260260
# team left this is definitely either a loss or a really
261-
# akward tie between 3 or more people on 2 or more teams.
261+
# awkward tie between 3 or more people on 2 or more teams.
262262
#
263263
# Since I don't think ties can be detected, ignore that case
264264
if len(pcount) > 2 or big_teams:

sc2reader/readers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def __call__(self, buffer, replay):
129129
# we don't need to use data[0][0][1][3] to get the battle.net player id.
130130
# The field names are documented in the namedtuples section of the
131131
# objects file. The ordered_values function extracts the values while
132-
# maintaining key order required for propper mapping
132+
# maintaining key order required for proper mapping
133133
ordered_values = lambda dict: [v for k,v in sorted(dict.iteritems())]
134134

135135
# Because named tuples are read only, we need to build them in pieces
@@ -241,7 +241,7 @@ def __call__(self, buffer, replay):
241241

242242
except ParseError:
243243
# For some reason, the type handler that we delegated to didn't
244-
# recognize the event code that we extracated.
244+
# recognize the event code that we extracted.
245245
# TODO: Do something meaningful here
246246
raise ReadError("Unknown event code", type, code, start, replay, game_events, buffer)
247247

@@ -258,9 +258,9 @@ def __call__(self, buffer, replay):
258258
def get_setup_parser(self, code):
259259
# The setup events typically form a header of sorts to the file with
260260
# each player (in no particular order) registering a join event and
261-
# the game starting immediately afterwords. On occassion, for unknown
261+
# the game starting immediately afterwords. On occasion, for unknown
262262
# reasons, other events (particularly camera events) will register
263-
# before the game has actually started. Wierd.
263+
# before the game has actually started. Weird.
264264
if code in (0x0B, 0x0C, 0x2C): return self.parse_join_event
265265
elif code in (0x05,): return self.parse_start_event
266266
else:

sc2reader/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class ReplayBuffer(object):
1616
""" The ReplayBuffer is a wrapper over the cStringIO object and provides
17-
convenience functions for reading structured data from Stacraft II
17+
convenience functions for reading structured data from Starcraft II
1818
replay files. These convenience functions can be sorted into several
1919
different categories providing an interface as follows:
2020
@@ -25,7 +25,7 @@ class ReplayBuffer(object):
2525
align(self)
2626
seek(self, position, mode=SEEK_CUR)
2727
28-
Data Retrival::
28+
Data Retrieval::
2929
read_variable_int(self)
3030
read_string(self,additional)
3131
read_timestamp(self)
@@ -250,7 +250,7 @@ def read_data_struct(self):
250250
elif datatype == 0x09:
251251
return self.read_variable_int()
252252

253-
raise TypeError("Uknown Data Structure: '%s'" % datatype)
253+
raise TypeError("Unknown Data Structure: '%s'" % datatype)
254254

255255
def read_object_type(self, read_modifier=False):
256256
""" Object type is big-endian short16 """
@@ -313,7 +313,7 @@ def read_range(self, start, end):
313313
def shift(self, bits):
314314
"""
315315
The only valid use of Buffer.shift is when you know that there are
316-
enough bits left in the loaded byte to accomodate your request.
316+
enough bits left in the loaded byte to accommodate your request.
317317
318318
If there is no loaded byte, or the loaded byte has been exhausted,
319319
then Buffer.shift(8) could technically be used to read a single
@@ -545,7 +545,7 @@ def read_header(file):
545545
http://wiki.devklog.net/index.php?title=The_MoPaQ_Archive_Format
546546
547547
Return the release array and frame count for sc2reader use. For more
548-
defailted header information, access mpyq directly.
548+
detailed header information, access mpyq directly.
549549
'''
550550
buffer = ReplayBuffer(file)
551551

0 commit comments

Comments
 (0)