def OnGenerate(self, evt): if self.validate(): self.Close() createItems.createItems(self.valuesToDict()) else: msg ="Some input is invalid. Please correct input with 'Error' to the right of it and try again" wx.MessageDialog(self, msg, caption='Input error', style=wx.OK, pos=wx.DefaultPosition).ShowModal()
def OnGenerate(self, evt): if self.validate(): self.Close() createItems.createItems(self.valuesToDict()) else: msg = "Some input is invalid. Please correct input with 'Error' to the right of it and try again" wx.MessageDialog(self, msg, caption='Input error', style=wx.OK, pos=wx.DefaultPosition).ShowModal()
def testCreateItems(self): #test that an item gets created with the correct properties paramDict = { 'choicePercentFYI': u'0', 'choicePercentTentative': u'0', 'choicePercentMonthly': u'0', 'textCtrlNoteSourceFilePath': u'itemGenNotes.txt', 'textCtrlAlarmSpec': u'b0.10:100', 'choicePercentNonRecurring': u'100', 'choicePercentNow': u'100', 'choicePercentAtTime': u'0', 'choicePercentDone': u'0', 'choicePercentAnyTime': u'0', 'choicePercentEvent': u'100', 'textCtrlCollectionFileName': u'itemGenCollections.txt', 'textCtrlTimeOfDay': u'8-8:100, 19-23:50', 'choicePercentDaily': u'0', 'textCtrlTitleSourceFile': u'itemGenTitles.txt', 'textCtrlToFile': u'', 'textCtrlRecurrenceEndDates': u'10:50, 0:50', 'choicePercentTask': u'100', 'textCtrlCCFileName': u'', 'textCtrlEndDate': u'2008,1,2', 'choicePercentConfirmed': u'100', 'textCtrlTotalItems': u'1', 'textCtrlToSpec': u'1:100', 'textCtrlDuration': u'2.0:100', 'choicePercentLater': u'0', 'textCtrlStartDate': u'2008,1,1', 'textCtrlCollectionCount': u'1', 'textCtrlCollectionMembership': u'1:100', 'choicePercentYearly': u'0', 'choicePercentAllDay': u'0', 'textCtrlBCCSpec': u'0:100', 'textCtrlCCSpec': u'0:100', 'choicePercentUnassignedStatus': u'0', 'choicePercentDuration': u'100', 'textCtrlLocationSourceFilePath': u'itemGenLocations.txt', 'choicePercentWeekly': u'0', 'textCtrlBCCFileName': u'', 'choicePercentMail': u'100', 'choicePercentBiWeekly': u'0' } #create a single item with all stamps testItem = createItems.createItems(paramDict)[0] # test it has all stamps self.failUnless(pim.has_stamp(testItem, pim.mail.MailStamp)) self.failUnless(pim.has_stamp(testItem, pim.TaskStamp)) self.failUnless(pim.has_stamp(testItem, Calendar.EventStamp))
def testCreateItems(self): #test that an item gets created with the correct properties paramDict = {'choicePercentFYI': u'0', 'choicePercentTentative': u'0', 'choicePercentMonthly': u'0', 'textCtrlNoteSourceFilePath': u'itemGenNotes.txt', 'textCtrlAlarmSpec': u'b0.10:100', 'choicePercentNonRecurring': u'100', 'choicePercentNow': u'100', 'choicePercentAtTime': u'0', 'choicePercentDone': u'0', 'choicePercentAnyTime': u'0', 'choicePercentEvent': u'100', 'textCtrlCollectionFileName': u'itemGenCollections.txt', 'textCtrlTimeOfDay': u'8-8:100, 19-23:50', 'choicePercentDaily': u'0', 'textCtrlTitleSourceFile': u'itemGenTitles.txt', 'textCtrlToFile': u'', 'textCtrlRecurrenceEndDates': u'10:50, 0:50', 'choicePercentTask': u'100', 'textCtrlCCFileName': u'', 'textCtrlEndDate': u'2008,1,2', 'choicePercentConfirmed': u'100', 'textCtrlTotalItems': u'1', 'textCtrlToSpec': u'1:100', 'textCtrlDuration': u'2.0:100', 'choicePercentLater': u'0', 'textCtrlStartDate': u'2008,1,1', 'textCtrlCollectionCount': u'1', 'textCtrlCollectionMembership':u'1:100', 'choicePercentYearly': u'0', 'choicePercentAllDay': u'0', 'textCtrlBCCSpec': u'0:100', 'textCtrlCCSpec': u'0:100', 'choicePercentUnassignedStatus': u'0', 'choicePercentDuration': u'100', 'textCtrlLocationSourceFilePath': u'itemGenLocations.txt', 'choicePercentWeekly': u'0', 'textCtrlBCCFileName': u'', 'choicePercentMail': u'100', 'choicePercentBiWeekly': u'0'} #create a single item with all stamps testItem = createItems.createItems(paramDict)[0] # test it has all stamps self.failUnless(pim.has_stamp(testItem, pim.mail.MailStamp)) self.failUnless(pim.has_stamp(testItem, pim.TaskStamp)) self.failUnless(pim.has_stamp(testItem, Calendar.EventStamp))