-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing plugin exeample endpoints & minor fixes to screenPath.py
- Loading branch information
Showing
7 changed files
with
57 additions
and
20 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from mapadroid.plugins.endpoints.AbstractPluginEndpoint import AbstractPluginEndpoint | ||
import aiohttp_jinja2 | ||
|
||
|
||
class ExampleEndpoint(AbstractPluginEndpoint): | ||
""" | ||
"/example" | ||
""" | ||
|
||
# TODO: Auth | ||
@aiohttp_jinja2.template('testfile.html') | ||
async def get(self): | ||
return {"header": "Test Plugin", | ||
"title": "Test Plugin"} |
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,14 @@ | ||
from mapadroid.plugins.endpoints.AbstractPluginEndpoint import AbstractPluginEndpoint | ||
import aiohttp_jinja2 | ||
|
||
|
||
class PluginfaqEndpoint(AbstractPluginEndpoint): | ||
""" | ||
"/pluginfaq" | ||
""" | ||
|
||
# TODO: Auth | ||
@aiohttp_jinja2.template('pluginfaq.html') | ||
async def get(self): | ||
return {"header": "Test Plugin", | ||
"title": "Test Plugin - FAQ"} |
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,10 @@ | ||
from aiohttp import web | ||
|
||
from plugins.madPluginExample.endoints.ExampleEndpoint import ExampleEndpoint | ||
from plugins.madPluginExample.endoints.PluginfaqEndpoint import PluginfaqEndpoint | ||
|
||
|
||
def register_custom_plugin_endpoints(app: web.Application): | ||
# Simply register any endpoints here. If you do not intend to add any views (which is discouraged) simply "pass" | ||
app.router.add_view('/example', ExampleEndpoint, name='example') | ||
app.router.add_view('/pluginfaq', PluginfaqEndpoint, name='pluginfaq') |