[POS-commit] r3907 - stoqlib/trunk/stoqlib/reporting/base

Henrique Romano henrique at async.com.br
Tue Jul 11 15:15:36 BRT 2006


Author: henrique
Date: Tue Jul 11 15:15:35 2006
New Revision: 3907

Modified:
   stoqlib/trunk/stoqlib/reporting/base/tables.py

Log:
Remove unneeded method, this work is already being done 
internally by Reportlab.



Modified: stoqlib/trunk/stoqlib/reporting/base/tables.py
==============================================================================
--- stoqlib/trunk/stoqlib/reporting/base/tables.py	(original)
+++ stoqlib/trunk/stoqlib/reporting/base/tables.py	Tue Jul 11 15:15:35 2006
@@ -256,33 +256,9 @@
         elif summary_row:
             extra_row = summary_row
         self.has_summary_row = summary_row is not None
-        if width:
-            self._expand_cols(columns, width)
         ReportTableBuilder.__init__(self, self.build_data(data), style,
                                     header, table_line, extra_row)
 
-    def _expand_cols(self, cols, table_width):
-        """ Based on the table width, expand the columns marked off with the
-        expand property.
-        """
-        cols_to_expand = [col for col in cols if col.expand]
-        if not cols_to_expand:
-            return
-        cols_width = [float(col.width) for col in cols]
-        if None in cols_width:
-            col = cols[cols_width.index(None)]
-            raise ValueError("You can't use auto-sized (%r) and expandable "
-                             "columns on the same table (%r)" % (col, self))
-        cols_total_width = sum(cols_width, 0.0)
-        if cols_total_width > table_width:
-            raise ValueError("Columns width sum (%.2f) can't exced table "
-                             "width (%.2f)" % (cols_total_width,
-                                               table_width))
-        extra_width = table_width - cols_total_width - COL_PADDING
-        expand_val = float(extra_width) / len(cols_to_expand)
-        for col in cols_to_expand:
-            col.width += expand_val
-
     def create_table(self, *args, **kwargs):
         """ Override ReportTableBuilder create_table method to allow specify
         the columns width.


More information about the POS-commit mailing list