changed method name and added inheritance for 'Software' class, moved 'SSHKey' related classes to separate file and fixed 'Software' instance method call
This commit is contained in:
29
softman.py
29
softman.py
@@ -10,6 +10,7 @@ from custtypes import ExecutedPath, IdlePath
|
||||
from enum import Enum
|
||||
from pathlib import Path, PurePath
|
||||
from whereami import USER_PATH, PROJ_ROOT
|
||||
from collections.abc import Sequence
|
||||
|
||||
AppPath: Neotype = Union[ExecutedPath, IdlePath]
|
||||
|
||||
@@ -68,14 +69,14 @@ Apps = type("Apps", (), __app_input)
|
||||
|
||||
# @TODO continue adding magic methods to below class
|
||||
# @NOTE https://rszalski.github.io/magicmethods/#sequence
|
||||
class Software:
|
||||
class Software (Sequence):
|
||||
__user_path: ExecutedPath = USER_PATH
|
||||
|
||||
def __init__(self):
|
||||
self._fqdn: str | None = None
|
||||
|
||||
# @TODO fix NameError for 'Software' in parameter type check
|
||||
def declare(self, name: str, **kwpaths: _SubAppParams) -> AppParams:
|
||||
def append(self, name: str, **kwpaths: _SubAppParams) -> AppParams:
|
||||
keyword_args: AppParams = kwpaths
|
||||
|
||||
app = Apps(**keyword_args)
|
||||
@@ -153,11 +154,29 @@ class Software:
|
||||
)
|
||||
return len(apps)
|
||||
|
||||
def __contains__(self):
|
||||
def pop(self) -> Never:
|
||||
raise NotImplementedError
|
||||
|
||||
def __missing__(self):
|
||||
def remove(self) -> Never:
|
||||
raise NotImplementedError
|
||||
|
||||
def __iter__(self):
|
||||
def __contains__(self) -> Never:
|
||||
raise NotImplementedError
|
||||
|
||||
def count(self) -> Never:
|
||||
return NotImplementedError
|
||||
|
||||
def __missing__(self) -> Never:
|
||||
raise NotImplementedError
|
||||
|
||||
def __iter__(self) -> Never:
|
||||
raise NotImplementedError
|
||||
|
||||
def reverse(self) -> Never:
|
||||
raise NotImplementedError
|
||||
|
||||
def sort(self, key: Callable = (lambda e: e), reverse: bool = False) -> Never:
|
||||
raise NotImplementedError
|
||||
|
||||
class Softs(Enum):
|
||||
ssh = 0
|
||||
Reference in New Issue
Block a user