Skip to content

Commit 9476b27

Browse files
committed
Moves Processors to a __call__ based pattern that allows for lightweight function implementations. Should be easier on end users
1 parent e92622d commit 9476b27

File tree

2 files changed

+182
-224
lines changed

2 files changed

+182
-224
lines changed

sc2reader/__init__.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@
3131

3232
PROCESSORS = {
3333
"FULL": [
34-
PeopleProcessor(),
35-
AttributeProcessor(),
36-
TeamsProcessor(),
37-
MessageProcessor(),
38-
RecorderProcessor(),
39-
EventProcessor(),
40-
ApmProcessor(),
41-
ResultsProcessor()
34+
PeopleProcessor,
35+
AttributeProcessor,
36+
TeamsProcessor,
37+
MessageProcessor,
38+
RecorderProcessor,
39+
EventProcessor,
40+
ApmProcessor,
41+
ResultsProcessor,
4242
],
4343

4444
"PARTIAL": [
45-
PeopleProcessor(),
46-
AttributeProcessor(),
47-
TeamsProcessor(),
48-
MessageProcessor(),
49-
RecorderProcessor(),
45+
PeopleProcessor,
46+
AttributeProcessor,
47+
TeamsProcessor,
48+
MessageProcessor,
49+
RecorderProcessor,
5050
],
5151
}
5252

@@ -153,8 +153,8 @@ def read(self, location):
153153
READERS[replay.build][file].read(buffer,replay)
154154

155155
#Do cleanup and post processing
156-
for processor in self.processors:
157-
replay = processor.process(replay)
156+
for process in self.processors:
157+
replay = process(replay)
158158

159159
return replay
160160

0 commit comments

Comments
 (0)