SAuth/sauth/user.py

20 lines
490 B
Python
Raw Permalink Normal View History

2019-01-17 18:20:13 +00:00
# -*-coding:utf-8 -*
class User:
def __init__(self, username, password=None, roles=[], **kw):
self.username = username
self.password = password
self.roles = roles
self.info = {}
for e in kw:
self.info[e] = kw[e]
def __str__(self):
s = "User {}".format(self.username)
for e in self.info:
s+= " {} : {}".format(e, self.info[e])
return s
def __repr__(self):
return self.__str__()