Commits

rgrp  committed f424f82

[main][xs]: move import of xapian into index_letters method so we don't require xapian (may not be using it on server).

  • Participants
  • Parent commits c361b9d

Comments (0)

Files changed (1)

File openletters/main.py

 # -*- coding: latin-1 -*-
-import unicodedata
 '''
 Class to parse the Dickens letters and enter into a store
 '''
-from parse import parse_text, parse_date
+import unicodedata
+from xml.dom import minidom
+import urllib, os
 
-
-from xml.dom import minidom
-
+from openletters.parse import parse_text, parse_date
 from openletters import model
 
-import xapian, urllib, os
-
 def getText(nodelist):
     rc = []
     for node in nodelist:
 
 
 def index_letters(self, type, fileobj):
-
+    import xapian
 
     db_path = 'db'
     
         indexer.index_text(text)
         database.add_document(document)
         
-    database.flush()
+    database.flush()