Skip to content

Commit 59987e9

Browse files
committed
#63 cast players in TrackerEvent.__str__
1 parent cc364ff commit 59987e9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sc2reader/events/tracker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def __init__(self, frames, data, build):
230230
self.ff_vespene_lost_technology = clamp(self.stats[38]) if build >= 26490 else None
231231

232232
def __str__(self):
233-
return self._str_prefix() + "{0: >15} - Stats Update".format(self.player)
233+
return self._str_prefix() + "{0: >15} - Stats Update".format(str(self.player))
234234

235235

236236
class UnitBornEvent(TrackerEvent):
@@ -291,7 +291,7 @@ def __init__(self, frames, data, build):
291291
self.location = (self.x, self.y)
292292

293293
def __str__(self):
294-
return self._str_prefix() + "{0: >15} - Unit born {1}".format(self.unit_upkeeper, self.unit)
294+
return self._str_prefix() + "{0: >15} - Unit born {1}".format(str(self.unit_upkeeper), self.unit)
295295

296296

297297
class UnitDiedEvent(TrackerEvent):
@@ -361,7 +361,7 @@ def __init__(self, frames, data, build):
361361
self.killing_unit_id = self.killing_unit_index << 18 | self.killing_unit_recycle
362362

363363
def __str__(self):
364-
return self._str_prefix() + "{0: >15} - Unit died {1}.".format(self.unit.owner, self.unit)
364+
return self._str_prefix() + "{0: >15} - Unit died {1}.".format(str(self.unit.owner), self.unit)
365365

366366

367367
class UnitOwnerChangeEvent(TrackerEvent):
@@ -397,7 +397,7 @@ def __init__(self, frames, data, build):
397397
self.unit_controller = None
398398

399399
def __str__(self):
400-
return self._str_prefix() + "{0: >15} took {1}".format(self.unit_upkeeper, self.unit)
400+
return self._str_prefix() + "{0: >15} took {1}".format(str(self.unit_upkeeper), self.unit)
401401

402402

403403
class UnitTypeChangeEvent(TrackerEvent):
@@ -425,7 +425,7 @@ def __init__(self, frames, data, build):
425425
self.unit_type_name = data[2].decode('utf8')
426426

427427
def __str__(self):
428-
return self._str_prefix() + "{0: >15} - Unit {0} type changed to {1}".format(self.unit.owner, self.unit, self.unit_type_name)
428+
return self._str_prefix() + "{0: >15} - Unit {0} type changed to {1}".format(str(self.unit.owner), self.unit, self.unit_type_name)
429429

430430

431431
class UpgradeCompleteEvent(TrackerEvent):
@@ -448,7 +448,7 @@ def __init__(self, frames, data, build):
448448
self.count = data[2]
449449

450450
def __str__(self):
451-
return self._str_prefix() + "{0: >15} - {1}upgrade completed".format(self.player, self.upgrade_type_name)
451+
return self._str_prefix() + "{0: >15} - {1} upgrade completed".format(str(self.player), self.upgrade_type_name)
452452

453453

454454
class UnitInitEvent(TrackerEvent):
@@ -504,7 +504,7 @@ def __init__(self, frames, data, build):
504504
self.location = (self.x, self.y)
505505

506506
def __str__(self):
507-
return self._str_prefix() + "{0: >15} - Unit initiated {1}".format(self.unit_upkeeper, self.unit)
507+
return self._str_prefix() + "{0: >15} - Unit initiated {1}".format(str(self.unit_upkeeper), self.unit)
508508

509509

510510
class UnitDoneEvent(TrackerEvent):
@@ -528,7 +528,7 @@ def __init__(self, frames, data, build):
528528
self.unit = None
529529

530530
def __str__(self):
531-
return self._str_prefix() + "{0: >15} - Unit {1} done".format(self.unit.owner, self.unit)
531+
return self._str_prefix() + "{0: >15} - Unit {1} done".format(str(self.unit.owner), self.unit)
532532

533533

534534
class UnitPositionsEvent(TrackerEvent):

0 commit comments

Comments
 (0)