- Developer related material
Developer related material
API is not yet stabilized. Expect some changes to happen. Yes, documentation is not very good at the moment.
- Some smaller misc libraries
- Generated Sphinx API documents
- This is where we will add all technical documentation in the future - see especially core section!
- how to use mock data via configuration file
- test driven development how to
- unit test coverage
- Good overview of SQLAlchemy concepts
Resources, autogenerated from wiki
Making custom plugins should be easy for anyone with some python experience.
If you're working on good re-usable plugin we're be more than happy to include it in official distribution. See Contribute for more information.
Plugins are registered by calling register_plugin method.
register_plugin(<class name>, '<keyword>', [parameters])
You can also pass some optional named arguments
Optional arguments: builtin - set to True if plugin should be executed always group - group name this plugin belongs to groups - list of group names this plugin belongs to
Listed in order of execution.
- on_task_start(self, task, config)
- on_task_input(self, task, config)
- on_task_metainfo(self, task, config)
- on_task_filter(self, task, config)
- on_task_download(self, task, config)
- on_task_modify(self, task, config)
- on_task_output(self, task, config)
- on_task_exit(self, task, config)
When multiple plugins of same phase type are enabled for a task, the priority decorator can be used to define execution order. Default is 128. Larger number, higher priority. e.g.
@priority(120) on_task_filter(self, task, config): pass
Task execution UML
Only most important phases shown.
- on_task_abort(self, task, config)
- on_process_start(self, task, config)
- on_process_end(self, task, config)
These are triggered on startup and shutdown, not between tasks.
Registering custom phases
Plugins may create new task phases, signature is on_task_<name>(self, task, ....) (parameters depend on api version).
Adding commandline parameters
You can also add more commandline parameters. Check existing plugins. See Optik homepage for documentation.
FlexGet has over 200 unit tests so changes are that if your modifications pass the tests nothing major has been broken. We also have CI at http://ci.flexget.com.
You can install needed testing tools with:
Argument --online can be used to enable online tests
Run a single test
# NOTE: don't use the pathname for the file, e.g. tests/test_file.py bin/nosetests test_file
Running IPython inside FlexGet
First install IPython
And then place this where you wish to hack:
import IPython; IPython.embed()
Thanks to JetBrains for the free open source PyCharm license!