Skip to content

Commit d6baffa

Browse files
committed
commented debug prints out, they should be conditioned with debug/verbose option
1 parent 0f65125 commit d6baffa

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

sc2reader/objects.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ def apply(self):
242242

243243
if self.ability:
244244
if self.ability not in ABILITIES:
245-
print "Unknown ability (%s) in frame %s" % (hex(self.ability),self.frame)
245+
pass
246+
# print "Unknown ability (%s) in frame %s" % (hex(self.ability),self.frame)
246247
#raise ValueError("Unknown ability (%s)" % (hex(self.ability)),)
247248
else:
248249
ability = ABILITIES[self.ability]
@@ -288,7 +289,8 @@ def apply(self):
288289
obj.visit(self.frame, self.player, type_class)
289290
self.target = obj
290291
except KeyError:
291-
print "Unknown object type (%s) at frame %s" % (hex(obj_type),self.frame)
292+
# print "Unknown object type (%s) at frame %s" % (hex(obj_type),self.frame)
293+
pass
292294
super(TargetAbilityEvent, self).apply()
293295

294296
class LocationAbilityEvent(AbilityEvent):
@@ -388,6 +390,7 @@ def apply(self):
388390
obj.visit(self.frame, self.player, type_class)
389391
selected.append(obj)
390392
except KeyError:
391-
print "Unknown object type (%s) at frame %s" % (hex(obj_type),self.frame)
393+
# print "Unknown object type (%s) at frame %s" % (hex(obj_type),self.frame)
394+
pass
392395

393396
selection[self.frame] = selected

sc2reader/parsers.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def parse_ability_event(self, buffer, frames, type, code, pid):
117117
return LocationAbilityEvent(frames, pid, type, code, None, location)
118118

119119
elif flag in (0x04,0x05,0x07):
120-
print "Made it!"
120+
# print "Made it!"
121121
h = buffer.read_hex(2)
122122
hinge = buffer.read_byte()
123123
if hinge & 0x20:
@@ -144,18 +144,18 @@ def parse_ability_event(self, buffer, frames, type, code, pid):
144144
elif atype in (0x08,0x0a): #new to patch 1.3.3
145145
#10 bytes total, coordinates have a different format?
146146
#X coordinate definitely is the first byte, with (hopefully) y next
147-
print hex(flag)
147+
# print hex(flag)
148148
event = UnknownAbilityEvent(frames, pid, type, code, None)
149149
event.location1 = buffer.read_coordinate()
150150
buffer.skip(5)
151151
return event
152152

153153
else:
154-
print hex(atype)
155-
print hex(buffer.cursor)
154+
# print hex(atype)
155+
# print hex(buffer.cursor)
156156
raise TypeError()
157157

158-
print "%s - %s" % (hex(atype),hex(flag))
158+
# print "%s - %s" % (hex(atype),hex(flag))
159159
raise TypeError("Shouldn't be here EVER!")
160160

161161
def parse_selection_event(self, buffer, frames, type, code, pid):
@@ -277,11 +277,11 @@ def parse_ability_event(self, buffer, frames, type, code, pid):
277277
return LocationAbilityEvent(frames, pid, type, code, None, location)
278278

279279
else:
280-
print hex(atype)
281-
print hex(buffer.cursor)
280+
# print hex(atype)
281+
# print hex(buffer.cursor)
282282
raise TypeError()
283283

284-
print "%s - %s" % (hex(atype),hex(flag))
284+
# print "%s - %s" % (hex(atype),hex(flag))
285285
raise TypeError("Shouldn't be here EVER!")
286286

287287
class Unknown2Parser(object):

0 commit comments

Comments
 (0)