-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:transceptor-technology/aiogcd
- Loading branch information
Showing
13 changed files
with
166 additions
and
120 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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
Author: Jeroen van der Heijden <[email protected]> | ||
""" | ||
import base64 | ||
from typing import Optional | ||
from .buffer import Buffer | ||
from .buffer import BufferDecodeError | ||
from .path import Path | ||
|
@@ -40,8 +41,10 @@ class Key: | |
""" | ||
_ks = None | ||
|
||
def __init__(self, *args, ks=None, path=None, project_id=None, | ||
namespace_id=None): | ||
def __init__(self, *args, ks: Optional[str] = None, | ||
path: Optional[Path] = None, | ||
project_id: Optional[str] = None, | ||
namespace_id: Optional[str] = None): | ||
if len(args) == 1 and isinstance(args[0], dict): | ||
assert ks is None and path is None and project_id is None, \ | ||
self.KEY_INIT_MSG | ||
|
@@ -147,8 +150,9 @@ def _extract_id_or_name(pair): | |
return None | ||
|
||
@staticmethod | ||
def _deserialize_ks(ks): | ||
"""Returns a Key() object from a key string.""" | ||
def _deserialize_ks(ks: str): | ||
"""Returns a tuple with the project_id, namespace_id and Path | ||
from a key string.""" | ||
|
||
decoder = Decoder(ks=ks) | ||
project_id = None | ||
|
Oops, something went wrong.