Commit 24ccf35c authored by Yusei Tahara's avatar Yusei Tahara

Renamed external method.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18207 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e4022fd9
No related merge requests found
...@@ -91,7 +91,7 @@ def generateParts(context,text,sw,tags,trail,maxlines): ...@@ -91,7 +91,7 @@ def generateParts(context,text,sw,tags,trail,maxlines):
yield par # return the last marked part yield par # return the last marked part
def cutFound(context, txt, sw, tags, trail, maxlines): def getExcerptText(context, txt, sw, tags, trail, maxlines):
""" """
Returns an excerpt of text found in the txt string Returns an excerpt of text found in the txt string
""" """
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
<string>Products.ExternalMethod.ExternalMethod</string> <tuple/>
<string>ExternalMethod</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -20,7 +17,7 @@ ...@@ -20,7 +17,7 @@
</item> </item>
<item> <item>
<key> <string>_function</string> </key> <key> <string>_function</string> </key>
<value> <string>cutFound</string> </value> <value> <string>getExcerptText</string> </value>
</item> </item>
<item> <item>
<key> <string>_module</string> </key> <key> <string>_module</string> </key>
...@@ -28,7 +25,7 @@ ...@@ -28,7 +25,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>cutFound</string> </value> <value> <string>Base_getExcerptText</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -115,12 +115,12 @@ if search_words in (\'\', None,):\n ...@@ -115,12 +115,12 @@ if search_words in (\'\', None,):\n
return result\n return result\n
\n \n
# get fragments of text containing searched words\n # get fragments of text containing searched words\n
found_text_fragments = context.cutFound(context, \n found_text_fragments = context.Base_getExcerptText(context,\n
document_text, \n document_text,\n
search_words, \n search_words,\n
tags = (\'<div style="font-weight:bold;display:inline;">\', \'</div>\'), \n tags = (\'<div style="font-weight:bold;display:inline;">\', \'</div>\'),\n
trail = 5, \n trail = 5,\n
maxlines = 5)\n maxlines = 5)\n
result = \' \'.join(map(str, found_text_fragments))\n result = \' \'.join(map(str, found_text_fragments))\n
\n \n
# Document may contains charactors which utf8 codec cannot decode.\n # Document may contains charactors which utf8 codec cannot decode.\n
......
751 752
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment