def getValues(self): # Grab the raw values we will need to parse. date = helpers.wxdate2pydate(self.dateCtrl.Value) desc = self.descCtrl.Value amount = self.amountCtrl.Value # Parse the amount. try: amount = self.CurrentAccount.ParseAmount(amount) except ValueError: if amount == "": baseStr = _("No amount entered in the 'Amount' field.") else: baseStr = _("'%s' is not a valid amount.") % amount dlg = wx.MessageDialog( self.Parent, baseStr + " " + _("Please enter a number such as 12.34 or -20."), _("Invalid Transaction Amount"), wx.OK | wx.ICON_ERROR, ) dlg.ShowModal() return return amount, desc, date
def GetSettings(self): repeatType = self.repeatsCombo.GetSelection() repeatEvery = self.everySpin.GetValue() if self.endsNeverRadio.GetValue(): end = None else: end = helpers.wxdate2pydate(self.endDateCtrl.GetValue()) return repeatType, repeatEvery, end
def getValues(self): # Grab the raw values we will need to parse. date = helpers.wxdate2pydate(self.dateCtrl.Value) desc = self.descCtrl.Value amount = self.amountCtrl.Value # Parse the amount. try: amount = self.CurrentAccount.ParseAmount(amount) except ValueError: if amount == "": baseStr = _("No amount entered in the 'Amount' field.") else: baseStr = _("'%s' is not a valid amount.") % amount dlg = wx.MessageDialog( self.Parent, baseStr + " " + _("Please enter a number such as 12.34 or -20."), _("Invalid Transaction Amount"), wx.OK | wx.ICON_ERROR) dlg.ShowModal() return return amount, desc, date
def getDateRange(self): return [helpers.wxdate2pydate(date) for date in (self.startDate.Value, self.endDate.Value)]