changeset 1527:d33b42df2d36

Merge with main.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Mon, 04 Sep 2006 20:22:43 +0200
parents ff050fb8f2c2 (current diff) 6efd969a704f (diff)
children ec52fba7f971
files
diffstat 5 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/AdvancedSearch.py	Mon Sep 04 20:22:18 2006 +0200
+++ b/MoinMoin/macro/AdvancedSearch.py	Mon Sep 04 20:22:43 2006 +0200
@@ -89,7 +89,7 @@
     # mimetype selection
     mimetype = form_get(request, 'mimetype')
     mt_select = makeSelection('mimetype',
-            [(m[1], '*%s - %s' % m) for m in sorted(mimetypes.types_map.items())],
+            [('', 'any mimetype')] + [(m[1], '*%s - %s' % m) for m in sorted(mimetypes.types_map.items())],
             mimetype)
 
 
--- a/MoinMoin/search/Xapian.py	Mon Sep 04 20:22:18 2006 +0200
+++ b/MoinMoin/search/Xapian.py	Mon Sep 04 20:22:43 2006 +0200
@@ -546,6 +546,7 @@
             if updated:
                 xatt_itemid = xapdoc.Keyword('itemid', att_itemid)
                 xpname = xapdoc.SortKey('pagename', pagename)
+                xwname = xapdoc.SortKey('wikiname', request.cfg.interwikiname or "Self")
                 xattachment = xapdoc.SortKey('attachment', att) # this is an attachment, store its filename
                 xmtime = xapdoc.SortKey('mtime', mtime)
                 xrev = xapdoc.SortKey('revision', '0')
--- a/MoinMoin/search/builtin.py	Mon Sep 04 20:22:18 2006 +0200
+++ b/MoinMoin/search/builtin.py	Mon Sep 04 20:22:43 2006 +0200
@@ -611,7 +611,8 @@
         
         @param page: the current page instance
         """
-        return self.query.search(page)
+        if page:
+            return self.query.search(page)
 
     def _getHits(self, pages, matchSearchFunction):
         """ Get the hit tuples in pages through matchSearchFunction """
@@ -645,7 +646,8 @@
                         page = Page(self.request, "%s/%s" % (fs_rootpage, attachment))
                         hits.append((wikiname, page, None, None))
                     else:
-                        hits.append((wikiname, page, attachment, None))
+                        matches = matchSearchFunction(page=None, uid=uid)
+                        hits.append((wikiname, page, attachment, matches))
                 else:
                     matches = matchSearchFunction(page=page, uid=uid)
                     if matches:
--- a/MoinMoin/search/results.py	Mon Sep 04 20:22:18 2006 +0200
+++ b/MoinMoin/search/results.py	Mon Sep 04 20:22:43 2006 +0200
@@ -194,12 +194,6 @@
     def weight(self, unique=1):
         return 1
 
-    def get_matches(self, unique=1, sort='start', type=Match):
-        return []
-
-    def _unique_matches(self, type=Match):
-        return []
-
 
 class FoundRemote(FoundPage):
     """ Represents an attachment in search results """
@@ -821,7 +815,7 @@
         if wikiname in (request.cfg.interwikiname, 'Self'): # a local match
             if attachment:
                 result_hits.append(FoundAttachment(page.page_name,
-                    attachment, page=page))
+                    attachment, page=page, matches=match))
             else:
                 result_hits.append(FoundPage(page.page_name, match, page))
         else:
--- a/MoinMoin/widget/browser.py	Mon Sep 04 20:22:18 2006 +0200
+++ b/MoinMoin/widget/browser.py	Mon Sep 04 20:22:43 2006 +0200
@@ -22,7 +22,7 @@
         """
         self.data = dataset
 
-    def toHTML(self):
+    def format(self):
         fmt = self.request.formatter
 
         result = []
@@ -45,7 +45,8 @@
         while row:
             result.append(fmt.table_row(1))
             for idx in range(len(row)):
-                if self.data.columns[idx].hidden: continue
+                if self.data.columns[idx].hidden:
+                    continue
                 result.append(fmt.table_cell(1))
                 result.append(unicode(row[idx]))
                 result.append(fmt.table_cell(0))
@@ -55,7 +56,8 @@
         result.append(fmt.table(0))
         return ''.join(result)
 
+    toHTML = format # old name of "format" function DEPRECATED, will be removed in 1.7
 
     def render(self):
-        self.request.write(self.toHTML())
+        self.request.write(self.format())