diff roundup/backends/back_metakit.py @ 2512:f5542d92307a

fix anydbm journal import [SF#983166] fix dumb bug in FileClass index()
author Richard Jones <richard@users.sourceforge.net>
date Thu, 01 Jul 2004 03:55:47 +0000
parents bdd112cf61ba
children c86b2179085b
line wrap: on
line diff
--- a/roundup/backends/back_metakit.py	Tue Jun 29 22:15:13 2004 +0000
+++ b/roundup/backends/back_metakit.py	Thu Jul 01 03:55:47 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: back_metakit.py,v 1.77 2004-06-28 23:13:05 richard Exp $
+# $Id: back_metakit.py,v 1.78 2004-07-01 03:55:47 richard Exp $
 '''Metakit backend for Roundup, originally by Gordon McMillan.
 
 Known Current Bugs:
@@ -1951,11 +1951,12 @@
         Pass on the content-type property for the content property.
         '''
         Class.index(self, nodeid)
-        mimetype = self.get(nodeid, 'type')
-        if not mimetype:
-            mimetype = self.default_mime_type
+        try:
+            mime_type = self.get(nodeid, 'type', self.default_mime_type)
+        except KeyError:
+            mime_type = self.default_mime_type
         self.db.indexer.add_text((self.classname, nodeid, 'content'),
-                    self.get(nodeid, 'content'), mimetype)
+            str(self.get(nodeid, 'content')), mime_type)
  
 class IssueClass(Class, roundupdb.IssueClass):
     ''' The newly-created class automatically includes the "messages",

Roundup Issue Tracker: http://roundup-tracker.org/