Skip to content
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

Move the barion efficiency into a plugin #21

Closed
kakaroto opened this issue Feb 3, 2016 · 3 comments
Closed

Move the barion efficiency into a plugin #21

kakaroto opened this issue Feb 3, 2016 · 3 comments

Comments

@kakaroto
Copy link
Owner

kakaroto commented Feb 3, 2016

The barion efficiency formula would benefit from being its own plugin, now with the new plugin system, it would be nice to even allow one plugin (rune extractor) to use other plugins to extend its functionality (add a new csv column).
I'm thinking plugins would have access to the plugins list, and we could use a csv.DictWriter, and plugins could have the method :

def process_csv_row(row, type, data)
    row['new_column'] = 'value'
    return row

where 'type' argument would be 'rune' or 'monster' or 'friend_rune', or 'scenario_run',etc.. these could be anything that the plugin that creates a CSV wants it to be (they'd need to be unique among plugins), and 'data' argument would be specific to the plugin, so for example 'rune' type would have a rune dictionary as 'data', etc...

@fperegrinvs
Copy link
Collaborator

Assuming that each plugin have only one very specific role, we can categorize plugins according to the entry point so we can proper filter them using yapsy built-in methods.

Some plugins will need multiple entry points but not every plugin would implement all methods. Should we just check if method exists as suggested here or should we pursue something more fancy and elegant ?.

@kakaroto
Copy link
Owner Author

kakaroto commented Feb 4, 2016

oh, I'd say we'd have a class SWPlugin which inherits IPlugin. and SW plugins would derive from that. That class would implement all functions with a 'pass' so plugins can overwrite the function if they want to implement it, otherwise the base class's function will be called, which will be a noop.
EDIT: I just saw the link you posted. That's interesting, we could indeed have categories that implement CSVParser vs. JSONParser, but I don't think it's necessary, add filters, check category, it gets even more complicated if a plugin needs to do both..

@kakaroto
Copy link
Owner Author

kakaroto commented Feb 4, 2016

I like how you did the csv_type + data_type. Great idea. Merged and fixed, so I'll close this issue. thanks!

@kakaroto kakaroto closed this as completed Feb 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants