whitespace fix

This commit is contained in:
George Tzoumas 2015-12-27 13:38:01 +01:00
parent 282e4422b4
commit 6e256a74cd
2 changed files with 10 additions and 3 deletions

View File

@ -53,6 +53,8 @@ import lib.holiday as holiday
import lib
from lib.plugin import *
# TODO: SEE IF IT CAN BE MOVED INTO lib.plugin ...
def import_plugin(plugin_paths, cat, longcat, longcat2, listopt, preset):
"""import a plugin making it visible
@ -124,6 +126,7 @@ and do some magic with ImageMagick! ;)
"""
def add_list_option(parser, opt):
"""add a --list-I{plugins} option to parser
@ -132,6 +135,7 @@ def add_list_option(parser, opt):
parser.add_option("--list-%s" % opt, action="store_true", dest="list_%s" % opt, default=False,
help="list available %s" % opt)
def get_parser():
"""get the argument parser object
@ -185,6 +189,7 @@ def get_parser():
help="modify a geometry variable")
return parser
def main_program():
parser = get_parser()
@ -297,6 +302,7 @@ def main_program():
(Style,Geometry,Language), hprovider, lib._version, loptions)
renderer.render()
if __name__ == "__main__":
try:
main_program()

View File

@ -290,15 +290,16 @@ class CalendarRenderer(object):
self._draw_month(page.cr, grid.item_seq(k, self.options.grid_order == "column"),
month=m, year=y)
num_placed += 1
if (y > yy[-1]): yy.append(y)
if y > yy[-1]:
yy.append(y)
if not self.options.month_with_year and not self.options.no_footer:
year_str = str(yy[0]) if yy[0] == yy[-1] else "%s %s" % (yy[0],yy[-1])
draw_str(page.cr, text = year_str, rect = Rc, stroke_rgba = (0,0,0,0.5), scaling = -1,
align = (0,0), font = (extract_font_name(S.month.font),0,0))
if not self.options.no_footer:
draw_str(page.cr, text = "rendered by Callirhoe ver. %s" % self.version_string,
rect = Rc, stroke_rgba = (0,0,0,0.5), scaling = -1, align = (1,0),
font = (extract_font_name(S.month.font),1,0))
rect=Rc, stroke_rgba=(0, 0, 0, 0.5), scaling=-1, align=(1, 0),
font=(extract_font_name(S.month.font), 1, 0))
num_pages_written += 1
page.end_page()
if num_pages_written < num_pages: