Changeset - c59c4d4323e7
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-09-01 12:13:03
marcin@python-works.com
added support for broken symlinks in whoosh indexer
1 file changed with 14 insertions and 3 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/indexers/daemon.py
Show inline comments
 
@@ -86,13 +86,24 @@ class WhooshIndexingDaemon(object):
 
            log.debug('    >> %s' % path)
 
            #just index file name without it's content
 
            u_content = u''
 
                
 
        writer.add_document(owner=unicode(repo.contact),
 
        
 
        
 
        
 
        try:
 
            os.stat(path)
 
            writer.add_document(owner=unicode(repo.contact),
 
                            repository=u"%s" % repo.name,
 
                            path=u"%s" % path,
 
                            content=u_content,
 
                            modtime=os.path.getmtime(path),
 
                            extension=ext) 
 
                            extension=ext)             
 
        except OSError, e:
 
            import errno
 
            if e.errno == errno.ENOENT:
 
                log.debug('path %s does not exist or is a broken symlink' % path)
 
            else:
 
                raise e                 
 

	
 
    
 
    def build_index(self):
 
        if os.path.exists(IDX_LOCATION):
0 comments (0 inline, 0 general)