Skip to content

Commit cf14a7d

Browse files
committed
Fix toJSON plugin to work as intended.
1 parent d6aa89d commit cf14a7d

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
@@ -146,8 +146,7 @@ def load_all(self, cls, sources, options=None, **new_options):
146146
def _load(self, cls, resource, filename, options):
147147
obj = cls(resource, filename=filename, factory=self, **options)
148148
for plugin in options.get('plugins',self._get_plugins(cls)):
149-
# TODO: What if you want to do a transform?
150-
plugin(obj)
149+
obj = plugin(obj)
151150
return obj
152151

153152
def _get_plugins(self, cls):

sc2reader/plugins/replay.py

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

1818
@plugin
1919
def toDict(replay):

0 commit comments

Comments
 (0)