New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decorator interface for registering processing funcs? #9
Comments
I agree, the So if I understand correctly, you propose to pass just a python file like I'd like to keep the backward compatibility with |
Yes exactly. Personally I'd go with a api something like, @massedit.processor
def my_processing_func(lines, path):
for line in lines:
... This lets you then do verification at import time with
I can offer up a PR if you'd like. |
Yeah, that sounds good. I was hoping you'd offer :-) |
So I took a different approach and created an option I found that most of the time the issue was not so much what function I should tell massedit.py to call (I had just created it) but what the callback should look like in the first place. 565bbd3 should fix that problem and allow the user to quickly see how to use massedit. |
What's your opinion on a using decorators to register processing functions?
It would eliminate the whole needing to have the
-f fixer:add_header
explicit syntax. Instead you just point to a module and the decorated funcs are auto loaded.Also the requirement that the module is on the python path could be avoided by a simple import of the file directly
Whatcha think?
The text was updated successfully, but these errors were encountered: