-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserClass.py
36 lines (26 loc) · 1.01 KB
/
userClass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
""" User Object"""
class User(object):
""" Attributes"""
def __init__(self, L):
# some naming inconsistency in order to match xml roots
# Implement easier way to do this
self.id = L[0]
self.name = L[1]
self.watching = L[2]
self.completed = L[3]
self.onhold = L[4]
self.dropped = L[5]
self.plantowatch = L[6]
self.days_spend_watching = L[7]
attribList = [self.id, self.name, self.watching, self.completed,
self.onhold, self.dropped, self.plantowatch,
self.days_spend_watching]
for k in range(len(attribList)):
attribList[k] = L[k]
# This function exists for consistency with the anime class
# While anime data is contained by a list of lists user data is contained by a
# single list and thus is trivial to intialize
def userClassCreator(userData):
""" Takes a list of raw user data and creates user objects"""
tempClass = User(userData)
return tempClass