Exemplo n.º 1
0
def show_version():
    pyver = sys.version_info
    print '  Python: v%d.%d.%d' % (pyver[0], pyver[1], pyver[2])
    print 'Sherlock: v' + get_version_info('sherlock')
    print '   Flask: v' + get_version_info('flask')
    print 'Pygments: v' + get_version_info('pygments')
    print '  Whoosh: v' + get_version_info('whoosh')
    print 'CherryPy: v' + get_version_info('cherrypy')
Exemplo n.º 2
0
def show_version():
    pyver = sys.version_info
    print '  Python: v%d.%d.%d' % (pyver[0], pyver[1], pyver[2])
    print 'Sherlock: v' + get_version_info('sherlock')
    print '   Flask: v' + get_version_info('flask')
    print 'Pygments: v' + get_version_info('pygments')
    print '  Whoosh: v' + get_version_info('whoosh')
    print 'CherryPy: v' + get_version_info('cherrypy')
Exemplo n.º 3
0
def show_version():
    pyver = sys.version_info
    print('  Python: v%d.%d.%d' % (pyver[0], pyver[1], pyver[2]))
    print('Sherlock: v' + get_version_info('sherlock'))
    print('   Flask: v' + get_version_info('flask'))
    print('Pygments: v' + get_version_info('pygments'))
    print('  Whoosh: v' + get_version_info('whoosh'))
    print(' Cheroot: v' + get_version_info('cheroot'))
Exemplo n.º 4
0
def show_version():
    pyver = sys.version_info
    print "  Python: v%d.%d.%d" % (pyver[0], pyver[1], pyver[2])
    print "Sherlock: v" + get_version_info("sherlock")
    print "   Flask: v" + get_version_info("flask")
    print "Pygments: v" + get_version_info("pygments")
    print "  Whoosh: v" + get_version_info("whoosh")
    print "CherryPy: v" + get_version_info("cherrypy")
Exemplo n.º 5
0
def run():
    options = get_options()
    # determine app action
    if options.run_tests:
        tests.run_all()
    elif options.show_version:
        pyver = sys.version_info
        print '  Python: v%d.%d.%d' % (pyver.major, pyver.minor, pyver.micro)
        print 'Sherlock: v' + get_version_info('sherlock')
        print '   Flask: v' + get_version_info('flask')
        print 'Pygments: v' + get_version_info('pygments')
        print '  Whoosh: v' + get_version_info('whoosh')
        print 'CherryPy: v' + get_version_info('cherrypy')
    elif options.show_stats:
        # backend stats
        print 'Available indexer backends: %s' % backends.indexer_names()
        print 'Available searcher backends: %s' % backends.searcher_names()
        print 'Current backend: %s' % settings.DEFAULT_SEARCHER
        # indexer stats
        idxr = indexer.get_indexer()
        print 'Total documents indexed: %d' % idxr.doc_count()
        # database stats
        print 'Index Database: %s' % db.DATABASE_PATH
    elif options.run_server:
        print 'Backend: %s' % settings.DEFAULT_SEARCHER
        print 'Server: %s' % server.get_server_type()
        # launch web server
        server.run()
    elif options.reindex:
        path = utils.resolve_path(settings.INDEX_PATH)
        # check path
        if not path.endswith('/'):
            raise Exception('INDEX_PATH must end with a trailing slash. %s' %
                            path)
        if not os.path.exists(path):
            raise Exception('Check INDEX_PATH. Does it exist? %s' % path)
        print 'Indexing path: %s' % path
        if FORCE_INDEX_REBUILD:
            wait_time = 5  # seconds to wait/pause until rebuilding index
            print 'Reindexing everything!'
            print 'Waiting %ss for interrupt...' % wait_time
            import time
            time.sleep(wait_time)
        indexer.index_path(path)
        # record indexed time
        SherlockMeta.set('last_indexed',
                         datetime.now().strftime(SHORT_DATE_FORMAT))
    else:
        print 'Use -h to see options.'
    pass
Exemplo n.º 6
0
def run():
    options = get_options()
    # determine app action
    if options.run_tests:
        tests.run_all()
    elif options.show_version:
        pyver = sys.version_info
        print '  Python: v%d.%d.%d' % (pyver.major, pyver.minor, pyver.micro)
        print 'Sherlock: v' + get_version_info('sherlock')
        print '   Flask: v' + get_version_info('flask')
        print 'Pygments: v' + get_version_info('pygments')
        print '  Whoosh: v' + get_version_info('whoosh')
        print 'CherryPy: v' + get_version_info('cherrypy')
    elif options.show_stats:
        # backend stats
        print 'Available indexer backends: %s' % backends.indexer_names()
        print 'Available searcher backends: %s' % backends.searcher_names()
        print 'Current backend: %s' % settings.DEFAULT_SEARCHER
        # indexer stats
        idxr = indexer.get_indexer()
        print 'Total documents indexed: %d' % idxr.doc_count()
        # database stats
        print 'Index Database: %s' % db.DATABASE_PATH
    elif options.run_server:
        print 'Backend: %s' % settings.DEFAULT_SEARCHER
        print 'Server: %s' % server.get_server_type()
        # launch web server
        server.run()
    elif options.reindex:
        path = utils.resolve_path(settings.INDEX_PATH)
        # check path
        if not path.endswith('/'):
            raise Exception('INDEX_PATH must end with a trailing slash. %s' % path)
        if not os.path.exists(path):
            raise Exception('Check INDEX_PATH. Does it exist? %s' % path)
        print 'Indexing path: %s' % path
        if FORCE_INDEX_REBUILD:
            wait_time = 5 # seconds to wait/pause until rebuilding index
            print 'Reindexing everything!'
            print 'Waiting %ss for interrupt...' % wait_time
            import time
            time.sleep(wait_time)
        indexer.index_path(path)
        # record indexed time
        SherlockMeta.set('last_indexed', datetime.now().strftime(SHORT_DATE_FORMAT))
    else:
        print 'Use -h to see options.'
    pass
Exemplo n.º 7
0
def run():
    options = get_options()
    # determine app action
    if options.run_tests:
        tests.run_all()
    elif options.show_version:
        pyver = sys.version_info
        print '  Python: v%d.%d.%d' % (pyver.major, pyver.minor, pyver.micro)
        print '   webapp: v' + get_version_info('webapp')
        print '   Flask: v' + get_version_info('flask')
        print 'CherryPy: v' + get_version_info('cherrypy')
    elif options.run_server:
        print 'Server: %s' % server.get_server_type()
        # launch web server
        server.run()
    else:
        print 'Use -h to see options.'
    pass
Exemplo n.º 8
0
def run():
    options = get_options()
    # determine app action
    if options.run_tests:
        tests.run_all()
    elif options.show_version:
        pyver = sys.version_info
        print '  Python: v%d.%d.%d' % (pyver.major, pyver.minor, pyver.micro)
        print '   webapp: v' + get_version_info('webapp')
        print '   Flask: v' + get_version_info('flask')
        print 'CherryPy: v' + get_version_info('cherrypy')
    elif options.run_server:
        print 'Server: %s' % server.get_server_type()
        # launch web server
        server.run()
    else:
        print 'Use -h to see options.'
    pass
Exemplo n.º 9
0
        idxr = indexer.get_indexer()
        print 'Total documents indexed: %d' % idxr.doc_count()
        # database stats
        print 'Index Database: %s' % db.DATABASE_PATH
    elif options.run_server:
        print 'Backend: %s' % settings.DEFAULT_SEARCHER
        print 'Server: %s' % settings.SERVER_TYPE
        # launch web server
        server.run()
    elif options.reindex:
        path = utils.resolve_path(settings.INDEX_PATH)
        # check path
        if not path.endswith('/'):
            raise Exception('INDEX_PATH must end with a trailing slash. %s' % path)
        if not os.path.exists(path):
            raise Exception('Check INDEX_PATH. Does it exist? %s' % path)
        print 'Indexing path: %s' % path
        if FORCE_INDEX_REBUILD:
            print 'Reindexing everything!'
        indexer.index_path(path)
        # record indexed time
        SherlockMeta.set('last_indexed', datetime.now().strftime(SHORT_DATE_FORMAT))
    else:
        print 'Use -h to see options.'
    pass
    

if __name__ == '__main__':
    print 'sherlock v%s started' % get_version_info('sherlock')
    run()
    print 'sherlock done.'