Update of /cvsroot/pythonreports/PythonReports/PythonReports
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18710
Modified Files:
builder.py
Log Message:
fix py2.7 FutureWarnings for "if section"
Index: builder.py
===================================================================
RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/builder.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** builder.py 19 Dec 2006 16:45:30 -0000 1.8
--- builder.py 7 Jan 2011 10:35:30 -0000 1.9
***************
*** 2,5 ****
--- 2,6 ----
# FIXME: column-based variables are not intelligible
"""History (most recent first):
+ 07-jan-2011 [als] fix py2.7 FutureWarnings for "if section"
19-dec-2006 [als] straighten "if not/else" logic in Builder.run_subreport();
build_section: refetch context after subreports build
***************
*** 450,454 ****
else:
_skip_columns = 2 # self and parent
! while _element:
if _skip_columns:
_skip_columns -= 1
--- 451,455 ----
else:
_skip_columns = 2 # self and parent
! while _element is not None:
if _skip_columns:
_skip_columns -= 1
***************
*** 1184,1188 ****
# if swapped, they use page frame, otherwise inner frame
_section = _layout.find("title")
! if _section:
if _section.get("swapheader") and _section.find("eject"):
self.section_frames[_section] = _page_frame
--- 1185,1189 ----
# if swapped, they use page frame, otherwise inner frame
_section = _layout.find("title")
! if _section is not None:
if _section.get("swapheader") and _section.find("eject"):
self.section_frames[_section] = _page_frame
***************
*** 1190,1194 ****
self.section_frames[_section] = _frame
_section = _layout.find("summary")
! if _section:
if _section.get("swapfooter"):
self.section_frames[_section] = _page_frame
--- 1191,1195 ----
self.section_frames[_section] = _frame
_section = _layout.find("summary")
! if _section is not None:
if _section.get("swapfooter"):
self.section_frames[_section] = _page_frame
***************
*** 1231,1239 ****
_header = _columns.find("header")
_footer = _columns.find("footer")
! if _header or _footer:
! if _header:
self.section_frames[_header] = _frame
_frame.header = _header
! if _footer:
self.section_frames[_footer] = _frame
_frame.footer = _footer
--- 1232,1240 ----
_header = _columns.find("header")
_footer = _columns.find("footer")
! if (_header or _footer) is not None:
! if _header is not None:
self.section_frames[_header] = _frame
_frame.header = _header
! if _footer is not None:
self.section_frames[_footer] = _frame
_frame.footer = _footer
***************
*** 1472,1476 ****
# build the section
_section = self.build_section(_template)
! if _section:
# place the section
self.add_section(_section)
--- 1473,1477 ----
# build the section
_section = self.build_section(_template)
! if _section is not None:
# place the section
self.add_section(_section)
***************
*** 1507,1511 ****
else:
_footer = _layout.find("footer")
! if _summary:
self.check_eject(_summary)
if _summary.get("swapfooter") and (_footer is not None):
--- 1508,1512 ----
else:
_footer = _layout.find("footer")
! if _summary is not None:
self.check_eject(_summary)
if _summary.get("swapfooter") and (_footer is not None):
***************
*** 1566,1570 ****
_var.iterate(self.context)
_title = group.find("title")
! if _title:
self.check_eject(_title)
self.add_section(self.build_section(_title))
--- 1567,1571 ----
_var.iterate(self.context)
_title = group.find("title")
! if _title is not None:
self.check_eject(_title)
self.add_section(self.build_section(_title))
***************
*** 1587,1591 ****
self.cur_y = _max_y
_summary = group.find("summary")
! if _summary:
self.check_eject(_summary)
self.add_section(self.build_section(_summary,
--- 1588,1592 ----
self.cur_y = _max_y
_summary = group.find("summary")
! if _summary is not None:
self.check_eject(_summary)
self.add_section(self.build_section(_summary,
***************
*** 1653,1657 ****
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)
--- 1654,1658 ----
assert _layout is not None # _prt is verified
_section = _layout.find("header")
! if _section is not None:
warn("Replacing non-empty page header"
" for inlined report \"%s\"" % _prt_name)
***************
*** 1660,1664 ****
_layout.append(_page_frame.header)
_section = _layout.find("footer")
! if _section:
warn("Replacing non-empty page footer"
" for inlined report \"%s\"" % _prt_name)
--- 1661,1665 ----
_layout.append(_page_frame.header)
_section = _layout.find("footer")
! if _section is not None:
warn("Replacing non-empty page footer"
" for inlined report \"%s\"" % _prt_name)
|