Permalink
Browse files

Fix toJSON plugin to work as intended.

  • Loading branch information...
GraylinKim committed Mar 3, 2013
1 parent d6aa89d commit cf14a7db113b352eb116285e05809a35664dbc99
Showing with 2 additions and 3 deletions.
  1. +1 −2 sc2reader/factories.py
  2. +1 −1 sc2reader/plugins/replay.py
View
@@ -146,8 +146,7 @@ def load_all(self, cls, sources, options=None, **new_options):
def _load(self, cls, resource, filename, options):
obj = cls(resource, filename=filename, factory=self, **options)
for plugin in options.get('plugins',self._get_plugins(cls)):
- # TODO: What if you want to do a transform?
- plugin(obj)
+ obj = plugin(obj)
return obj
def _get_plugins(self, cls):
@@ -13,7 +13,7 @@
def toJSON(replay, **user_options):
options = dict(cls=JSONDateEncoder)
options.update(user_options)
- return json.dumps(toDict(replay), **options)
+ return json.dumps(toDict()(replay), **options)
@plugin
def toDict(replay):

0 comments on commit cf14a7d

Please sign in to comment.