Beispiel #1
0
def handle_db_reset(verbose=True):
    from mslib.mscolab.server import APP, db
    if os.path.exists(mscolab_settings.DATA_DIR):
        shutil.rmtree(mscolab_settings.DATA_DIR)
    create_files()
    with APP.app_context():
        db.drop_all()
        db.create_all()
    if verbose is True:
        print("Database has been reset successfully!")
Beispiel #2
0
 def test_create_file(self):
     create_files()
     # ToDo refactor to fs
     assert os.path.exists(mscolab_settings.MSCOLAB_DATA_DIR)
     assert os.path.exists(mscolab_settings.UPLOAD_FOLDER)
Beispiel #3
0
def handle_db_init():
    from mslib.mscolab.server import APP, db
    create_files()
    with APP.app_context():
        db.create_all()
    print("Database initialised successfully!")
Beispiel #4
0
def start_server(app, sockio, cm, fm, port=8083):
    create_files()
    sockio.run(app, port=port)