def getCalendar(locale, fd): if locale is None: return calendar.TextCalendar(fd) else: return calendar.LocaleTextCalendar(fd, locale) #GUI Management