You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tinge/tinge/UserOrError/__init__.py

29 lines
605 B

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
class UserOrError:
def __init__(self):
self.UNKNOWNERROR = 9999
self.muser: str = str()
self.merror: bool = True
self.mcode: int = self.UNKNOWNERROR
def get_error_code(self) -> int:
return self.mcode
def get_user(self) -> str:
return self.muser
def is_error(self) -> bool:
return self.merror
def set_error(self, code: int):
self.merror = True
self.mcode = code
def set_user(self, username: str):
self.merror = False
self.muser = username