Exemple #1
0
 def test_index(s):
     indexer.main(s.f)
     # result is here:
     m = {}
     execfile(fn_reg, m)
     funcs = ['Foo.sub', 'Foo.FooSub.subsub', 'fun1', 'fun2']
     for f in funcs:
         assert f in m['funcs'] and f in m['reg'].keys()
     for f in funcs:
         for k in 'arg_keys', 'args', 'doc', 'pos_args':
             assert k in m['reg'][f]
     print('path', fn_reg)
Exemple #2
0
def checkBuildData():
    print("Checking if index and lexicon data exist...")

    if not os.path.exists("index.txt"):
        print(
            "The index has not been built yet!  Building index and lexicon...")
        ind.main()
        lex.main()

    if not os.path.exists("lexicon.txt"):
        print("The lexicon has not been built yet!  Building the lexicon...")
        lex.main()
Exemple #3
0
def main(fileToIndex):
    constants.filetoIndex = fileToIndex
    indexesInit.main()
    #crawler.main(constants.filetoIndex)
    indexer.main()
    indexesInit.cleanup()
            sys.exit(1)

        if len(db) == 0:
            print "database is empty"
            sys.exit(1)

        if headers is None:
            print "no data in index"
            sys.exit(1)

        if len(headers) == 0:
            print "index is empty"
            sys.exit(1)

        print "db loaded. %d entries" % len(db)


def getDb():
    if db is None:
        init_db(joiner.dbfile, joiner.indexfile)
    return [db, headers, queries]

if __name__ == '__main__':
    if not os.path.exists(joiner.dbfile):
        joiner.main()

    if not os.path.exists(joiner.indexfile):
        indexer.main()

    app.run(port=PORT)
Exemple #5
0
def main():
	print indexer.main()
Exemple #6
0
def verify_indexing():
    if not os.path.exists('index.txt') or os.path.getsize('index.txt') <= 0:
        print('Indexing... (~3 minutes)')
        indexer.main()
Exemple #7
0
 def testIndexerMain(self):
     self.assertEqual(indexer.main(".config/config_test.yml"), None)
Exemple #8
0
def main():
    print indexer.main()
def main():
    indexer.main()
    start_servers()