Changeset - 0c9dfae57107
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-08-18 00:02:21
marcin@python-works.com
fixed path issue
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/indexers/daemon.py
Show inline comments
 
@@ -11,49 +11,49 @@
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
# 
 
# You should have received a copy of the GNU General Public License
 
# along with this program; if not, write to the Free Software
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
# MA  02110-1301, USA.
 
"""
 
Created on Jan 26, 2010
 

	
 
@author: marcink
 
A deamon will read from task table and run tasks
 
"""
 
import sys
 
import os
 
from pidlock import LockHeld, DaemonLock
 
import traceback
 

	
 
from os.path import dirname as dn
 
from os.path import join as jn
 

	
 
#to get the pylons_app import
 
sys.path.append(dn(dn(dn(os.path.realpath(__file__)))))
 
sys.path.append(dn(dn(dn(dn(os.path.realpath(__file__))))))
 

	
 
from pylons_app.config.environment import load_environment
 
from pylons_app.model.hg_model import HgModel
 
from whoosh.index import create_in, open_dir
 
from shutil import rmtree
 
from pylons_app.lib.indexers import ANALYZER, EXCLUDE_EXTENSIONS, IDX_LOCATION, SCHEMA, IDX_NAME
 
import logging
 
log = logging.getLogger(__name__)
 

	
 

	
 
location = '/home/marcink/python_workspace_dirty/*'
 

	
 
def scan_paths(root_location):
 
    return HgModel.repo_scan('/', root_location, None, True)
 

	
 
class WhooshIndexingDaemon(object):
 
    """Deamon for atomic jobs"""
 

	
 
    def __init__(self, indexname='HG_INDEX'):
 
        self.indexname = indexname
 
        
 
    
 
    def get_paths(self, root_dir):
 
        """recursive walk in root dir and return a set of all path in that dir
0 comments (0 inline, 0 general)