[Erp5-report] r8592 - /erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 19 14:59:11 CEST 2006


Author: kevin
Date: Wed Jul 19 14:59:08 2006
New Revision: 8592

URL: http://svn.erp5.org?rev=8592&view=rev
Log:
Rename WebSite_getNewsItemSummary to WebPage_getContentSummary.

Added:
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_getContentSummary.xml

Added: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_getContentSummary.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_getContentSummary.xml?rev=8592&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_getContentSummary.xml (added)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_getContentSummary.xml Wed Jul 19 14:59:08 2006
@@ -1,0 +1,196 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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 encoding="cdata"><![CDATA[
+
+if full_text in [None, \'\']:\n
+  return "News vide !"\n
+\n
+# XXX ! Big Security issue here !!!\n
+# Must be replaced by http://www.zope.org/Members/itamar/striphtml ? \n
+\n
+# Other Alternative:\n
+#    from stripogram import html2text\n
+#    return html2text(full_text)\n
+\n
+def StripTags(text):\n
+  finished = 0\n
+  while not finished:\n
+    finished = 1\n
+    # check if there is an open tag left\n
+    start = text.find("<")\n
+    if start >= 0:\n
+      # if there is, check if the tag gets closed\n
+      stop = text[start:].find(">")\n
+      if stop >= 0:\n
+        # if it does, strip it, and continue loop\n
+        text = text[:start] + text[start+stop+1:]\n
+        finished = 0\n
+  return text\n
+\n
+# End of bad HTML tag stripping\n
+\n
+word_list = StripTags(full_text).split(\' \')\n
+\n
+# Get the first 30 words of the news\n
+word_count = 30\n
+summary = \'\'\n
+for word in word_list:\n
+  if len(word) > 0:\n
+    summary += word + \' \'\n
+  word_count -= 1\n
+  if word_count == 0:\n
+    break\n
+    \n
+return summary\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>full_text=None</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>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>full_text</string>
+                            <string>None</string>
+                            <string>StripTags</string>
+                            <string>_getattr_</string>
+                            <string>word_list</string>
+                            <string>word_count</string>
+                            <string>summary</string>
+                            <string>_getiter_</string>
+                            <string>word</string>
+                            <string>len</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>WebPage_getContentSummary</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>




More information about the Erp5-report mailing list