Commits

razzmataz committed fe56a76

basic classes set up, probably need cleaning

Comments (0)

Files changed (6)

+from dossier import dossier
+
+
+class Email(dossier):
+
+    def __init__(self):
+        super(Email,self).__init__()
+        self.record_type = 'email-address'
+        self.info['address']
+        self.info['name']
     """
 
     def __init__(self):
+        super(Name,self).__init__()
         self.record_type = "name-record"
-        self.__fullname = ""
-        #self.record_id = str(uuid.uuid4())
-        self.__dob = None
+        self.info['fullname'] = None
+        self.info['dob'] = None
+ 
 
-
-    def fullname(self,name=None):
+    def fullname(self,name=None, ):
         if name:
-            self.__fullname = name
+            self.info['fullname'] = name
         else:
-            return self.__fullname
+            return self.info['fullname']
 
 
     def add_note(self,value):
 
     def dob(self,dateobj=None):
         if dateobj:
-            self.__dob = dateobj
-        return self.__dob
+            self.info['dob'] = dateobj
+        return self.info['dob']

dossier/PhoneNumber.py

 class PhoneNumber(dossier):
 
     def __init__(self):
+        super(PhoneNumber,self).__init__()
         self.record_type = "phone-record"
-        self.__location = ""
-        self.__raw_number = ""
-        #self.record_id = str(uuid.uuid4())
-        self.__cell = False
-        self.__business = False
-        self.__home = False
-        self.__fax = False
+        self.info['location'] = ""
+        self.info['raw_number'] = ""
+        self.info['cell'] = False
+        self.info['business']= False
+        self.info['home']= False
+        self.info['fax'] = False
 
 

dossier/UserId.py

 class UserId(dossier):
 
     def __init__(self, site=None,username=None):
-        self.site = None
-        self.username = None
+        super(UserId,self).__init__()
+        self.info['site'] = None
+        self.info['username'] = None
         if site:
-            self.site = site
+            self.info['site'] = site
         if username:
-            self.username = username
+            self.info['username'] = username
 
 

dossier/dossier.py

         self.record_id = str(uuid.uuid4())
         self.notes = [ ]
         self.linked_records = [ ]
+        #self.info = { }
+        self.info = dict( )
 
 
 class backend(object):
         obj.dob( datetime.date(1974,10,19))
         self.assertEqual(obj.dob(), datetime.date(1974,10,19)) 
 
+    def testHasRecordId(self):
+        obj = Name.Name()
+        self.failIf(obj.record_id == None)
+
+    def testRecordType(self):
+        obj = Name.Name()
+        self.assertEqual(obj.record_type, 'name-record')
+
 
 if __name__ == '__main__':
     unittest.main()