-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Registries, Plugins, and Wiki Integration (#109)
Very late now, but I believe i have done this: #39 I will return tomorrow to write the docs and the PR, but yes it is time. dump anything that inherits from the appropriate metaclass into `PLUGINDIR` and... ```python import autopilot # list all hardware autopilot.get('hardware') # or an alias autopilot.get_hardware() # get hardware (including from plugins) autopilot.get('hardware', 'PWM') # get anything autopilot.get('task') autopilot.get('graduation') autopilot.get('transform') autopilot.get('children') ``` and as a little bonus... ```python >>> from autopilot.utils import wiki >>> wiki.ask('[[HiFiBerry Amp2]]', "Uses GPIO Pin") [{'Uses GPIO Pin': [3, 5, 7, 12, 35, 38, 40], 'name': 'HiFiBerry Amp2', 'url': 'https://wiki.auto-pi-lot.com/index.php/HiFiBerry_Amp2'}] ``` which will serve as the means of submitting plugins and doing some stuff that is truly messed up how cool it is... more soon ;) * deduplicate utils formerly had core/utils and a utils module, just have the module now. * draft simpler registry :) * moving common utility functions out of __init__ * task and hardware aliases * proper sorting * got excited and made a wiki API access module in this branch by accident whoops * want to get one good build off! * want to get one good build off! * tests for registry module * whoops reverting stuff that was broken at the time of adding it lmao jonny watch the results of the tests jesus christ * basic test of a plugin * implementing get throughout rest of library removing imports and references to hardware and task objects, and finally killed the godforsaken Task List once and for all. also adding other assorted improvements and bugfixes from the registries branch * just for shits lets see if other versions work * fix path traversal through modules whose base class is not in __init__ * proof of concept plugins manager ;)
- Loading branch information
1 parent
8c078ee
commit 13c4c56
Showing
40 changed files
with
1,706 additions
and
422 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 |
---|---|---|
|
@@ -3,6 +3,8 @@ sudo: required | |
language: python | ||
python: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
|
||
arch: | ||
- amd64 | ||
|
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,5 @@ | ||
__author__ = 'Jonny Saunders <j@nny.fyi>' | ||
__version__ = '0.3.5' | ||
|
||
from autopilot.setup import setup_autopilot | ||
from autopilot.utils.registry import get, get_task, get_hardware, get_names |
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
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
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
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
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
Oops, something went wrong.