"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "EmailReminder/Yearly.py" between
email-reminder-0.8.0.tar.gz and email-reminder-0.8.1.tar.gz

About: Email-Reminder lets define events to be reminded of by email via cronjob (with GUI).

Yearly.py  (email-reminder-0.8.0):Yearly.py  (email-reminder-0.8.1)
skipping to change at line 40 skipping to change at line 40
return datetime.date(1980, int(month), int(day)).strftime('%m-%d') return datetime.date(1980, int(month), int(day)).strftime('%m-%d')
return datetime.date(int(year), int(month), int(day)).isoformat() return datetime.date(int(year), int(month), int(day)).isoformat()
except ValueError: except ValueError:
return '' return ''
def parseDate(dateString): def parseDate(dateString):
try: try:
if len(dateString) == 5: if len(dateString) == 5:
date = datetime.datetime.strptime(dateString, '%m-%d') date = datetime.datetime.strptime(dateString, '%m-%d')
return {'year': None, 'month': date.month, 'day': date.day} return {'year': None, 'month': date.month, 'day': date.day}
else: date = datetime.datetime.strptime(dateString, '%Y-%m-%d')
date = datetime.datetime.strptime(dateString, '%Y-%m-%d')
except ValueError: except ValueError:
date = datetime.datetime.today() date = datetime.datetime.today()
return {'year': date.year, 'month': date.month, 'day': date.day} return {'year': date.year, 'month': date.month, 'day': date.day}
class YearlyModel(EventModel): class YearlyModel(EventModel):
LABEL = 'Yearly Events' LABEL = 'Yearly Events'
TYPE = 'yearly' TYPE = 'yearly'
COLUMN_NAMES = ["Event Name", "Event Date"] COLUMN_NAMES = ["Event Name", "Event Date"]
def fillNewEvent(self, event): def fillNewEvent(self, event):
super().fillNewEvent(event) super().fillNewEvent(event)
writeXMLValue(self.document, event, 'month', 1) writeXMLValue(self.document, event, 'month', 1)
writeXMLValue(self.document, event, 'day', 15) writeXMLValue(self.document, event, 'day', 15)
def getDataInternal(self, column, row): def getDataInternal(self, column, row):
parentData = super().getDataInternal(column, row) parentData = super().getDataInternal(column, row)
if parentData: if parentData:
return parentData return parentData
elif column == 1: if column == 1:
event = self.events[row] event = self.events[row]
year = readXMLValue(event, 'year') year = readXMLValue(event, 'year')
month = readXMLValue(event, 'month') month = readXMLValue(event, 'month')
day = readXMLValue(event, 'day') day = readXMLValue(event, 'day')
return formatDate(year, month, day) return formatDate(year, month, day)
return None return None
def setDataInternal(self, column, row, value): def setDataInternal(self, column, row, value):
if column == 1: if column == 1:
 End of changes. 2 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)