Skip to content

Commit 0dec991

Browse files
committed
Fix toJSON plugin to work as intended.
1 parent d18f4c5 commit 0dec991

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

sc2reader/factories.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ def load_all(self, cls, sources, options=None, **new_options):
147147
def _load(self, cls, resource, filename, options):
148148
obj = cls(resource, filename=filename, factory=self, **options)
149149
for plugin in options.get('plugins',self._get_plugins(cls)):
150-
# TODO: What if you want to do a transform?
151-
plugin(obj)
150+
obj = plugin(obj)
152151
return obj
153152

154153
def _get_plugins(self, cls):

sc2reader/plugins/replay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def toJSON(replay, **user_options):
1515
options = dict(cls=JSONDateEncoder)
1616
options.update(user_options)
17-
return json.dumps(toDict(replay), **options)
17+
return json.dumps(toDict()(replay), **options)
1818

1919
@plugin
2020
def toDict(replay):

0 commit comments

Comments
 (0)