karl
index
/home/ping/web/bc/date/karl.py

## $Id: date.py,v 1.9 2003/03/02 22:04:38 quarl Exp $

 
Classes
            
Callable
Date
 
class Callable
       
   Methods defined here:
__init__(self, anycallable)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'karl'

 
class Date
       
   Methods defined here:
__add__(self, numdays)
Returns a new Date which is NUMDAYS after SELF. Adding a negative
amount is equivalent to subtracting.
__cmp__(self, other)
Compares this Date with the other Date.  The most recent Date is more than
a past Date.  (Example: February 28, 2003 more than March 15, 1999)
__init__(self, y, m, d)
Initializes this instance of Date with year, month, day. If the
date is invalid the result is undefined.
__repr__(self)
Return a string representation that can be evaluated to create a Date
__str__(self)
Equivalent to tostring_longhand()
__sub__(self, numdays)
Returns a new Date which is NUMDAYS before SELF. Equivalent to
adding a negative amount.
_set_next_day(self)
_set_prev_day(self)
Set SELF to the previous day.
next_day(self)
prev_day(self)
set_date(self, datestring)
Sets this instance of Date to the given DATESTRING which must be
of format 'YYYY-MM-DD'. If the date is invalid the result is undefined.
tostring_longhand(self)
Return the month day, year string representation of the date.
(Example: February 26, 2003)
tostring_numeric(self)
Return the YYYY-MM-DD string representation of the date.

Data and non-method functions defined here:
__doc__ = None
__module__ = 'karl'
_days_in_month = <karl.Callable instance>
_is_leap_year = <karl.Callable instance>
_month_to_string = <karl.Callable instance>
_string_to_month = <karl.Callable instance>
fromstring = <karl.Callable instance>

 
Data
             __file__ = './karl.pyc'
__name__ = 'karl'
d = Date(2004,2,28)
d2 = Date(2003,4,2)
d3 = Date(2003,2,23)
d4 = Date(1981,3,12)
d5 = Date(2003,4,27)
d6 = Date(2003,3,12)
d8 = Date(2003,2,23)
month_map = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}