def resetdb(): """ Delete all the databases and recreate them. The database path must be set for this to work. """ deletedbs() setup.init()
def resetdb(): """ Delete all the databases and recreate them. The database path must be set for this to work. """ deletedbs() installDefaultSpaces() setup.init()
def main(argv): try: action = argv[0] except Error: usage() sys.exit(2) if len(missing) > 0 and (not (action in ["nightly", "installdeps", "build", "configure", "shiftpress", ""])): bail(", ".join(missing)) if action in ("-h", "--help"): usage() elif action == "nightly": nightly() elif action == "configure": try: url = argv[1] except: usage() sys.exit(2) configure(url) elif action == "docs": docs() elif action == "manual": manual() elif action == "installdeps": installdeps() elif action == "update": update() elif action == "initdb": setup.init() elif action == "build": build(argv[1:]) elif action == "updatedb": updatedb() elif action == "resetdb": resetdb() elif action == "install": installSpace(argv[1]) elif action == "setdbpath": try: url = argv[1] except: usage() sys.exit(2) setdbpath(url) elif action == "shiftpress": try: url = argv[1] except: usage() sys.exit(2) shiftpress(url) elif action == "tests": toRun = "all" if len(argv) > 1: toRun = [str.strip() for str in argv[1:]] tests(toRun) elif action == "new": try: name = argv[1] except: usage() sys.exit(2) createSpace(argv[1]) elif action == "runserver": print print "Make sure that you start lucene as well with:" print "\tpython shift.py runlucene" print runserver(argv) elif action == "runlucene": runlucene() elif action == "shell": shell() else: usage() sys.exit(2)
def main(argv): try: action = argv[0] except Error: usage() sys.exit(2) if len(missing) > 0 and (not (action in [ "nightly", "installdeps", "build", "configure", "shiftpress", "" ])): bail(", ".join(missing)) if action in ("-h", "--help"): usage() elif action == "nightly": nightly() elif action == "configure": try: url = argv[1] except: usage() sys.exit(2) configure(url) elif action == "docs": docs() elif action == "manual": manual() elif action == "installdeps": installdeps() elif action == "update": update() elif action == "initdb": setup.init() elif action == "build": build(argv[1:]) elif action == "updatedb": updatedb() elif action == "resetdb": resetdb() elif action == "install": installSpace(argv[1]) elif action == "setdbpath": try: url = argv[1] except: usage() sys.exit(2) setdbpath(url) elif action == "shiftpress": try: url = argv[1] except: usage() sys.exit(2) shiftpress(url) elif action == "tests": toRun = "all" if len(argv) > 1: toRun = [str.strip() for str in argv[1:]] tests(toRun) elif action == "new": try: name = argv[1] except: usage() sys.exit(2) createSpace(argv[1]) elif action == "runserver": print print "Make sure that you start lucene as well with:" print "\tpython shifty.py runlucene" print runserver(argv) elif action == "runlucene": runlucene() elif action == "shell": shell() else: usage() sys.exit(2)