vimeo / graph-explorer

A graphite dashboard powered by structured metrics
http://vimeo.github.io/graph-explorer/
Apache License 2.0
1.06k stars 93 forks source link

allow configurable metric_plugins_dir #61

Closed thepaul closed 10 years ago

thepaul commented 10 years ago

This is mostly useful to make it easier to package GE as a deb or rpm, so people can install GE in system locations and still be able to disable or replace or enhance builtin metric plugins.

It allows the user to configure a list of plugin dirs. The system will load .py files from each one in turn, making it look like they were all part of the same python package. So plugins in a separate user dir will still be able to do "from . import Plugin" and get the right base class.

Dieterbe commented 10 years ago

do I see this correctly that load_plugins_from appends to the errors list directly? it is important that load_plugins returns any errors (including the ones from load_plugins_from), for display to users. haven't tried it, but this probably works your code because the errors list is passed by reference; however it looks kindof obscure to do it this way. how about load_plugins_from returning the errors it encountered itself, and then extending the original list with those?

thepaul commented 10 years ago

that would be fine. i'll make that change

Dieterbe commented 10 years ago

nice. merged. thanks