def build_architecture(data=None): # data argument provided for when function run as clean-up - always None global session, serv, db, dbPath, docParser, \ fullTxr, fullSplitTxr, \ ppFlow, \ rebuild # globals line 1: re-establish session; maintain user if possible if (session): u = session.user else: u = None session = Session() session.database = 'db_ead' session.environment = 'apache' session.user = u serv = SimpleServer(session, os.path.join(cheshirePath, 'cheshire3', 'configs', 'serverConfig.xml')) db = serv.get_object(session, 'db_ead') dbPath = db.get_path(session, 'defaultPath') docParser = db.get_object(session, 'LxmlParser') # globals line 4: transformers fullTxr = db.get_object(session, 'htmlFullTxr') fullSplitTxr = db.get_object(session, 'htmlFullSplitTxr') # globals line 5: workflows ppFlow = db.get_object(session, 'preParserWorkflow'); ppFlow.load_cache(session, db) rebuild = False
def build_architecture(data=None): global session, serv, db, qf, xmlp, recordStore, sentenceStore, paragraphStore, resultSetStore, articleTransformer, kwicTransformer session = Session() session.environment = 'apache' session.user = None serv = SimpleServer(session, os.path.join(cheshire3Root, 'configs', 'serverConfig.xml') ) session.database = 'db_' + databaseName db = serv.get_object(session, session.database) qf = db.get_object(session, 'defaultQueryFactory') xmlp = db.get_object(session, 'LxmlParser') recordStore = db.get_object(session, 'recordStore') articleTransformer = db.get_object(session, 'article-Txr') kwicTransformer = db.get_object(session, 'kwic-Txr')
def build_architecture(data=None): global session, serv, db, qf, xmlp, recordStore, resultSetStore, idxStore, articleTransformer, kwicTransformer, proxExtractor, simpleExtractor, adf, fimi2, rule, arm, vecTxr, vectorStore, armTableTxr session = Session() session.environment = 'apache' session.user = None serv = SimpleServer(session, os.path.join(cheshire3Root, 'configs', 'serverConfig.xml') ) session.database = 'db_' + databaseName db = serv.get_object(session, session.database) qf = db.get_object(session, 'defaultQueryFactory') xmlp = db.get_object(session, 'LxmlParser') recordStore = db.get_object(session, 'recordStore') resultSetStore = db.get_object(session, 'resultSetStore') simpleExtractor = db.get_object(session, 'SimpleExtractor') proxExtractor = db.get_object(session, 'ProxExtractor') articleTransformer = db.get_object(session, 'article-Txr') kwicTransformer = db.get_object(session, 'kwic-Txr') idxStore = db.get_object(session, 'indexStore')
# C3 web search utils from cheshire3.web.www_utils import * # separate file containing display configs + some HMTL for table rows etc. from clic.dickens.web.dickensWebConfig import * from clic.dickens.web.dickensSearchHandler import SearchHandler from clic.dickens.web.dickensBrowseHandler import BrowseHandler cheshirePath = os.environ.get('HOME', '/home/cheshire') logPath = os.path.join(cheshirePath, 'clic', 'www', databaseName, 'logs', 'searchHandler.log') htmlPath = os.path.join(cheshirePath, 'clic', 'www', databaseName, 'html') session = Session() session.environment = 'apache' session.user = None serv = SimpleServer(session, os.path.join(cheshire3Root, 'configs', 'serverConfig.xml')) session.database = 'db_dickens' db = serv.get_object(session, session.database) authStore = db.get_object(session, 'authStore') # Discover objects... def handler(req): global db, htmlPath, logPath, cheshirePath, xmlp, recordStore form = FieldStorage(req) try: dir = req.uri[1:].rsplit('/')[1] except IndexError: return apache.HTTP_NOT_FOUND