working on players
[r15k.git] / r15k / engine / user.py
1 # -*- coding: utf-8 -*-
2
3 import logging
4 logger = logging.getLogger('r15k.user')
5
6 from r15k.engine.ids import new_id
7
8 class User:
9 def __init__(self, login, name, corp):
10 self.login = login
11 self.name = name
12 self.corp = corp
13 self.uid = new_id()
14
15 def dump(self):
16 data = {}
17 data["login"] = self.login
18 data["name"] = self.name
19 data["corp"] = self.corp
20 data["uid"] = self.uid
21 return data
22
23 def restore(self, data):
24 self.uid = data["uid"]
25 self.login = data["login"]
26 self.name = data["name"]
27 self.corp = data["corp"]
28 return data
29
30