[PythonReports-checkins] PythonReports/PythonReports builder.py, 1.11, 1.12
Brought to you by:
a1s
|
From: Alexey L. <a-...@us...> - 2011-02-28 14:11:34
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports
In directory vz-cvs-2.sog:/tmp/cvs-serv11993
Modified Files:
builder.py
Log Message:
negative-height items do not affect section height
Index: builder.py
===================================================================
RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/builder.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** builder.py 26 Jan 2011 13:49:06 -0000 1.11
--- builder.py 28 Feb 2011 14:11:32 -0000 1.12
***************
*** 2,5 ****
--- 2,6 ----
# FIXME: column-based variables are not intelligible
"""History (most recent first):
+ 28-feb-2011 [luch] negative-height items do not affect section height
26-jan-2011 [luch] added floating boxes processing
18-jan-2011 [luch] removed extra empty horizontal pixel line between sections
***************
*** 747,750 ****
--- 748,752 ----
"""
+ # TODO convert it to element's or template's property or method
return item.tag in ("field", "line", "rectangle", "image", "barcode")
***************
*** 867,875 ****
_elem_height = _bbox.y + _bbox.height
else:
# fixed space from top and bottom, unknown size
_elem_height = _bbox.y + 1 - _bbox.height
if _elem_height > _height:
_height = _elem_height
! _sbox.height = round(_height)
# fix vertical dimensions for elements
for _element in self:
--- 869,878 ----
_elem_height = _bbox.y + _bbox.height
else:
+ # FIXME is it for _bbox.height < 0?
# fixed space from top and bottom, unknown size
_elem_height = _bbox.y + 1 - _bbox.height
if _elem_height > _height:
_height = _elem_height
! _sbox.height = round(_height) if _height > 0 else 0
# fix vertical dimensions for elements
for _element in self:
***************
*** 1075,1079 ****
return "<%s@%X%s: %.1f, %.1f, %.1f, %.1f>" % (
self.__class__.__name__, id(self), _col,
! self.x, self.top, self.width, self.bottom - self.top)
def make_child(self, **kwargs):
--- 1078,1087 ----
return "<%s@%X%s: %.1f, %.1f, %.1f, %.1f>" % (
self.__class__.__name__, id(self), _col,
! self.x, self.top, self.width, self.height)
!
! @property
! def height(self):
! """Read-only height of frame"""
! return self.bottom - self.top
def make_child(self, **kwargs):
***************
*** 1206,1209 ****
--- 1214,1221 ----
self.find_layout_parents()
+ def __repr__(self):
+ return "<%s@%x:%r>" % (self.__class__.__name__, id(self),
+ os.path.basename(self.template.filename))
+
def filepath(self, *path):
"""Return normalized absolute pathname
***************
*** 1629,1633 ****
self.end_group(_group)
_columns = _layout.find("columns")
! if _columns:
self.add_section(self.build_section(_columns.find("footer")))
self.resolve_eval("column")
--- 1641,1645 ----
self.end_group(_group)
_columns = _layout.find("columns")
! if _columns is not None:
self.add_section(self.build_section(_columns.find("footer")))
self.resolve_eval("column")
|