예제 #1
0
    def __init__(
            self,
            *,
            name: str = 'kopf',
            field: dicts.FieldSpec = 'status.{name}.progress',
            touch_field: dicts.FieldSpec = 'status.{name}.dummy',
    ) -> None:
        super().__init__()
        self._name = name

        real_field = field.format(name=name) if isinstance(field, str) else field
        self._field = dicts.parse_field(real_field)

        real_field = touch_field.format(name=name) if isinstance(touch_field, str) else touch_field
        self._touch_field = dicts.parse_field(real_field)
예제 #2
0
 def __init__(
         self,
         *,
         name: str = 'kopf',
         field: dicts.FieldSpec = 'status.{name}.last-handled-configuration',
 ) -> None:
     super().__init__()
     self._name = name
     real_field = field.format(name=self._name) if isinstance(field, str) else field
     self._field = dicts.parse_field(real_field)
예제 #3
0
 def field(self, field: dicts.FieldSpec) -> None:
     real_field = field.format(name=self._name) if isinstance(field, str) else field
     self._field = dicts.parse_field(real_field)