1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-15 00:36:11 +01:00
github.com_openSUSE_osc/osc/obs_api/simple_flag.py

25 lines
597 B
Python

from ..util.models import * # pylint: disable=wildcard-import,unused-wildcard-import
class SimpleFlag(XmlModel):
XML_TAG = None
XML_TAG_FIELD = "flag"
def __init__(self, flag):
super().__init__(flag=flag)
class SimpleFlagChoices(Enum):
ENABLE = "enable"
DISABLE = "disable"
flag: SimpleFlagChoices = Field(
xml_wrapped=True,
xml_set_tag=True,
)
def __eq__(self, other):
if hasattr(other, "flag"):
return self.flag == other.flag
# allow comparing with a string
return self.flag == other