diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ac15426f..bb518cc3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,15 @@ CHANGELOG ============ +1.7.0 - May 17, 2021 +-------------------- +* Add DOI to the README #128 +* Add various missing attributes for co-op replays #129 +* Add support for python 3.8, 3.9 #132 #136 +* Fix owner on an event with no unit #133 +* Add support for ResourceTradeEvent #135 +* Fix depot URL template #139 + 1.6.0 - July 30, 2020 --------------------- * Add support for protocol 80949 (StarCraft 5.0) #122 diff --git a/sc2reader/__init__.py b/sc2reader/__init__.py index 11c8a336..4d601ca8 100644 --- a/sc2reader/__init__.py +++ b/sc2reader/__init__.py @@ -20,7 +20,7 @@ """ from __future__ import absolute_import, print_function, unicode_literals, division -__version__ = "1.6.0" +__version__ = "1.7.0" import os import sys diff --git a/sc2reader/data/__init__.py b/sc2reader/data/__init__.py index 0d094b0a..6cbb9425 100755 --- a/sc2reader/data/__init__.py +++ b/sc2reader/data/__init__.py @@ -151,42 +151,42 @@ def title(self): @property def type(self): - """ The internal type id of the current unit type of this unit. None if no type is assigned""" + """The internal type id of the current unit type of this unit. None if no type is assigned""" return self._type_class.id if self._type_class else None @property def race(self): - """ The race of this unit. One of Terran, Protoss, Zerg, Neutral, or None""" + """The race of this unit. One of Terran, Protoss, Zerg, Neutral, or None""" return self._type_class.race if self._type_class else None @property def minerals(self): - """ The mineral cost of the unit. None if no type is assigned""" + """The mineral cost of the unit. None if no type is assigned""" return self._type_class.minerals if self._type_class else None @property def vespene(self): - """ The vespene cost of the unit. None if no type is assigned""" + """The vespene cost of the unit. None if no type is assigned""" return self._type_class.vespene if self._type_class else None @property def supply(self): - """ The supply used by this unit. Negative for supply providers. None if no type is assigned """ + """The supply used by this unit. Negative for supply providers. None if no type is assigned""" return self._type_class.supply if self._type_class else None @property def is_worker(self): - """ Boolean flagging units as worker units. SCV, MULE, Drone, Probe """ + """Boolean flagging units as worker units. SCV, MULE, Drone, Probe""" return self._type_class.is_worker if self._type_class else False @property def is_building(self): - """ Boolean flagging units as buildings. """ + """Boolean flagging units as buildings.""" return self._type_class.is_building if self._type_class else False @property def is_army(self): - """ Boolean flagging units as army units. """ + """Boolean flagging units as army units.""" return self._type_class.is_army if self._type_class else False def __str__(self): @@ -221,7 +221,7 @@ def __repr__(self): class UnitType(object): - """ Represents an in game unit type """ + """Represents an in game unit type""" def __init__( self, @@ -272,7 +272,7 @@ def __init__( class Ability(object): - """ Represents an in-game ability """ + """Represents an in-game ability""" def __init__( self, id, name=None, title=None, is_build=False, build_time=0, build_unit=None diff --git a/sc2reader/events/tracker.py b/sc2reader/events/tracker.py index 47ebaf09..a3e3935e 100644 --- a/sc2reader/events/tracker.py +++ b/sc2reader/events/tracker.py @@ -36,7 +36,7 @@ def __str__(self): class PlayerSetupEvent(TrackerEvent): - """ Sent during game setup to help us organize players better """ + """Sent during game setup to help us organize players better""" def __init__(self, frames, data, build): super(PlayerSetupEvent, self).__init__(frames) diff --git a/sc2reader/factories/plugins/utils.py b/sc2reader/factories/plugins/utils.py index e472b86e..7eef123a 100644 --- a/sc2reader/factories/plugins/utils.py +++ b/sc2reader/factories/plugins/utils.py @@ -89,7 +89,7 @@ def deselect(self, mode, data): return True elif mode == "Mask": - """ Deselect objects according to deselect mask """ + """Deselect objects according to deselect mask""" mask = data if len(mask) < size: # pad to the right @@ -105,7 +105,7 @@ def deselect(self, mode, data): return len(mask) <= size elif mode == "OneIndices": - """ Deselect objects according to indexes """ + """Deselect objects according to indexes""" clean_data = list(filter(lambda i: i < size, data)) self.objects = [ self.objects[i] for i in range(len(self.objects)) if i not in clean_data @@ -113,7 +113,7 @@ def deselect(self, mode, data): return len(clean_data) == len(data) elif mode == "ZeroIndices": - """ Deselect objects according to indexes """ + """Deselect objects according to indexes""" clean_data = list(filter(lambda i: i < size, data)) self.objects = [self.objects[i] for i in clean_data] return len(clean_data) == len(data) diff --git a/sc2reader/objects.py b/sc2reader/objects.py index 3867896d..2ca2552b 100644 --- a/sc2reader/objects.py +++ b/sc2reader/objects.py @@ -473,7 +473,7 @@ def __init__(self, x, y, xy_list=None): self.values = y def as_points(self): - """ Get the graph as a list of (x, y) tuples """ + """Get the graph as a list of (x, y) tuples""" return list(zip(self.times, self.values)) def __str__(self): diff --git a/sc2reader/scripts/sc2printer.py b/sc2reader/scripts/sc2printer.py index 92cfe686..f27fda49 100755 --- a/sc2reader/scripts/sc2printer.py +++ b/sc2reader/scripts/sc2printer.py @@ -11,7 +11,7 @@ def printReplay(filepath, arguments): - """ Prints summary information about SC2 replay file """ + """Prints summary information about SC2 replay file""" try: replay = sc2reader.load_replay(filepath, debug=True) diff --git a/sc2reader/utils.py b/sc2reader/utils.py index ed3314c0..c35f91f3 100644 --- a/sc2reader/utils.py +++ b/sc2reader/utils.py @@ -38,7 +38,7 @@ def __init__(self, bytes): @property def url(self): - """ Returns url of the depot file. """ + """Returns url of the depot file.""" return self.url_template.format(self.server, self.hash, self.type) def __hash__(self): diff --git a/setup.py b/setup.py index 5f912321..0ce5ce32 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setuptools.setup( license="MIT", name="sc2reader", - version="1.6.0", + version="1.7.0", keywords=["starcraft 2", "sc2", "replay", "parser"], description="Utility for parsing Starcraft II replay files", long_description=open("README.rst").read() + "\n\n" + open("CHANGELOG.rst").read(), diff --git a/test_replays/test_replays.py b/test_replays/test_replays.py index 5e162327..810cad06 100644 --- a/test_replays/test_replays.py +++ b/test_replays/test_replays.py @@ -321,7 +321,7 @@ def test_cn_replays(self): self.assertEqual(replay.expansion, "WoL") def test_unit_types(self): - """ sc2reader#136 regression test """ + """sc2reader#136 regression test""" replay = sc2reader.load_replay("test_replays/2.0.8.25604/issue136.SC2Replay") hellion_times = [ u.started_at for u in replay.players[0].units if u.name == "Hellion"