No worries, thanks for the help. That does clear some things up regarding the plugin pattern, but Im still getting the same error unfortunately.
Unfortunately Im still geting the same error. Also I am on the hots branch, I had some trouble getting it to work at all initially because it was throwing me an error about 10 arguments but 11 were passed, and when I removed everything and installed hots branch that seemed to fix it. -- Here is the line by line:
>>> import sc2reader
>>> from sc2reader.plugins.replay import toJSON
>>> configuredToJSON = toJSON(indent=2)
>>> replay = sc2reader.load_replay("path/to/replay/ohana_le.SC2Replay")
>>> print configuredToJSON(replay)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.8-intel/egg/sc2reader/plugins/utils.py", line 20, in call
File "build/bdist.macosx-10.8-intel/egg/sc2reader/plugins/replay.py", line 17, in toJSON
TypeError: wrapper() takes exactly 0 arguments (1 given)
2nd example you gave:
>>> import sc2reader
>>> from sc2reader.plugins.replay import toJSON
>>> sc2reader.register_plugin('Replay', toJSON(indent=2))
>>> print sc2reader.load_replay("path/to/replay/ohana_le.SC2Replay")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.8-intel/egg/sc2reader/factories.py", line 69, in load_replay
File "build/bdist.macosx-10.8-intel/egg/sc2reader/factories.py", line 138, in load
File "build/bdist.macosx-10.8-intel/egg/sc2reader/factories.py", line 151, in _load
File "build/bdist.macosx-10.8-intel/egg/sc2reader/plugins/utils.py", line 20, in call
File "build/bdist.macosx-10.8-intel/egg/sc2reader/plugins/replay.py", line 17, in toJSON
TypeError: wrapper() takes exactly 0 arguments (1 given)
---
Which leads me to believe that Im not calling things wrong, considering Im getting the error both places, and the plugin seems to be decorating the replay as it triggers the error only after its loaded. Any idea what the problem could be though?