"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/reportlab/lib/normalDate.py" between
reportlab-3.5.23.tar.gz and reportlab-3.5.26.tar.gz

About: ReportLab generates high-quality dynamic PDF documents/charts in real-time \PKG_DESCR_TTamp; high volumes from any data source (commercial version also available).

normalDate.py  (reportlab-3.5.23):normalDate.py  (reportlab-3.5.26)
skipping to change at line 208 skipping to change at line 208
return self.normalDate > other.normalDate return self.normalDate > other.normalDate
def day(self): def day(self):
"""return the day as integer 1-31""" """return the day as integer 1-31"""
return int(repr(self.normalDate)[-2:]) return int(repr(self.normalDate)[-2:])
def dayOfWeek(self): def dayOfWeek(self):
"""return integer representing day of week, Mon=0, Tue=1, etc.""" """return integer representing day of week, Mon=0, Tue=1, etc."""
return dayOfWeek(*self.toTuple()) return dayOfWeek(*self.toTuple())
@property
def __day_of_week_name__(self):
return getattr(self,'_dayOfWeekName',_dayOfWeekName)
def dayOfWeekAbbrev(self): def dayOfWeekAbbrev(self):
"""return day of week abbreviation for current date: Mon, Tue, etc.""" """return day of week abbreviation for current date: Mon, Tue, etc."""
return _dayOfWeekName[self.dayOfWeek()][:3] return self.__day_of_week_name__[self.dayOfWeek()][:3]
def dayOfWeekName(self): def dayOfWeekName(self):
"""return day of week name for current date: Monday, Tuesday, etc.""" """return day of week name for current date: Monday, Tuesday, etc."""
return _dayOfWeekName[self.dayOfWeek()] return self.__day_of_week_name__[self.dayOfWeek()]
def dayOfYear(self): def dayOfYear(self):
"""day of year""" """day of year"""
if self.isLeapYear(): if self.isLeapYear():
daysByMonth = _daysInMonthLeapYear daysByMonth = _daysInMonthLeapYear
else: else:
daysByMonth = _daysInMonthNormal daysByMonth = _daysInMonthNormal
priorMonthDays = 0 priorMonthDays = 0
for m in range(self.month() - 1): for m in range(self.month() - 1):
priorMonthDays = priorMonthDays + daysByMonth[m] priorMonthDays = priorMonthDays + daysByMonth[m]
skipping to change at line 387 skipping to change at line 391
return _daysInMonthNormal[self.month() - 1] return _daysInMonthNormal[self.month() - 1]
def localeFormat(self): def localeFormat(self):
"""override this method to use your preferred locale format""" """override this method to use your preferred locale format"""
return self.formatUS() return self.formatUS()
def month(self): def month(self):
"""returns month as integer 1-12""" """returns month as integer 1-12"""
return int(repr(self.normalDate)[-4:-2]) return int(repr(self.normalDate)[-4:-2])
@property
def __month_name__(self):
return getattr(self,'_monthName',_monthName)
def monthAbbrev(self): def monthAbbrev(self):
"""returns month as a 3-character abbreviation, i.e. Jan, Feb, etc.""" """returns month as a 3-character abbreviation, i.e. Jan, Feb, etc."""
return _monthName[self.month() - 1][:3] return self.__month_name__[self.month() - 1][:3]
def monthName(self): def monthName(self):
"""returns month name, i.e. January, February, etc.""" """returns month name, i.e. January, February, etc."""
return _monthName[self.month() - 1] return self.__month_name__[self.month() - 1]
def normalize(self, scalar): def normalize(self, scalar):
"""convert scalar to normalDate""" """convert scalar to normalDate"""
if scalar < _bigBangScalar: if scalar < _bigBangScalar:
msg = "normalize(%d): scalar below minimum" % \ msg = "normalize(%d): scalar below minimum" % \
_bigBangScalar _bigBangScalar
raise NormalDateException(msg) raise NormalDateException(msg)
if scalar > _bigCrunchScalar: if scalar > _bigCrunchScalar:
msg = "normalize(%d): scalar exceeds maximum" % \ msg = "normalize(%d): scalar exceeds maximum" % \
_bigCrunchScalar _bigCrunchScalar
 End of changes. 6 change blocks. 
4 lines changed or deleted 12 lines changed or added

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