Package lib
[hide private]
[frames] | no frames]

Package lib

source code

Submodules [hide private]
  • lib.geom: general-purpose geometry routines
  • lib.holiday: holiday support routines
  • lib.plugin: plugin handling routines
  • lib.xcairo: general-purpose drawing routines & higher-level CAIRO routines

Classes [hide private]
  Abort
Functions [hide private]
([str,...],[str,...])
extract_parser_args(arglist, parser, pos=-1)
extract options belonging to parser along with pos positional arguments
source code
int
atoi(s, lower_bound=None, upper_bound=None, prefix='')
convert string to integer, exiting on error (for cmdline parsing)
source code
int
_parse_month(mstr)
get a month value (0-12) from mstr, exiting on error (for cmdline parsing)
source code
(int,int)
parse_month_range(s)
return (Month,Span) by parsing range Month, Month1-Month2 or Month:Span
source code
int
parse_year(ystr)
get a year value (>=0) from ystr, exiting on error (for cmdline parsing)
source code
Variables [hide private]
  _version = '0.4.1'
  _copyright = 'Copyright (C) 2012-2014 George M. Tzoumas\nLicen...
  __package__ = 'lib'
Function Details [hide private]

extract_parser_args(arglist, parser, pos=-1)

source code 

extract options belonging to parser along with pos positional arguments

Parameters:
  • arglist - argument list to extract
  • parser - parser object to be used for extracting
  • pos - number of positional options to be extracted

    if pos<0 then all positional arguments are extracted, otherwise, only pos arguments are extracted. arglist[0] (usually sys.argv[0]) is also positional argument!

Returns: ([str,...],[str,...])
tuple (argv1,argv2) with extracted argument list and remaining argument list

atoi(s, lower_bound=None, upper_bound=None, prefix='')

source code 

convert string to integer, exiting on error (for cmdline parsing)

Parameters:
  • lower_bound - perform additional check so that value >= lower_bound
  • upper_bound - perform additional check so that value <= upper_bound
  • prefix - output prefix for error reporting
Returns: int

Variables Details [hide private]

_copyright

Value:
'''Copyright (C) 2012-2014 George M. Tzoumas
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gp\
l.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.'''