pythonreports-checkins Mailing List for PythonReports (Page 4)
Brought to you by:
a1s
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(45) |
Dec
(56) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(10) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
(18) |
Jun
(6) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: alexander s. <a1...@us...> - 2007-06-24 13:04:54
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27597 Modified Files: design.py Log Message: update window title after save (filename may change) Index: design.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/design.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** design.py 8 Dec 2006 15:29:07 -0000 1.17 --- design.py 24 Jun 2007 13:04:21 -0000 1.18 *************** *** 5,8 **** --- 5,9 ---- """PythonReports Template Designer""" """History (most recent first): + 24-jun-2007 [als] update window title after save (filename may change) 08-dec-2006 [als] invalidate .current_node when new file is loaded; ditto, when selected node is being deleted; *************** *** 1667,1670 **** --- 1668,1672 ---- self.filedir = os.path.dirname(os.path.abspath(filename)) self.loaded_text = str(self.report) + self.updateTitle() return True |
From: alexander s. <a1...@us...> - 2007-06-23 16:16:53
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18472 Modified Files: datatypes.py Log Message: fix Validator.writexml: since we encode the attributes don't convert output data back to unicode (that would fail) and don't require unicode-aware writer Index: datatypes.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/datatypes.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** datatypes.py 8 Dec 2006 12:52:06 -0000 1.5 --- datatypes.py 23 Jun 2007 16:16:46 -0000 1.6 *************** *** 1,4 **** --- 1,7 ---- """Data types and element primitives, common for templates and printouts""" """History: + 23-jun-2007 [als] fix Validator.writexml: since we encode the attributes, + don't convert output data back to unicode (that would + fail) and don't require unicode-aware writer 07-dec-2006 [als] fix: qp-encoded data was accumulating spaces at the end 07-dec-2006 [als] fix decoding of qp-encoded data *************** *** 1007,1012 **** Parameters: ! writer: file-like object with "write" method ! able to accept unicode strings element: tree element of type handled by this validator encoding: character set name --- 1010,1014 ---- Parameters: ! writer: file-like output object element: tree element of type handled by this validator encoding: character set name *************** *** 1028,1038 **** _child_elements.append((_child, _validator)) if _child_elements: ! writer.write(u"%s<%s>%s" % (indent, _starttag, newl)) for (_child, _validator) in _child_elements: _validator.writexml(writer, _child, encoding, indent + addindent, addindent, newl) ! writer.write(u"%s</%s>%s" % (indent, self.tag, newl)) else: ! writer.write(u"%s<%s />%s" % (indent, _starttag, newl)) class _DataBlock(Validator): --- 1030,1040 ---- _child_elements.append((_child, _validator)) if _child_elements: ! writer.write("%s<%s>%s" % (indent, _starttag, newl)) for (_child, _validator) in _child_elements: _validator.writexml(writer, _child, encoding, indent + addindent, addindent, newl) ! writer.write("%s</%s>%s" % (indent, self.tag, newl)) else: ! writer.write("%s<%s />%s" % (indent, _starttag, newl)) class _DataBlock(Validator): |
From: Oleg B. <ph...@us...> - 2007-05-07 16:12:52
|
Update of /cvsroot/pythonreports/PythonReports/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20735 Modified Files: prt.txt Log Message: "default" is a required attribute for "parameter", it cannot be omitted. Index: prt.txt =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/doc/prt.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** prt.txt 19 Dec 2006 13:21:49 -0000 1.6 --- prt.txt 7 May 2007 16:12:50 -0000 1.7 *************** *** 228,232 **** ``name`` M string Variable name. ``default`` M expr Default value. - Empty string if omitted. ``prompt`` O boolean If set to ``yes``, report builder will prompt for parameter value. --- 228,231 ---- |
From: alexander s. <a1...@us...> - 2007-02-25 05:43:47
|
Update of /cvsroot/pythonreports/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1174 Added Files: py.ico Log Message: link icon --- NEW FILE: py.ico --- (This appears to be a binary file; contents omitted.) |
From: alexander s. <a1...@us...> - 2007-02-25 05:43:32
|
Update of /cvsroot/pythonreports/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1141 Added Files: python-powered-w-125x40.png Log Message: "Python Powered" logo padded with transparency to match the width of sf.net logo --- NEW FILE: python-powered-w-125x40.png --- (This appears to be a binary file; contents omitted.) |
From: alexander s. <a1...@us...> - 2006-12-19 16:55:49
|
Update of /cvsroot/pythonreports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20934 Modified Files: CHANGES Log Message: version 0.3.0 Index: CHANGES =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/CHANGES,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CHANGES 9 Nov 2006 08:44:19 -0000 1.4 --- CHANGES 19 Dec 2006 16:55:47 -0000 1.5 *************** *** 2,5 **** --- 2,38 ---- ============================= + version 0.3.0 (19-dec-2006) + --------------------------- + + Features: + + - subreports + - edit data block contents in template designer + - designer can write printout files + + API changes: + + - removed "transparent" attribute of template element "box": + boxes don't paint background by themselves. If you need + an opaque box, draw a filled rectangle before other elements. + - added optional attribute "opaque" for template element "rectangle" + - group header an footer sections renamed to "title" and "summary" + (they behave quite unlike page/column headers and footers) + - "type" attribute for "eject" element is optional; defaults to "page" + + Fixes: + + - eliminated some errors and warnings reported by pylint + - designer didn't update box attributes + - insert menu in designer sometimes failed to open + - pdf output: diagonal lines were offset down by the box height + - qp-encoded data not decoded on read + - qp-encoded data absorbing white space added by XML formatting + - errors in designer after element deletion + - RL-based text drivers failed when a text was too long for it's box + - italic font creation failed in Tk-based text drivers + - template validation: require page dimensions (pagesize or width and height) + - allow empty detail section + version 0.2.1 (09-nov-2006) --------------------------- |
From: alexander s. <a1...@us...> - 2006-12-19 16:52:22
|
Update of /cvsroot/pythonreports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19868 Modified Files: MANIFEST.in Log Message: include all test templates Index: MANIFEST.in =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/MANIFEST.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MANIFEST.in 6 Dec 2006 15:48:05 -0000 1.3 --- MANIFEST.in 19 Dec 2006 16:52:17 -0000 1.4 *************** *** 4,6 **** include scripts/prd scripts/*.bat include doc/*.txt doc/*.html doc/default.css doc/Makefile ! include test/*.py test/sakila.prt --- 4,6 ---- include scripts/prd scripts/*.bat include doc/*.txt doc/*.html doc/default.css doc/Makefile ! include test/*.py test/*.prt |
From: alexander s. <a1...@us...> - 2006-12-19 16:51:13
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19468 Modified Files: version.py Log Message: version 0.3.0 Index: version.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/version.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** version.py 6 Dec 2006 17:04:06 -0000 1.4 --- version.py 19 Dec 2006 16:51:11 -0000 1.5 *************** *** 7,12 **** # wouldn't datetime.date object be better? ! __version__ = "0.2.1" ! __date__ = "2006-11-09" __all__ = ["__version__", "__date__"] --- 7,12 ---- # wouldn't datetime.date object be better? ! __version__ = "0.3.0" ! __date__ = "2006-12-19" __all__ = ["__version__", "__date__"] |
From: alexander s. <a1...@us...> - 2006-12-19 16:45:33
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17127 Modified Files: builder.py Log Message: straighten "if not/else" logic in Builder.run_subreport(); build_section: refetch context after subreports build Index: builder.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/builder.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** builder.py 19 Dec 2006 14:08:49 -0000 1.7 --- builder.py 19 Dec 2006 16:45:30 -0000 1.8 *************** *** 2,5 **** --- 2,7 ---- # FIXME: column-based variables are not intelligible """History (most recent first): + 19-dec-2006 [als] straighten "if not/else" logic in Builder.run_subreport(); + build_section: refetch context after subreports build 18-dec-2006 [als] Builder: added .get_page_dimensions(); update self.context before building the detail section *************** *** 1631,1635 **** _inline = element.get("inline") # fetch or make a builder ! if element not in self.subreports: _prt_name = element.get("template") _prt = prt.load(self.filepath(_prt_name)) --- 1633,1639 ---- _inline = element.get("inline") # fetch or make a builder ! if element in self.subreports: ! _builder = self.subreports[element] ! else: _prt_name = element.get("template") _prt = prt.load(self.filepath(_prt_name)) *************** *** 1670,1675 **** _builder.inlined = None self.subreports[element] = _builder - else: - _builder = self.subreports[element] # collect subreport arguments # Note: this is done before any new section is built --- 1674,1677 ---- *************** *** 1777,1780 **** --- 1779,1784 ---- self.run_subreport_collection(_section.subreports_before, _frame) # reevaluate the section + # NB: this discards the context passed in arguments + _context = self.context _section.build(_context) if not _section.printable: |
From: alexander s. <a1...@us...> - 2006-12-19 14:45:08
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3000 Modified Files: template.py Log Message: fix: Arg value is expression Index: template.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/template.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** template.py 19 Dec 2006 13:32:29 -0000 1.8 --- template.py 19 Dec 2006 14:44:56 -0000 1.9 *************** *** 1,4 **** --- 1,5 ---- """PythonReports Template (PRT) structures""" """History (most recent first): + 19-dec-2006 [als] fix: Arg value is expression 15-dec-2006 [als] added Arg and Subreport 15-dec-2006 [als] Eject type defaults to "page" *************** *** 126,130 **** attributes={ "name": (String, REQUIRED), ! "value": (String, REQUIRED), }, doc="Actual argument value passed to subreport to fill a parameter slot" --- 127,131 ---- attributes={ "name": (String, REQUIRED), ! "value": (Expression, REQUIRED), }, doc="Actual argument value passed to subreport to fill a parameter slot" |
From: alexander s. <a1...@us...> - 2006-12-19 14:08:51
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22142 Modified Files: builder.py Log Message: build subreports; Builder: added .get_page_dimensions() and .set_page_position(); update self.context before building the detail section Index: builder.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/builder.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** builder.py 15 Dec 2006 08:32:44 -0000 1.6 --- builder.py 19 Dec 2006 14:08:49 -0000 1.7 *************** *** 2,5 **** --- 2,9 ---- # FIXME: column-based variables are not intelligible """History (most recent first): + 18-dec-2006 [als] Builder: added .get_page_dimensions(); + update self.context before building the detail section + 15-dec-2006 [als] build subreports; + added .set_page_position() 15-dec-2006 [als] group header an footer renamed to title and summary 07-dec-2006 [als] support rectangle opacity *************** *** 68,71 **** --- 72,76 ---- import os import time + from warnings import warn from PythonReports import barcode, drivers *************** *** 320,335 **** for _name in self.__slots__])) - # def freeze(self): - # """Remember current values of all report variables - # - # Evaluate all report variables and put their current - # values to the system variables container so that - # further access to variable names always returns - # frozen values. - # - # """ - # for (_name, _var) in self.variables: - # self.sysvars[_name] = _var.value - def add_variables(self, *variables): """Add report variable definitions --- 325,328 ---- *************** *** 439,442 **** --- 432,436 ---- self.box = self.tbox = Box.from_element(template.find("box")) self.resizeable = False + self.subreports_before = self.subreports_after = () # filled by .build if context: self.build(context) *************** *** 588,592 **** --- 582,592 ---- _default_element_style = [self.compose_style(context, ("font", "color", "bgcolor"), self.iter_styles())] + _subreports = [] for _item in _elements: + if _item.tag == "subreport": + _when = _item.get("when") + if (not _when) or context.eval(_when): + _subreports.append((_item.get("seq"), _item)) + continue # ignore children that are not known body elements if _item.tag not in ( *************** *** 619,622 **** --- 619,627 ---- _element.image.use_count += 1 self.append(_element) + _subreports.sort() + self.subreports_before = tuple(_item[1] for _item in _subreports + if _item[0] < 0) + self.subreports_after = tuple(_item[1] for _item in _subreports + if _item[0] > 0) def build_barcode(self, element): *************** *** 989,992 **** --- 994,999 ---- # parent elements for report sections layout_parents = {} + # set to parent builder for inline subreport build + inlined = None def __init__(self, template, data=(), parameters=None, *************** *** 1031,1034 **** --- 1038,1043 ---- self.variables = [Variable(_item) for _item in self.template.variables.itervalues()] + # subreport builders + self.subreports = {} # text rendering drivers, will be re-evaluated in .run() self.text_drivers = {} *************** *** 1150,1159 **** # page frame, used for page header/footer and swapped title/summary _page_frame = Frame() ! _pagesize = _layout.get("pagesize") ! if _pagesize: ! (_page_frame.width, _page_frame.bottom) = _pagesize.dimensions ! else: ! _page_frame.width = _layout.get("width") ! _page_frame.bottom = _layout.get("height") _page_frame.width -= _layout.get("leftmargin") \ + _layout.get("rightmargin") --- 1159,1164 ---- # page frame, used for page header/footer and swapped title/summary _page_frame = Frame() ! (_page_frame.width, _page_frame.bottom) = \ ! self.get_page_dimensions(self.template) _page_frame.width -= _layout.get("leftmargin") \ + _layout.get("rightmargin") *************** *** 1259,1268 **** else: _callback = self.callback - # initialize fonts - moved from __init__() to allow backend switching - self.text_drivers = dict([(_name, self.text_driver_factory(_font)) - for (_name, _font) in self.template.fonts.iteritems()]) _data_iter = self.start(data, parameters) ! if _callback: ! _callback() self.fill_title() # first item was already popped out of _data_iter --- 1264,1284 ---- else: _callback = self.callback _data_iter = self.start(data, parameters) ! self._build(_data_iter, _callback) ! #print "built in %.2fs" % (time.time() - _start_time) ! return self.build_printout() ! ! def _build(self, data, callback=None): ! """Build output page structures ! ! Parameters: ! data: data sequence iterator. Normally, the first item ! is already popped from this iterator to current context ! when this method is called. ! callback: a callable to be called for each data item. ! ! """ ! if callback: ! callback() self.fill_title() # first item was already popped out of _data_iter *************** *** 1271,1278 **** self.fill_detail() # process remaining items ! for _item in _data_iter: self.next_item(_item) ! if _callback: ! _callback() self.fill_detail() # fill_summary will close all report groups. --- 1287,1294 ---- self.fill_detail() # process remaining items ! for _item in data: self.next_item(_item) ! if callback: ! callback() self.fill_detail() # fill_summary will close all report groups. *************** *** 1284,1289 **** # resolve all deferred evaluations self.resolve_eval(*self.eval_later.keys()) - #print "built in %.2fs" % (time.time() - _start_time) - return self.build_printout() def start(self, data=NOTHING, parameters=None): --- 1300,1303 ---- *************** *** 1304,1307 **** --- 1318,1324 ---- """ _template = self.template + # initialize fonts - moved from __init__() to allow backend switching + self.text_drivers = dict([(_name, self.text_driver_factory(_font)) + for (_name, _font) in _template.fonts.iteritems()]) # create data iterator and get the first object, if any if data is NOTHING: *************** *** 1402,1406 **** _layout = self.template.find("layout") _layout_title = _layout.find("title") ! _layout_header = _layout.find("header") if _layout_title: if _layout_title.get("swapheader"): --- 1419,1427 ---- _layout = self.template.find("layout") _layout_title = _layout.find("title") ! if self.inlined: ! # no page header at start ! _layout_header = None ! else: ! _layout_header = _layout.find("header") if _layout_title: if _layout_title.get("swapheader"): *************** *** 1433,1437 **** _template = self.detail self.check_eject(_template) ! # create new temporary context with incremented *_COUNT values _new_context = self.context.copy() for _name in _new_context.sysvars: --- 1454,1458 ---- _template = self.detail self.check_eject(_template) ! # create new context with incremented *_COUNT values _new_context = self.context.copy() for _name in _new_context.sysvars: *************** *** 1443,1454 **** if _var.iter == "detail": _var.iterate(_new_context) # build the section ! _section = self.build_section(_template, _new_context) if _section: ! # commit context changes and place the section ! self.context = _new_context self.add_section(_section) else: # the section is not printed - undo context changes for _var in self.variables: if _var.reset == "detail": --- 1464,1479 ---- if _var.iter == "detail": _var.iterate(_new_context) + # apply new context. + # keep current context for a while for possible rollback + _current_context = self.context + self.context = _new_context # build the section ! _section = self.build_section(_template) if _section: ! # place the section self.add_section(_section) else: # the section is not printed - undo context changes + self.context = _current_context for _var in self.variables: if _var.reset == "detail": *************** *** 1475,1482 **** self.cur_y = _max_y _summary = _layout.find("summary") if _summary: self.check_eject(_summary) ! if _summary.get("swapfooter"): ! _footer = self.build_section(_layout.find("footer")) # reposition at current y _footer.refill(self.cur_y) --- 1500,1512 ---- self.cur_y = _max_y _summary = _layout.find("summary") + if self.inlined: + # no terminating page footer + _footer = None + else: + _footer = _layout.find("footer") if _summary: self.check_eject(_summary) ! if _summary.get("swapfooter") and (_footer is not None): ! _footer = self.build_section(_footer) # reposition at current y _footer.refill(self.cur_y) *************** *** 1485,1491 **** else: self.add_section(self.build_section(_summary)) ! self.add_section(self.build_section(_layout.find("footer"))) ! else: ! self.add_section(self.build_section(_layout.find("footer"))) def start_page(self): --- 1515,1522 ---- else: self.add_section(self.build_section(_summary)) ! if _footer is not None: ! self.add_section(self.build_section(_footer)) ! elif _footer is not None: ! self.add_section(self.build_section(_footer)) def start_page(self): *************** *** 1560,1563 **** --- 1591,1738 ---- self.resolve_eval(("group", group.get("name"))) + def set_page_position(self, ypos): + """Set current y position on the output page + + Parameters: + ypos: new position in points. + + All output frames are adjusted to start output below given position. + + """ + self.cur_y = ypos + _frame = self.section_frames[None].child + while _frame: + _frame.top = ypos + _frame = _frame.child + + def run_subreport(self, element, eject_frame): + """Execute a subreport element + + Parameters: + element: template element for subreport to run + eject_frame: if running of a non-inlined subreport + must terminate current page in the master report, + this is output frame for current report section. + If current page was already ejected, eject_frame is None. + + Return value: if this run did page eject in the main report, + return None. Otherwise return the value of eject_frame argument. + + """ + _context = self.context + # return early if subreport is skipped + _when = element.get("when") + if _when and not _context.eval(_when): + return + # return early if there are no data items for the subreport + _data = _context.eval(element.get("data")) + if len(_data) < 1: + return + _inline = element.get("inline") + # fetch or make a builder + if element not in self.subreports: + _prt_name = element.get("template") + _prt = prt.load(self.filepath(_prt_name)) + if _inline: + # inlined report must have same page dimensions as this report + _pgsize = self.get_page_dimensions(self.template) + if self.get_page_dimensions(_prt) != _pgsize: + raise XmlValidationError( + "Page size does not match for inlined report \"%s\"" + % _prt_name, element=element) + # replace page header and footer + # actual rendering will be done by this builder, + # but subreport builder will need to know sizes + # to shrink page contents frame appropriately. + _page_frame = self.section_frames[None] + _layout = _prt.find("layout") + assert _layout is not None # _prt is verified + _section = _layout.find("header") + if _section: + warn("Replacing non-empty page header" + " for inlined report \"%s\"" % _prt_name) + _layout.remove(_section) + if _page_frame.header is not None: + _layout.append(_page_frame.header) + _section = _layout.find("footer") + if _section: + warn("Replacing non-empty page footer" + " for inlined report \"%s\"" % _prt_name) + _layout.remove(_section) + if _page_frame.footer is not None: + _layout.append(_page_frame.footer) + # create subreport builder + _builder = Builder(_prt) + # let it delegate page header/footer formatting to self + _builder.inlined = self + else: + _builder = Builder(_prt) + _builder.inlined = None + self.subreports[element] = _builder + else: + _builder = self.subreports[element] + # collect subreport arguments + # Note: this is done before any new section is built + # to make sure current build context is not changed and + # our local short-cut (_context variable) is still valid. + _args = {} + for _item in element.findall("arg"): + _args[_item.get("name")] = _context.eval(_item.get("value")) + # check if we need to eject page + if _inline or (eject_frame is None): + _rv = eject_frame + else: + # print all footers, end current page + _eject_frames = self._get_eject_frames(eject_frame, True) + for _frame in _eject_frames: + self.add_section(self.build_section(_frame.footer)) + self.resolve_eval("page", "column") + # reset output value + _rv = None + # advance page number if it will be + # run the subreport + _data_iter = _builder.start(_data, _args) + if _inline: + _builder.context["PAGE_NUMBER"] = self.context["PAGE_NUMBER"] + _builder.set_page_position(self.cur_y) + elif not element.get("ownpageno"): + _builder.context["PAGE_NUMBER"] = self.context["PAGE_NUMBER"] + 1 + _builder._build(_data_iter) + if _inline: + self.context["PAGE_NUMBER"] = _builder.context["PAGE_NUMBER"] + self.set_page_position(_builder.cur_y) + self.page.extend(_builder.pages[0]) + self.pages.extend(_builder.pages[1:]) + self.page = self.pages[-1] + else: + if not element.get("ownpageno"): + # will be incremented by .start_page() + self.context["PAGE_NUMBER"] = _builder.context["PAGE_NUMBER"] + if self.pages[-1] == []: + del self.pages[-1] + self.pages.extend(_builder.pages) + return _rv + + def run_subreport_collection(self, subreports, current_frame): + """Run a set of subreports for a report section + + Parameters: + subreports: a sequence of subreport elements to run + current_frame: layout frame for current output section + + """ + _frame = current_frame + for _item in subreports: + _frame = self.run_subreport(_item, _frame) + if _frame is None: + # current page was ejected by subreport + self.start_page() + _eject_frames = self._get_eject_frames(current_frame, True) + # headers go in reverse order + _eject_frames.reverse() + # print all headers + for _frame in _eject_frames: + self.add_section(self.build_section(_frame.header)) + def build_section(self, template, context=None): """Build, fill and return Section object *************** *** 1571,1574 **** --- 1746,1753 ---- is not printable (suppressed by printwhen expression). + If the section is printable, subreports set to print + before the section contents are run prior to building + the section. + """ if template is None: *************** *** 1578,1581 **** --- 1757,1772 ---- else: _context = context + # if this report is inlined, page header and footer + # are built by the main report builder + _builder = self.inlined + if _builder: + _frame = self.section_frames[None] # page frame + if template in (_frame.header, _frame.footer): + _builder.context["PAGE_NUMBER"] = _context["PAGE_NUMBER"] + _builder.set_page_position(self.cur_y) + _rv = _builder.build_section(template) + self.set_page_position(_builder.cur_y) + # page number should not change + return _rv _frame = self.section_frames[template] _context["COLUMN_NUMBER"] = _frame.column + 1 *************** *** 1583,1586 **** --- 1774,1784 ---- if not _section.printable: return None + if _section.subreports_before: + self.run_subreport_collection(_section.subreports_before, _frame) + # reevaluate the section + _section.build(_context) + if not _section.printable: + # oops! + return None _section.fill(_frame.x, self.cur_y, _frame.width, _frame.bottom) # align page footers to the bottom of page *************** *** 1598,1602 **** def add_section(self, section): ! """Add a filled section to current page Parameters: --- 1796,1800 ---- def add_section(self, section): ! """Add a filled section to current page, run trailing subreports Parameters: *************** *** 1637,1640 **** --- 1835,1841 ---- _frame.top = self.cur_y _frame = _frame.child + if section.subreports_after: + self.run_subreport_collection(section.subreports_after, + self.section_frames[section.template]) def check_eject(self, section, ignoresize=False): *************** *** 1671,1681 **** self.eject(_current_frame, _eject=="page") ! def eject(self, current_frame, newpage=False): ! """Eject page or column Parameters: current_frame: frame for a section that caused eject ! newpage: if True, eject page. ! Otherwise eject column (default). """ --- 1872,1886 ---- self.eject(_current_frame, _eject=="page") ! def _get_eject_frames(self, current_frame, newpage): ! """Return a list of frames affected by eject Parameters: current_frame: frame for a section that caused eject ! newpage: if True, eject page, otherwise eject column. ! ! Return value: list containing all frames that should have ! their headers/footers printed by requested eject type. ! The list starts with current_frame and contains it's parents ! ending with a column or page frame. """ *************** *** 1700,1703 **** --- 1905,1922 ---- break _frame = _frame.parent + return _eject_frames + + def eject(self, current_frame, newpage=False): + """Eject page or column + + Parameters: + current_frame: frame for a section that caused eject + newpage: if True, eject page. + Otherwise eject column (default). + + """ + # build a list of all frames that will have their + # headers/footers printed by this eject + _eject_frames = self._get_eject_frames(current_frame, newpage) # print all footers for _frame in _eject_frames: *************** *** 1776,1779 **** --- 1995,2017 ---- _section.refill() + @staticmethod + def get_page_dimensions(template): + """Return (width, height) for output page + + Parameters: + template: verified report template tree. + + """ + _layout = template.find("layout") + _pagesize = _layout.get("pagesize") + if _pagesize: + (_width, _height) = _pagesize.dimensions + else: + _width = _layout.get("width") + _height = _layout.get("height") + if _layout.get("landscape"): + (_width, _height) = (_height, _width) + return (_width, _height) + def build_printout(self): """Create and return Printout object for built report""" *************** *** 1815,1825 **** _page_attrs = dict([(_name, _layout.get(_name)) for _name in ("leftmargin", "topmargin", "rightmargin", "bottommargin")]) ! _pagesize = _layout.get("pagesize") ! if _pagesize: ! (_page_attrs["width"], _page_attrs["height"]) = \ ! _pagesize.dimensions ! else: ! _page_attrs["width"] = _layout.get("width") ! _page_attrs["height"] = _layout.get("height") for _page in self.pages: _prt_page = SubElement(_root, prp.Page.tag, _page_attrs) --- 2053,2058 ---- _page_attrs = dict([(_name, _layout.get(_name)) for _name in ("leftmargin", "topmargin", "rightmargin", "bottommargin")]) ! (_page_attrs["width"], _page_attrs["height"]) = \ ! self.get_page_dimensions(_template) for _page in self.pages: _prt_page = SubElement(_root, prp.Page.tag, _page_attrs) |
From: alexander s. <a1...@us...> - 2006-12-19 13:32:30
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9039 Modified Files: template.py Log Message: added Arg and Subreport Index: template.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/template.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** template.py 15 Dec 2006 13:24:48 -0000 1.7 --- template.py 19 Dec 2006 13:32:29 -0000 1.8 *************** *** 1,4 **** --- 1,5 ---- """PythonReports Template (PRT) structures""" """History (most recent first): + 15-dec-2006 [als] added Arg and Subreport 15-dec-2006 [als] Eject type defaults to "page" 15-dec-2006 [als] allow empty detail section; *************** *** 122,125 **** --- 123,150 ---- ) + Arg = Validator(tag="arg", + attributes={ + "name": (String, REQUIRED), + "value": (String, REQUIRED), + }, + doc="Actual argument value passed to subreport to fill a parameter slot" + ) + + # TODO subreport validation: + # - cannot be placed in a column + # - if inline is True, ownpageno must be False. + Subreport = Validator(tag="subreport", + attributes={ + "template": (String, REQUIRED), + "seq": (Integer, REQUIRED), + "data": (Expression, REQUIRED), + "when": (Expression, None), + "inline": (Boolean, False), + "ownpageno": (Boolean, False), + }, children=( + (Arg, Validator.UNRESTRICTED), + ), doc="Sets an embedded report to run on an inner data sequence" + ) + Field = Validator(tag="field", attributes={ *************** *** 217,220 **** --- 242,246 ---- # common set of child validators for all section elements _section_children = ( + (Subreport, Validator.UNRESTRICTED), (Box, Validator.ZERO_OR_ONE), (Style, Validator.UNRESTRICTED), *************** *** 307,311 **** Page size may be specified either with the "pagesize" attribute ! of with a pair of "width" and "height". If neither is set, it's an error. """ --- 333,337 ---- Page size may be specified either with the "pagesize" attribute ! or with a pair of "width" and "height". If neither is set, it's an error. """ |
From: alexander s. <a1...@us...> - 2006-12-19 13:28:21
|
Update of /cvsroot/pythonreports/PythonReports/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7505 Modified Files: .cvsignore Log Message: ignore all printout files Index: .cvsignore =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/test/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 1 Nov 2006 11:17:59 -0000 1.1 --- .cvsignore 19 Dec 2006 13:28:19 -0000 1.2 *************** *** 6,10 **** *.pyc *.pyo sakila.dat - sakila.prp - sakila.pdf --- 6,10 ---- *.pyc *.pyo + *.prp + *.pdf sakila.dat |
From: alexander s. <a1...@us...> - 2006-12-19 13:25:09
|
Update of /cvsroot/pythonreports/PythonReports/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6392 Added Files: test_subreport.py Log Message: Test building of subreports --- NEW FILE: test_subreport.py --- #! /usr/bin/env python """Test building of subreports""" """History (most recent first): 15-dec-2006 [als] created """ __version__ = "$Revision: 1.1 $"[11:-2] __date__ = "$Date: 2006/12/19 13:25:08 $"[7:-2] import sys from PythonReports.builder import Builder def run(): # make some dummy data _data = [{ "item": _ii, "sub": [{"item": _jj} for _jj in xrange(_ii * 10, _ii * 10 + 10)] } for _ii in xrange(10)] # create report builder _builder = Builder("submain.prt") # build printout _printout = _builder.run(_data) # write printout file _out = file("submain.prp", "w") _printout.write(_out) _out.close() if __name__ == "__main__": run() # vim: set et sts=4 sw=4 : |
From: alexander s. <a1...@us...> - 2006-12-19 13:23:52
|
Update of /cvsroot/pythonreports/PythonReports/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5756 Added Files: subsub.prt Log Message: subreport template for test_subreport --- NEW FILE: subsub.prt --- <!-- subreport template for test_subreport --> <report> <font name="body" size="14" typeface="Arial" /> <layout pagesize="A4"> <style color="#000000" font="body" /> <header> <line pen="1"> <box x="5" y="5" height="0" width="-5"/> </line> </header> <footer> <box height="20" /> <field expr="PAGE_NUMBER" align="right" format="%i /"> <box x="5.5cm" width="3cm" /> </field> <field expr="PAGE_NUMBER" evaltime="report" align="left"> <box x="8.6cm" width="3cm" /> </field> </footer> <detail> <field stretch="true"> <data>sub-item</data> <box x="15" /> </field> <field expr="item" stretch="true"> <box x="80" /> </field> </detail> </layout> </report> <!-- vim: set et ft=xml sw=1 : --> |
From: alexander s. <a1...@us...> - 2006-12-19 13:22:35
|
Update of /cvsroot/pythonreports/PythonReports/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5388 Added Files: submain.prt Log Message: master template for test_subreport --- NEW FILE: submain.prt --- <!-- master template for test_subreport --> <report> <font name="body" size="16" typeface="Arial" /> <layout pagesize="A4"> <style color="#000000" font="body" /> <header> <rectangle pen="1"> <box height="5" x="5" y="5" width="-5"/> </rectangle> </header> <footer> <box height="20" /> <field expr="PAGE_NUMBER" align="right" format="%i /"> <box x="5.5cm" width="3cm" /> </field> <field expr="PAGE_NUMBER" evaltime="report" align="left"> <box x="8.6cm" width="3cm" /> </field> </footer> <detail> <subreport seq="-2" template="subsub.prt" data="sub" inline="yes" when="REPORT_COUNT % 2" /> <subreport seq="10" template="subsub.prt" data="sub" when="(REPORT_COUNT % 5) == 0" /> <subreport seq="10" template="subsub.prt" data="sub" when="(REPORT_COUNT % 5) == 1" ownpageno="true" /> <field stretch="true"> <data>item</data> <box x="7" /> </field> <field expr="item" stretch="true"> <box x="50" /> </field> </detail> </layout> </report> <!-- vim: set et ft=xml sw=1 : --> |
From: alexander s. <a1...@us...> - 2006-12-19 13:21:56
|
Update of /cvsroot/pythonreports/PythonReports/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5022 Modified Files: prt.txt Log Message: "type" attribute for "eject" element defaults to "page"; added subreports Index: prt.txt =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/doc/prt.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** prt.txt 15 Dec 2006 08:26:35 -0000 1.5 --- prt.txt 19 Dec 2006 13:21:49 -0000 1.6 *************** *** 63,66 **** --- 63,69 ---- in the template sequence are laid out on top of previous elements. + All `section elements`_ may contain arbitrary number of `subreport`_ + elements. + All `body elements`_ must contain one `box`_ element and may contain a sequence of `style`_ elements. *************** *** 452,456 **** Name Req Type Description ================= ===== ========= ====================================== ! ``type`` M string ``page`` or ``column``. ``require`` O dimension Required vertical space on current page or column. If there is enough --- 455,460 ---- Name Req Type Description ================= ===== ========= ====================================== ! ``type`` O string ``page`` or ``column``. ! Default: ``page``. ``require`` O dimension Required vertical space on current page or column. If there is enough *************** *** 462,465 **** --- 466,543 ---- ================= ===== ========= ====================================== + ``arg`` + ------- + + Actual argument value passed to `subreport`_ to fill a `parameter`_ slot. + + Attributes: + + ================= ===== ========= ====================================== + Name Req Type Description + ================= ===== ========= ====================================== + ``name`` M string Parameter name. + ``value`` M expr Parameter value. + ================= ===== ========= ====================================== + + ``subreport`` + ------------- + + Sets an embedded report to run on an inner data sequence. + + For example, imagine you have a team of successful encyclopaedia + salesmans each selling a really fine set of modern encyclopaedias. + Common way to make a report on encyclopedia sales in RDBMS world + would be to run the report on the list of all sold encyclopedias + and use report groups to print name and total earnings for each + salesman. Subreports allow you to do it the other way round - + pass a sequence of salesmans to main report template and then run + an encyclopedia subreport for each detail section of the main report. + It could be especially useful if some of the team members work in + a different ways - say, sell something to break the ice at parties - + and thus require a totally different layout for their parts. + + `subreport`_ element may contain a set of `arg`_ elements. + + Subreports must not be placed inside columns. + + ================= ===== ========= ====================================== + Name Req Type Description + ================= ===== ========= ====================================== + ``template`` M string Name of the template file. + ``seq`` M integer Subreport sequence indicator. + Subreports for a section will be run + in the order of ``seq`` numbers. + Subreports with negative ``seq`` + values are printed before the section + contents, ones with positive ``seq`` + values - after section contents. + Zero value is reserved and should + not be used. + + ``seq`` values for subreports of the + same section are not required to be + successive. + ``data`` M expr Data sequence for the subreport. + ``when`` O expr If this expression evaluates to False, + the subreport is not run. + ``inline`` O boolean If set to True, the subreport is + formatted as an integral part of the + main report, without page eject before + or after it, and with page header and + footer inherited from the main report. + + If False (default), the subreport is + printed on separate pages. + + Subreports with different paper size + or page orientation cannot be inlined. + ``ownpageno`` O boolean If set to True, pages in the subreport + are numbered as in standalone report. + If False (default), page numbers in + the subreport continue the sequence of + the main report page numbers. Cannot + be set to True for inline subreports. + ================= ===== ========= ====================================== + ``title`` --------- |
From: alexander s. <a1...@us...> - 2006-12-15 13:24:49
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2632 Modified Files: template.py Log Message: Eject type defaults to "page" Index: template.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/template.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** template.py 15 Dec 2006 11:36:08 -0000 1.6 --- template.py 15 Dec 2006 13:24:48 -0000 1.7 *************** *** 1,4 **** --- 1,5 ---- """PythonReports Template (PRT) structures""" """History (most recent first): + 15-dec-2006 [als] Eject type defaults to "page" 15-dec-2006 [als] allow empty detail section; fix Layout: require either pagesize or width and height *************** *** 109,113 **** Eject = Validator(tag="eject", attributes={ ! "type": (EjectType, REQUIRED), "require": (Dimension, None), "when": (Expression, None), --- 110,114 ---- Eject = Validator(tag="eject", attributes={ ! "type": (EjectType, "page"), "require": (Dimension, None), "when": (Expression, None), |
From: alexander s. <a1...@us...> - 2006-12-15 11:36:15
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30077 Modified Files: template.py Log Message: allow empty detail section; fix Layout: require either pagesize or width and height Index: template.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/template.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** template.py 15 Dec 2006 08:30:22 -0000 1.5 --- template.py 15 Dec 2006 11:36:08 -0000 1.6 *************** *** 1,4 **** --- 1,6 ---- """PythonReports Template (PRT) structures""" """History (most recent first): + 15-dec-2006 [als] allow empty detail section; + fix Layout: require either pagesize or width and height 15-dec-2006 [als] group header an footer renamed to title and summary 07-dec-2006 [als] added Rectangle.opaque *************** *** 267,276 **** # pylint: disable-msg=W0613 # W0613: Unused argument 'tree' ! _group = element.find("group") ! _detail = element.find("detail") ! if _group and _detail: raise XmlValidationError("Found both 'group' and 'detail'", element, path) ! elif not (_group or _detail): raise XmlValidationError( "Either 'group' or 'detail' child is required", element, path) --- 269,278 ---- # pylint: disable-msg=W0613 # W0613: Unused argument 'tree' ! _have_group = element.find("group") is not None ! _have_detail = element.find("detail") is not None ! if _have_group and _have_detail: raise XmlValidationError("Found both 'group' and 'detail'", element, path) ! elif not (_have_group or _have_detail): raise XmlValidationError( "Either 'group' or 'detail' child is required", element, path) *************** *** 300,307 **** Group.child_validators["group"] = Group Layout = Validator(tag="layout", prevalidate=Data.collect, ! validate=_need_subgroup_or_detail, ! attributes={ "pagesize": (PageSize, None), "width": (Dimension, None), --- 302,327 ---- Group.child_validators["group"] = Group + def _need_pagesize(tree, element, path): + """Additional validator for "layout" element: check for page dimensions + + Page size may be specified either with the "pagesize" attribute + of with a pair of "width" and "height". If neither is set, it's an error. + + """ + # pylint: disable-msg=W0613 + # W0613: Unused argument 'tree' + if element.get("pagesize"): + return + if element.get("width") and element.get("height"): + return + raise XmlValidationError( + "Must have either 'pagesize' or 'width' and 'height'", element, path) + Layout = Validator(tag="layout", prevalidate=Data.collect, ! validate=( ! _need_pagesize, ! _need_subgroup_or_detail, ! ), attributes={ "pagesize": (PageSize, None), "width": (Dimension, None), |
From: alexander s. <a1...@us...> - 2006-12-15 08:32:46
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27841 Modified Files: builder.py Log Message: group header an footer renamed to title and summary Index: builder.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/builder.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** builder.py 7 Dec 2006 13:11:06 -0000 1.5 --- builder.py 15 Dec 2006 08:32:44 -0000 1.6 *************** *** 2,5 **** --- 2,6 ---- # FIXME: column-based variables are not intelligible """History (most recent first): + 15-dec-2006 [als] group header an footer renamed to title and summary 07-dec-2006 [als] support rectangle opacity 05-dec-2006 [als] fix errors and some warnings reported by pylint *************** *** 1191,1203 **** # process all groups for _group in self.groups: ! # group header and footer use containing frame, columns are inside ! # group header and footer are *not* frame header and footer ! # (not printed on each page; don't reserve space) ! _header = _group.find("header") ! if _header is not None: ! self.section_frames[_header] = _frame ! _footer = _group.find("footer") ! if _footer is not None: ! self.section_frames[_footer] = _frame _frame = self.make_column_frames(_group, _frame) # detail section uses innermost frame --- 1192,1202 ---- # process all groups for _group in self.groups: ! # group title and summary use containing frame, columns are inside ! _title = _group.find("title") ! if _title is not None: ! self.section_frames[_title] = _frame ! _summary = _group.find("summary") ! if _summary is not None: ! self.section_frames[_summary] = _frame _frame = self.make_column_frames(_group, _frame) # detail section uses innermost frame *************** *** 1278,1282 **** self.fill_detail() # fill_summary will close all report groups. ! # since group footers are always evaluated in old_context # (assuming that current context started a new group) # we now need old_context to be current context. --- 1277,1281 ---- self.fill_detail() # fill_summary will close all report groups. ! # since group summaries are always evaluated in old_context # (assuming that current context started a new group) # we now need old_context to be current context. *************** *** 1533,1540 **** if (_var.iter == "group") and (_var.itergrp == _group_name): _var.iterate(self.context) ! _header = group.find("header") ! if _header: ! self.check_eject(_header) ! self.add_section(self.build_section(_header)) _columns = group.find("columns") if _columns: --- 1532,1539 ---- if (_var.iter == "group") and (_var.itergrp == _group_name): _var.iterate(self.context) ! _title = group.find("title") ! if _title: ! self.check_eject(_title) ! self.add_section(self.build_section(_title)) _columns = group.find("columns") if _columns: *************** *** 1554,1561 **** if _max_y > self.cur_y: self.cur_y = _max_y ! _footer = group.find("footer") ! if _footer: ! self.check_eject(_footer) ! self.add_section(self.build_section(_footer, context=self.old_context)) self.resolve_eval(("group", group.get("name"))) --- 1553,1560 ---- if _max_y > self.cur_y: self.cur_y = _max_y ! _summary = group.find("summary") ! if _summary: ! self.check_eject(_summary) ! self.add_section(self.build_section(_summary, context=self.old_context)) self.resolve_eval(("group", group.get("name"))) *************** *** 1616,1620 **** self.page.append(section) self.cur_y = section.box.y + section.box.height + 1 ! if section.template.tag == "header": # adjust top margin of all contained frames # (new columns will start at this position) --- 1615,1619 ---- self.page.append(section) self.cur_y = section.box.y + section.box.height + 1 ! if section.template.tag in ("header", "title"): # adjust top margin of all contained frames # (new columns will start at this position) |
From: alexander s. <a1...@us...> - 2006-12-15 08:30:23
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27135 Modified Files: template.py Log Message: group header an footer renamed to title and summary Index: template.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/template.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** template.py 7 Dec 2006 13:08:40 -0000 1.4 --- template.py 15 Dec 2006 08:30:22 -0000 1.5 *************** *** 1,4 **** """PythonReports Template (PRT) structures""" ! """History: 07-dec-2006 [als] added Rectangle.opaque 07-dec-2006 [als] removed "transparent" attribute of the "box" element --- 1,5 ---- """PythonReports Template (PRT) structures""" ! """History (most recent first): ! 15-dec-2006 [als] group header an footer renamed to title and summary 07-dec-2006 [als] added Rectangle.opaque 07-dec-2006 [als] removed "transparent" attribute of the "box" element *************** *** 228,236 **** Header = Validator(tag="header", children=_section_children, ! doc="Page, column or group header section" ) Footer = Validator(tag="footer", children=_section_children, ! doc="Page, column or group footer section" ) --- 229,237 ---- Header = Validator(tag="header", children=_section_children, ! doc="Page or column header section" ) Footer = Validator(tag="footer", children=_section_children, ! doc="Page or column footer section" ) *************** *** 238,242 **** attributes={ "swapheader": (Boolean, False), ! }, doc="A summary section printed before report data" ) --- 239,243 ---- attributes={ "swapheader": (Boolean, False), ! }, doc="A summary section printed before data" ) *************** *** 244,248 **** attributes={ "swapfooter": (Boolean, False), ! }, doc="A summary section printed after report data" ) --- 245,249 ---- attributes={ "swapfooter": (Boolean, False), ! }, doc="A summary section printed after data" ) *************** *** 284,289 **** }, children=[ (Style, Validator.UNRESTRICTED), ! (Header, Validator.ZERO_OR_ONE), ! (Footer, Validator.ZERO_OR_ONE), (Columns, Validator.ZERO_OR_ONE), (Detail, Validator.ZERO_OR_ONE), --- 285,290 ---- }, children=[ (Style, Validator.UNRESTRICTED), ! (Title, Validator.ZERO_OR_ONE), ! (Summary, Validator.ZERO_OR_ONE), (Columns, Validator.ZERO_OR_ONE), (Detail, Validator.ZERO_OR_ONE), |
From: alexander s. <a1...@us...> - 2006-12-15 08:27:20
|
Update of /cvsroot/pythonreports/PythonReports/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26013 Modified Files: sakila.prt Log Message: group header and footer renamed to title and summary Index: sakila.prt =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/test/sakila.prt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sakila.prt 7 Dec 2006 13:36:33 -0000 1.2 --- sakila.prt 15 Dec 2006 08:27:14 -0000 1.3 *************** *** 176,180 **** </columns> <group name="customer" expr="customer_id"> ! <header> <box height="14" /> <style font="bold" color="#000900" /> --- 176,180 ---- </columns> <group name="customer" expr="customer_id"> ! <title> <box height="14" /> <style font="bold" color="#000900" /> *************** *** 190,195 **** <box y="-2" height="0" /> </line> ! </header> ! <footer> <box height="16" /> <style font="bold" color="#000900" /> --- 190,195 ---- <box y="-2" height="0" /> </line> ! </title> ! <summary> <box height="16" /> <style font="bold" color="#000900" /> *************** *** 202,206 **** <box y="4" /> </field> ! </footer> <detail> <box height="12" /> --- 202,206 ---- <box y="4" /> </field> ! </summary> <detail> <box height="12" /> |
From: alexander s. <a1...@us...> - 2006-12-15 08:26:41
|
Update of /cvsroot/pythonreports/PythonReports/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25646 Modified Files: prt.txt Log Message: group header and footer renamed to title and summary; deprecate nested columns definitions Index: prt.txt =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/doc/prt.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** prt.txt 7 Dec 2006 13:21:07 -0000 1.4 --- prt.txt 15 Dec 2006 08:26:35 -0000 1.5 *************** *** 4,11 **** :Version: 0.3.0 ! :Date: 07-dec-2006 ! .. TODO: variables iterated at start of section; ! groups have title/summary instead of header/footer .. TODO: subreports, backgrounds, outline tags --- 4,10 ---- :Version: 0.3.0 ! :Date: 15-dec-2006 ! .. TODO: variables iterated at start of section .. TODO: subreports, backgrounds, outline tags *************** *** 54,58 **** The `group`_ element contains one `group`_ or `detail`_ element and may contain a sequence of `style`_ elements and possible `columns`_, ! `header`_ and `footer`_ elements. Report template may contain only one `detail`_ section (innermost --- 53,57 ---- The `group`_ element contains one `group`_ or `detail`_ element and may contain a sequence of `style`_ elements and possible `columns`_, ! `title`_ and `summary`_ elements. Report template may contain only one `detail`_ section (innermost *************** *** 466,474 **** --------- ! A child element of `layout`_ element containing a summary printed before ! report data. ! While `title`_ is processed, all ``*_COUNT`` values are set to zero ! (see `predefined variables`_.) Attributes: --- 465,473 ---- --------- ! A child element of `layout`_ or `group`_ element containing a summary ! printed before report data. ! While report `title`_ is processed, all ``*_COUNT`` values are set to ! zero (see `predefined variables`_.) Attributes: *************** *** 477,482 **** Name Req Type Description ================= ===== ========= ====================================== ! ``swapheader`` O boolean If True, title section is printed ! before the first page header. ================= ===== ========= ====================================== --- 476,483 ---- Name Req Type Description ================= ===== ========= ====================================== ! ``swapheader`` O boolean When used in report title section, ! value of True lets the title section ! be printed before the first page ! header. Ignored for group titles. ================= ===== ========= ====================================== *************** *** 484,489 **** ----------- ! A child element of `layout`_ element containing a summary printed after ! report data. Attributes: --- 485,490 ---- ----------- ! A child element of `layout`_ or `group`_ element containing a summary ! printed after report data. Attributes: *************** *** 492,497 **** Name Req Type Description ================= ===== ========= ====================================== ! ``swapfooter`` O boolean If True, the last page footer is ! printed before the summary section ================= ===== ========= ====================================== --- 493,500 ---- Name Req Type Description ================= ===== ========= ====================================== ! ``swapfooter`` O boolean When used in report summary section, ! True means that the last page footer ! is printed before the report summary. ! Ignored for group summaries. ================= ===== ========= ====================================== *************** *** 499,510 **** ---------- ! A child element of `layout`_, `columns`_ or `group`_ describing header ! layout for report page, column or group respectively. ``footer`` ---------- ! A child element of `layout`_, `columns`_ or `group`_ describing footer ! layout for report page, column or group respectively. ``layout`` --- 502,513 ---- ---------- ! A child element of `layout`_ or `columns`_ describing header layout ! for report page or column respectively. ``footer`` ---------- ! A child element of `layout`_ or `columns`_ describing footer layout ! for report page or column respectively. ``layout`` *************** *** 545,548 **** --- 548,556 ---- and `group`_ elements. + **Please note**: although it is possible to make nested column templates + (you may have `columns`_ in `layout`_ and then in data `group`_ and again + in a nested `group`_), that does not work well. It is highly recommended + to have only one (or none) `columns`_ element per report template. + Attributes: |
From: alexander s. <a1...@us...> - 2006-12-12 10:49:28
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20548 Modified Files: TkDrivers.py Log Message: fix italic fonts: option name is "slant", not "style" Index: TkDrivers.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/TkDrivers.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TkDrivers.py 6 Dec 2006 17:03:25 -0000 1.2 --- TkDrivers.py 12 Dec 2006 10:49:27 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- """ """History (most recent first): + 12-dec-2006 [als] fix italic fonts: option name is "slant", not "style" 05-dec-2006 [als] sweep pylint warnings 04-nov-2006 [als] created *************** *** 61,65 **** for (_prop, _attr, _value) in ( ("bold", "weight", "bold"), ! ("italic", "style", "italic"), ("underline", "underline", True), ): --- 62,66 ---- for (_prop, _attr, _value) in ( ("bold", "weight", "bold"), ! ("italic", "slant", "italic"), ("underline", "underline", True), ): |
From: alexander s. <a1...@us...> - 2006-12-12 10:44:12
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18767 Modified Files: RLDrivers.py Log Message: .size renamed to .height for compatibility with base class (.chop was broken) Index: RLDrivers.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/RLDrivers.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RLDrivers.py 6 Dec 2006 16:55:16 -0000 1.3 --- RLDrivers.py 12 Dec 2006 10:44:11 -0000 1.4 *************** *** 6,9 **** --- 6,11 ---- """ """History (most recent first): + 12-dec-2006 [als] .size renamed to .height for compatibility with base class + (.chop was broken) 01-nov-2006 [als] driver classes have backend name property 05-oct-2006 [als] created *************** *** 29,37 **** backend = "RL" - # attributes read directly by PythonReports.PdfWriter - name = None - size = None - leading = None - # 1/5 of character size is default line gap used by ReportLab. DEFAULT_LEADING = .2 --- 31,34 ---- *************** *** 63,67 **** self._registered_fonts.add(_name) self.name = _name ! self.size = _size self.leading = _size * self.DEFAULT_LEADING --- 60,64 ---- self._registered_fonts.add(_name) self.name = _name ! self.height = _size self.leading = _size * self.DEFAULT_LEADING *************** *** 70,75 **** # have to aggregate dimensions manually _lines = text.split("\n") ! _height = (self.size + self.leading) * len(_lines) - self.leading ! _width = max([pdfmetrics.stringWidth(_line, self.name, self.size) for _line in _lines]) return (_width, _height) --- 67,72 ---- # have to aggregate dimensions manually _lines = text.split("\n") ! _height = (self.height + self.leading) * len(_lines) - self.leading ! _width = max([pdfmetrics.stringWidth(_line, self.name, self.height) for _line in _lines]) return (_width, _height) |