Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Data Structures | |
class | _indexer |
class | _localized_month |
class | _localized_day |
Functions | |
def | firstweekday |
def | setfirstweekday |
def | isleap |
def | leapdays |
def | weekday |
def | monthrange |
def | monthcalendar |
def | prweek |
def | week |
def | weekheader |
def | prmonth |
def | month |
def | format3c |
def | format3cstring |
def | prcal |
def | calendar |
def | timegm |
Variables | |
list | __all__ |
error = ValueError | |
int | January = 1 |
int | February = 2 |
list | mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |
tuple | day_name = _localized_day('%A') |
tuple | day_abbr = _localized_day('%a') |
tuple | month_name = _localized_month('%B') |
tuple | month_abbr = _localized_month('%b') |
int | _firstweekday = 0 |
int | _colwidth = 7 |
int | _spacing = 6 |
int | EPOCH = 1970 |
Calendar printing functions Note when comparing these calendars to the ones printed by cal(1): By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use setfirstweekday() to set the first day of the week (0=Monday, 6=Sunday).
def calendar.calendar | ( | year, | |
w = 0 , |
|||
l = 0 , |
|||
c = _spacing |
|||
) |
Returns a year's calendar as a multi-line string.
Definition at line 199 of file calendar.py.
References format3cstring(), sre_parse.max, monthcalendar(), string.rstrip(), week(), and weekheader().
def calendar.firstweekday | ( | ) |
Definition at line 81 of file calendar.py.
def calendar.format3c | ( | a, | |
b, | |||
c, | |||
colwidth = _colwidth , |
|||
spacing = _spacing |
|||
) |
Prints 3-column formatting for year calendars
Definition at line 186 of file calendar.py.
References format3cstring().
def calendar.format3cstring | ( | a, | |
b, | |||
c, | |||
colwidth = _colwidth , |
|||
spacing = _spacing |
|||
) |
Returns a string formatted from 3 strings, centered within 3 columns.
Definition at line 190 of file calendar.py.
def calendar.isleap | ( | year) |
Return 1 for leap years, 0 for non-leap years.
Definition at line 92 of file calendar.py.
def calendar.leapdays | ( | y1, | |
y2 | |||
) |
Return number of leap years in range [y1, y2). Assume y1 <= y2.
Definition at line 96 of file calendar.py.
def calendar.month | ( | theyear, | |
themonth, | |||
w = 0 , |
|||
l = 0 |
|||
) |
Return a month's calendar string (multi-line).
Definition at line 171 of file calendar.py.
References sre_parse.max, monthcalendar(), string.rstrip(), week(), and weekheader().
def calendar.monthcalendar | ( | year, | |
month | |||
) |
Return a matrix representing a month's calendar. Each row represents a week; days outside this month are zero.
Definition at line 119 of file calendar.py.
References monthrange().
def calendar.monthrange | ( | year, | |
month | |||
) |
Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for year, month.
Definition at line 110 of file calendar.py.
References isleap(), and weekday().
def calendar.prcal | ( | year, | |
w = 0 , |
|||
l = 0 , |
|||
c = _spacing |
|||
) |
Print a year's calendar.
Definition at line 195 of file calendar.py.
def calendar.prmonth | ( | theyear, | |
themonth, | |||
w = 0 , |
|||
l = 0 |
|||
) |
def calendar.prweek | ( | theweek, | |
width | |||
) |
def calendar.setfirstweekday | ( | weekday) |
def calendar.timegm | ( | tuple) |
Unrelated but handy function to calculate Unix timestamp from GMT.
Definition at line 232 of file calendar.py.
References isleap(), and leapdays().
def calendar.week | ( | theweek, | |
width | |||
) |
Returns a single week in a string (no newline).
Definition at line 145 of file calendar.py.
References dospath.join().
def calendar.weekday | ( | year, | |
month, | |||
day | |||
) |
Return weekday (0-6 ~ Mon-Sun) for year (1970-...), month (1-12), day (1-31).
Definition at line 103 of file calendar.py.
References tzparse.localtime().
def calendar.weekheader | ( | width) |
list __all__ |
Definition at line 14 of file calendar.py.
int _colwidth = 7 |
Definition at line 183 of file calendar.py.
int _firstweekday = 0 |
Definition at line 79 of file calendar.py.
int _spacing = 6 |
Definition at line 184 of file calendar.py.
tuple day_abbr = _localized_day('%a') |
Definition at line 70 of file calendar.py.
tuple day_name = _localized_day('%A') |
Definition at line 69 of file calendar.py.
int EPOCH = 1970 |
Definition at line 231 of file calendar.py.
error = ValueError |
Definition at line 20 of file calendar.py.
int February = 2 |
Definition at line 24 of file calendar.py.
int January = 1 |
Definition at line 23 of file calendar.py.
list mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |
Definition at line 27 of file calendar.py.
tuple month_abbr = _localized_month('%b') |
Definition at line 74 of file calendar.py.
tuple month_name = _localized_month('%B') |
Definition at line 73 of file calendar.py.