コード例 #1
0
ファイル: test.py プロジェクト: seniorivn/python_contact_book
def randomContact():
        contact = Contact()
        contact.fname=randomString(10)
        contact.mname=randomString(10)
        contact.lname=randomString(10)
        contact.phone=randomString(10)
        contact.bday=str(random.randint(1,29))+"/"+str(random.randint(1,12))+"/"+str(1950+random.randint(0,60))
        return contact
コード例 #2
0
 def getContact(self):
     """get contacts from fields in gui"""
     contact = Contact()
     try:
         contact.cid   = self.cidEdit.text()
         contact.fname = self.fnameEdit.text()
         contact.mname = self.mnameEdit.text()
         contact.lname = self.lnameEdit.text()
         contact.phone = self.phoneEdit.text()
         contact.bday  = self.bdayEdit.text()
     except Exception as e:
         QMessageBox.question(self, 'Error', str(e), QMessageBox.Ok, QMessageBox.Ok)
     return contact
コード例 #3
0
 def getContact(self):
     """get contacts from fields in gui"""
     contact = Contact()
     try:
         contact.cid = self.cidEdit.text()
         contact.fname = self.fnameEdit.text()
         contact.mname = self.mnameEdit.text()
         contact.lname = self.lnameEdit.text()
         contact.phone = self.phoneEdit.text()
         contact.bday = self.bdayEdit.text()
     except Exception as e:
         QMessageBox.question(self, 'Error', str(e), QMessageBox.Ok,
                              QMessageBox.Ok)
     return contact