- cmds.secrets.lib.base: Add module
- cmds.secrets.lib.util: Fix missing Attrs type
Signed-off-by: Jan Lindemann <jan@janware.com>
35 lines
814 B
Python
35 lines
814 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
@dataclass
|
|
class Attrs:
|
|
|
|
mode: int | None = None
|
|
owner: str | None = None
|
|
group: str | None = None
|
|
conf: str | None = None
|
|
|
|
def update(self, rhs: Args|None) -> Args:
|
|
if rhs is not None:
|
|
if rhs.mode:
|
|
self.mode = rhs.mode
|
|
if rhs.owner:
|
|
self.owner = rhs.owner
|
|
if rhs.group:
|
|
self.group = rhs.group
|
|
if rhs.conf:
|
|
self.conf = rhs.conf
|
|
return self
|
|
|
|
def emtpy(self) -> bool:
|
|
if self.mode is not None:
|
|
return False
|
|
if self.owner is not None:
|
|
return False
|
|
if self.group is not None:
|
|
return False
|
|
return True
|
|
|