-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #540 from phenobarbital/test-version
contrib for adding navconfig into an aiohttp application
- Loading branch information
Showing
3 changed files
with
16 additions
and
1 deletion.
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,3 @@ | ||
from __future__ import annotations | ||
|
||
from .web import AiohttpConfig |
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,12 @@ | ||
from aiohttp import web | ||
from navconfig import config, Kardex | ||
|
||
class AiohttpConfig: | ||
def __init__(self, app: web.Application, key_name: str = 'config'): | ||
self.app = app | ||
config_key = web.AppKey(key_name, Kardex) | ||
if hasattr(self.app, key_name): | ||
# already configured | ||
return | ||
self.app[config_key] = config | ||
setattr(self.app, key_name, config) |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"Configuration tool for all Navigator Services " | ||
"Tool for accessing Config info from different sources." | ||
) | ||
__version__ = "1.7.10" | ||
__version__ = "1.7.11" | ||
__author__ = "Jesus Lara" | ||
__author_email__ = "[email protected]" | ||
__license__ = "MIT" |