[Erp5-report] r25346 - in /erp5/trunk/bt5/erp5_ods_style: SkinTemplateItem/portal_skins/erp...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 28 18:02:22 CET 2009


Author: luke
Date: Wed Jan 28 18:02:21 2009
New Revision: 25346

URL: http://svn.erp5.org?rev=25346&view=rev
Log:
- use precision on ODS table cells, using previous generated list of precision styles
- add scripts to get maximum precision and style prefix list and use them to parametrise list of styles
- fix rest of wrong 'decimal' names to 'figure'

Added:
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMaximumSupportedPrecision.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSSupportedStylePrefixList.xml
Modified:
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml
    erp5/trunk/bt5/erp5_ods_style/bt/revision

Added: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMaximumSupportedPrecision.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMaximumSupportedPrecision.xml?rev=25346&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMaximumSupportedPrecision.xml (added)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMaximumSupportedPrecision.xml [utf8] Wed Jan 28 18:02:21 2009
@@ -1,0 +1,119 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>return 17 # The precision is 16 in reality, we need to use +1 for xrange support\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Base_getODSMaximumSupportedPrecision</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSSupportedStylePrefixList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSSupportedStylePrefixList.xml?rev=25346&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSSupportedStylePrefixList.xml (added)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSSupportedStylePrefixList.xml [utf8] Wed Jan 28 18:02:21 2009
@@ -1,0 +1,119 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>return (\'\',\'stat-\')\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Base_getODSSupportedStylePrefixList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml?rev=25346&r1=25345&r2=25346&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml [utf8] Wed Jan 28 18:02:21 2009
@@ -110,23 +110,14 @@
               <tal:block tal:define="field python: editable_fields.get(column_id, None)">\n
                 <tal:block tal:condition="python: field is not None">\n
                   <tal:block tal:condition="python:field.meta_type in [\'FloatField\',\'IntegerField\'] or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type in [\'FloatField\',\'IntegerField\'])">\n
-                    <tal:block tal:define="precision python: (field.meta_type == \'FloatField\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'FloatField\')) and field.get_value(\'precision\') or 0">\n
-                      <tal:block tal:condition="python:precision>0">\n
-                        <table:table-cell tal:attributes="office:value value;\n
-                                          table:style-name python: \'decimal_%s_%s\' % (style_prefix , precision)"\n
-                                          office:value-type="float"\n
-                                          table:style-name="decimal">\n
-                          <text:p tal:content="python: field.render_pdf(value)" />\n
-                        </table:table-cell>\n
-                      </tal:block>\n
-                      <tal:block tal:condition="not: python: precision>0">\n
-                        <table:table-cell tal:attributes="office:value value;\n
-                                          table:style-name string:${style_prefix}figure"\n
-                                          office:value-type="float"\n
-                                          table:style-name="figure">\n
-                          <text:p tal:content="python: field.render_pdf(value)" />\n
-                        </table:table-cell>\n
-                      </tal:block> \n
+                    <tal:block tal:define="precision python: (field.meta_type == \'FloatField\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'FloatField\')) and field.get_value(\'precision\') or 0;\n
+                    figure_style_name string:${style_prefix}figure_${precision}">\n
+                      <table:table-cell tal:attributes="office:value value;\n
+                                        table:style-name figure_style_name"\n
+                                        office:value-type="float"\n
+                                        table:style-name="figure">\n
+                        <text:p tal:content="python: field.render_pdf(value)" />\n
+                      </table:table-cell>\n
                     </tal:block>\n
                     <tal:block tal:condition="python:field.meta_type not in [\'FloatField\',\'IntegerField\'] and field.meta_type!=\'ProxyField\'">\n
                       <table:table-cell tal:attributes="table:style-name string:${style_prefix}string;"\n
@@ -139,9 +130,9 @@
                 </tal:block>\n
                 <tal:block tal:condition="python: field is None">\n
                   <table:table-cell tal:attributes="office:value value;\n
-                                    table:style-name string:${style_prefix}decimal"\n
+                                    table:style-name string:${style_prefix}figure"\n
                                     office:value-type="float"\n
-                                    table:style-name="decimal">\n
+                                    table:style-name="figure">\n
                     <text:p tal:condition="python: field is None"\n
                             tal:content="python: value"/>\n
                     <text:p tal:condition="python: field is not None"\n

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml?rev=25346&r1=25345&r2=25346&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml [utf8] Wed Jan 28 18:02:21 2009
@@ -140,30 +140,16 @@
     <style:style style:name="date_with_time" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="date_style">\n
       <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
     </style:style>\n
-    <number:number-style style:name="four_decimal">\n
-      <number:number number:decimal-places="4" number:min-integer-digits="1" number:grouping="true"/>\n
-    </number:number-style>\n
-    <number:number-style style:name="three_decimal">\n
-      <number:number number:decimal-places="3" number:min-integer-digits="1" number:grouping="true"/>\n
-    </number:number-style>\n
-    <number:number-style style:name="two_decimal">\n
-      <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>\n
-    </number:number-style>\n
-    <number:number-style style:name="one_decimal">\n
-      <number:number number:decimal-places="1" number:min-integer-digits="1" number:grouping="true"/>\n
-    </number:number-style>\n
-    <style:style style:name="decimal_4" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="four_decimal">\n
-      <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
-    </style:style>\n
-    <style:style style:name="decimal_3" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="three_decimal">\n
-      <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
-    </style:style>\n
-    <style:style style:name="decimal_2" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="two_decimal">\n
-      <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
-    </style:style>\n
-    <style:style style:name="decimal_1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="one_decimal">\n
-      <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
-    </style:style>\n
+    <tal:block tal:repeat="precision python: xrange(0,here.Base_getODSMaximumSupportedPrecision())">\n
+      <tal:block tal:define="figure_data_precision_style_name string:figure_data_precision_${precision}">\n
+        <number:number-style style:name="figure_data_precision_X" tal:attributes="style:name figure_data_precision_style_name">\n
+          <number:number number:decimal-places="X" number:min-integer-digits="1" number:grouping="true" tal:attributes="number:decimal-places precision"/>\n
+        </number:number-style>\n
+        <tal:block tal:repeat="style_prefix_name python: here.Base_getODSSupportedStylePrefixList()">\n
+          <style:style style:name="figure_X" style:family="table-cell" style:parent-style-name="figure" style:data-style-name="figure_data_precision_X" tal:attributes="style:name string:${style_prefix_name}figure_${precision}; style:data-style-name figure_data_precision_style_name ; style:parent-style-name string:${style_prefix_name}figure"/>\n
+        </tal:block>\n
+      </tal:block>\n
+    </tal:block>\n
   </office:automatic-styles>\n
 </tal:block>\n
 

Modified: erp5/trunk/bt5/erp5_ods_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/bt/revision?rev=25346&r1=25345&r2=25346&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_ods_style/bt/revision [utf8] Wed Jan 28 18:02:21 2009
@@ -1,1 +1,1 @@
-190
+201




More information about the Erp5-report mailing list