-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
Unfortunately I prefer Docs in Github's Extended Markdown but PyPi | ||
only supports RST. After making changes to README.md you should run | ||
the following to keep the README on PyPi up to date. | ||
|
||
pandoc --from=markdown --to=rst --output=README README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
include LICENSE | ||
include README.md | ||
include README |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
annex | ||
===== | ||
|
||
Summary | ||
~~~~~~~ | ||
|
||
Annex provides assistance with developing plugin-based tools. | ||
|
||
With Annex you can load and reload plugins from various python modules | ||
without the requirement that they exist on the PYTHONPATH. | ||
|
||
Example Usage | ||
~~~~~~~~~~~~~ | ||
|
||
In your project you would define a base class from which all plugins for | ||
project would subclass. | ||
|
||
base\_plugin.py | ||
''''''''''''''' | ||
|
||
:: | ||
|
||
class BaseTestPlugin(object): | ||
def run(self, *args, **kwargs): | ||
raise NotImplementedError() | ||
|
||
example\_plugin.py | ||
'''''''''''''''''' | ||
|
||
:: | ||
|
||
from base_plugin import BaseTestPlugin | ||
|
||
class PrinterPlugin(BaseTestPlugin): | ||
def run(self, *args, **kwargs): | ||
print args, kwargs | ||
|
||
foo.py | ||
'''''' | ||
|
||
:: | ||
|
||
from base_plugin import BaseTestPlugin | ||
from annex import Annex | ||
|
||
plugins = Annex(BaseTestPlugin, "/path/to/plugins") | ||
|
||
for plugin in plugins: | ||
plugin.run("foo", bar="baz") | ||
|