Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jobs:
- image: circleci/python:3.8
steps:
- checkout
- run: sudo pip install flake8 black
- run: sudo pip install black codespell flake8
- run: python --version ; pip --version ; pwd ; ls -l
- run: codespell -L queenland,uint
# stop the build if there are Python syntax errors or undefined names
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Changed Stuff (non-backwards compatible!):
--------------------

* Fixes several game event parsing issues for older replays.
* Propperly maps ability ids for armory vehicle & ship armor upgrades.
* Properly maps ability ids for armory vehicle & ship armor upgrades.
* Uses the US depot for SEA battle.net depot dependencies.
* ``PlayerStatEvent.food_used`` and ``food_made`` are now properly divided by 4096
* ``AbilityEvent.flags`` are now processed into a dictionary mapping flag name to True/False (``AbilityEvent.flag``)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/articles/whatsinareplay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The last file provides a record of important events from the game.

* replay.tracker.events - Records important game events and game state updates.

This file was introduced in 2.0.4 and is unncessary for the Starcraft II to reproduce the game. Instead, it records interesting game events and game state for community developers to use when analyzing replays.
This file was introduced in 2.0.4 and is unnecessary for the Starcraft II to reproduce the game. Instead, it records interesting game events and game state for community developers to use when analyzing replays.


What isn't in a replay?
Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorials/prettyprinter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Many of the replay attributes are nested data structures which are generally all

Each of these nested structures can be found either on its own reference page or lumped together with the other minor structures on the Misc Structures page.

So now all we need to do is build the ouput using the available replay attributes. Lets start with the header portion. We'll use a block string formatting method that makes this clean and easy:
So now all we need to do is build the output using the available replay attributes. Lets start with the header portion. We'll use a block string formatting method that makes this clean and easy:

::

Expand Down Expand Up @@ -199,7 +199,7 @@ With this in mind, lets make a slight change to our main function to support any
Any time that you start dealing with directories or collections of files you run into dangers with recursion and annoyances of tedium. sc2reader provides options to mitigate these concerns.

* directory: Default ''. The directory string when supplied, becomes the base of all the file paths sent into sc2reader and can save you the hassle of fully qualifying your file paths each time.
* depth: Default -1. When handling directory inputs, sc2reader searches the directory recursively until all .SC2Replay files have been loaded. By setting the maxium depth value this behavior can be mitigated.
* depth: Default -1. When handling directory inputs, sc2reader searches the directory recursively until all .SC2Replay files have been loaded. By setting the maximum depth value this behavior can be mitigated.
* exclude: Default []. When recursing directories you can choose to exclude directories from the file search by directory name (not full path).
* followlinks: Default false. When recursing directories, enables or disables the follow symlinks behavior.

Expand Down
6 changes: 3 additions & 3 deletions examples/sc2autosave.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
--------------------
The --rename option allows you to specify a renaming format string. The string
is constructed the pythonic (3.0) way with {:field} indicating the substition
is constructed the pythonic (3.0) way with {:field} indicating the substitution
of a field. The forward slash (/) is a special character here which terminates
a folder name and allows for organization into subdirectories. All other string
characters form the template into which the fields are inserted.
Expand Down Expand Up @@ -138,7 +138,7 @@
files every SECONDS seconds.
--rename FORMAT
:map - Inserts the map name.
:date - Inserts a string formated datetime object using --date-format.
:date - Inserts a string formatted datetime object using --date-format.
:length - Inserts a string formatted time object using --length-format.
:teams - Inserts a comma separated player list. Teams are separated
with a ' vs ' string. Format the player with --player-format.
Expand Down Expand Up @@ -602,7 +602,7 @@ def main():
try:
run(parser.parse_args())
except KeyboardInterrupt:
print("\n\nScript Interupted. Process Aborting")
print("\n\nScript Interrupted. Process Aborting")


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions sc2reader/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, unit_id):

#: The unique in-game id for this unit. The id can sometimes be zero because
#: TargetUnitCommandEvents will create a new unit with id zero when a unit
#: behind the fog of war is targetted.
#: behind the fog of war is targeted.
self.id = unit_id

#: A reference to the unit type this unit is current in.
Expand Down Expand Up @@ -301,11 +301,11 @@ class Build(object):
"""
:param build_id: The build number identifying this dataset.
The datapack for a particualr group of builds. Maps internal integer ids
The datapack for a particular group of builds. Maps internal integer ids
to :class:`Unit` and :class:`Ability` types. Also contains builder methods
for creating new units and changing their types.
All build data is valid for standard games only. For arcade maps milage
All build data is valid for standard games only. For arcade maps mileage
may vary.
"""

Expand Down
2 changes: 1 addition & 1 deletion sc2reader/decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ByteDecoder(object):
Used to unpack parse byte aligned files.
"""

#: The Bytes object used internaly for reading from the
#: The Bytes object used internally for reading from the
#: decoder contents. cStringIO is faster than managing our
#: own string access in python. For PyPy installations a
#: managed string implementation might be faster.
Expand Down
4 changes: 2 additions & 2 deletions sc2reader/engine/plugins/creeptracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init__(self, replay):
self.creep_spread_image_by_minute = dict()
## This list contains all the active cgus in every time frame
self.creep_gen_units = dict()
## Thist list corresponds to creep_gen_units storing the time of each CGU
## This list corresponds to creep_gen_units storing the time of each CGU
self.creep_gen_units_times = dict()
## convert all possible cgu radii into a sets of coordinates centred around the origin,
## in order to use this with the CGUs, the centre point will be
Expand Down Expand Up @@ -168,7 +168,7 @@ def radius_to_map_positions(self, radius):
## this function converts all radius into map coordinates
## centred around the origin that the creep can exist
## the cgu_radius_to_map_position function will simply
## substract every coordinate with the centre point of the tumour
## subtract every coordinate with the centre point of the tumour
output_coordinates = list()
# Sample a square area using the radius
for x in range(-radius, radius):
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/engine/plugins/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SelectionTracker(object):
control_group_9 = selection[9]
active_selection = selection[10]
# TODO: list a few error inducing sitations
# TODO: list a few error inducing situations
"""

name = "SelectionTracker"
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/engine/plugins/supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def remove_from_units_alive(self, event, replay):
)

def handleInitGame(self, event, replay):
## This dictionary contains te supply of every unit
## This dictionary contains the supply of every unit
self.unit_name_to_supply = {
# Zerg
"Drone": (1, 17),
Expand Down
10 changes: 5 additions & 5 deletions sc2reader/events/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def __init__(self, frame, pid, data):
#: This id can be 0 when the target unit is shrouded by fog of war.
self.target_unit_id = self.ability_type_data.get("unit_tag", None)

#: A reference to the targetted unit. When the :attr:`target_unit_id` is
#: A reference to the targeted unit. When the :attr:`target_unit_id` is
#: 0 this target unit is a generic, reused fog of war unit of the :attr:`target_unit_type`
#: with an id of zero. It should not be confused with a real unit.
self.target_unit = None
Expand All @@ -333,7 +333,7 @@ def __init__(self, frame, pid, data):
self.target_unit_type = self.ability_type_data.get("unit_link", None)

#: Integer player id of the controlling player. Available for TargetUnit type events starting in 19595.
#: When the targetted unit is under fog of war this id is zero.
#: When the targeted unit is under fog of war this id is zero.
self.control_player_id = self.ability_type_data.get("control_player_id", None)

#: Integer player id of the player paying upkeep. Available for TargetUnit type events.
Expand Down Expand Up @@ -374,7 +374,7 @@ class UpdateTargetUnitCommandEvent(TargetUnitCommandEvent):
from TargetUnitCommandEvent, but for flexibility, it will be treated
differently.

One example of this event occuring is casting inject on a hatchery while
One example of this event occurring is casting inject on a hatchery while
holding shift, and then shift clicking on a second hatchery.
"""

Expand Down Expand Up @@ -406,7 +406,7 @@ class SelectionEvent(GameEvent):
player is updated. Unlike other game events, these events can also be
generated by non-player actions like unit deaths or transformations.

Starting in Starcraft 2.0.0, selection events targetting control group
Starting in Starcraft 2.0.0, selection events targeting control group
buffers are also generated when control group selections are modified
by non-player actions. When a player action updates a control group
a :class:`ControlGroupEvent` is generated.
Expand Down Expand Up @@ -529,7 +529,7 @@ class ControlGroupEvent(GameEvent):
* :class:`GetControlGroup` - Recorded when a user retrieves a control group (#).
* :class:`AddToControlGroup` - Recorded when a user adds to a control group (shift+ctrl+#)

All three events have the same set of data (shown below) but are interpretted differently.
All three events have the same set of data (shown below) but are interpreted differently.
See the class entry for details.
"""

Expand Down
10 changes: 5 additions & 5 deletions sc2reader/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Team(object):
objects with some metadata. As such, it implements iterable and can be
looped over like a list.
:param interger number: The team number as recorded in the replay
:param integer number: The team number as recorded in the replay
"""

#: A unique hash identifying the team of players
Expand Down Expand Up @@ -140,7 +140,7 @@ def __init__(self, sid, slot_data):
#: The Battle.net subregion the entity is registered to
self.subregion = int(parts[2])

#: The Battle.net acount identifier. Used to construct the
#: The Battle.net account identifier. Used to construct the
#: bnet profile url. This value can be zero for games
#: played offline when a user was not logged in to battle.net.
self.toon_id = int(parts[3])
Expand Down Expand Up @@ -240,7 +240,7 @@ def __init__(self, pid, slot_data, detail_data, attribute_data):
#: The Battle.net subregion the entity is registered to
self.subregion = detail_data["bnet"]["subregion"]

#: The Battle.net acount identifier. Used to construct the
#: The Battle.net account identifier. Used to construct the
#: bnet profile url. This value can be zero for games
#: played offline when a user was not logged in to battle.net.
self.toon_id = detail_data["bnet"]["uid"]
Expand Down Expand Up @@ -604,8 +604,8 @@ def __init__(self, contents):
#: The map base height (what is that?). This value is 4096*Base Height in the editor (giving a decimal value).
self.base_height = data.read_uint32() / 4096

# Leave early so we dont barf. Turns out ggtracker doesnt need
# any of the map data thats loaded below.
# Leave early so we don't barf. Turns out ggtracker doesn't need
# any of the map data that is loaded below.
return

#: Load screen type: 0 = default, 1 = custom
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ def control_group_update_event(self, data):

def decrement_game_time_remaining_event(self, data):
# really this should be set to 19, and a new GameEventsReader_41743 should be introduced that specifies 32 bits.
# but I dont care about ability to read old replays.
# but I don't care about ability to read old replays.
return dict(decrement_ms=data.read_bits(32))


Expand Down
4 changes: 2 additions & 2 deletions sc2reader/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Replay(Resource):
#: Deprecated, use :attr:`game_type` or :attr:`real_type` instead
type = str()

#: The game type choosen at game creation: 1v1, 2v2, 3v3, 4v4, FFA
#: The game type chosen at game creation: 1v1, 2v2, 3v3, 4v4, FFA
game_type = str()

#: The real type of the replay as observed by counting players on teams.
Expand Down Expand Up @@ -1237,7 +1237,7 @@ def use_property(prop, player=None):

# Lobby properties can require on player properties.
# How does this work? I assume that one player satisfying the
# property requirments is sufficient
# property requirements is sufficient
if requirement.is_lobby:
values = [setting]
else:
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/scripts/sc2attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def main():
global decisions

parser = argparse.ArgumentParser(
description="Recursively parses replay files, inteded for debugging parse issues."
description="Recursively parses replay files, intended for debugging parse issues."
)
parser.add_argument(
"folders", metavar="folder", type=str, nargs="+", help="Path to a folder"
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/scripts/sc2parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

def main():
parser = argparse.ArgumentParser(
description="Recursively parses replay files, inteded for debugging parse issues."
description="Recursively parses replay files, intended for debugging parse issues."
)
parser.add_argument(
"--one_each",
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/scripts/sc2replayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def getch():

except ImportError as e:
try:
# Opps, we might be on windows, try this one
# Oops, we might be on windows, try this one
from msvcrt import getch
except ImportError as e:
# We can't make getch happen, just dump events to the screen
Expand Down