Exemplo n.º 1
0
def remove_mainwindow(main_id):
    def do_the_destroys(result):
        tile_ids = result["tile_ids"]
        for tile_id in tile_ids:
            destroy_container(tile_id)
            send_direct_request_to_container(megaplex_id, "deregister_container", {"container_id": tile_id})
        destroy_container(main_id)
        send_direct_request_to_container(megaplex_id, "deregister_container", {"container_id": main_id})
    host_worker.post_task(main_id, "get_tile_ids", {}, do_the_destroys)
    return jsonify({"success": True})
Exemplo n.º 2
0
def export_data():
    def export_success(result):
        if result["success"]:
            socketio.emit("doFlash", {"alert_type": "alert-success", "message": "Data successfully exported"},
                          namespace='/main', room=data_dict["main_id"])
        user_obj = load_user(data_dict["user_id"])
        collection_manager.update_selector_list(user_obj=user_obj)
        return
    data_dict = request.json
    full_collection_name = current_user.build_data_collection_name(data_dict['export_name'])
    host_worker.post_task(data_dict["main_id"], "export_data", {"full_collection_name": full_collection_name},
                          export_success)
    return jsonify({"success": True})
Exemplo n.º 3
0
def get_mainwindow_property(main_id, prop_name, callback):
    host_worker.post_task(main_id, "get_property", {"property": prop_name}, callback)
    return
Exemplo n.º 4
0
def set_mainwindow_property(main_id, prop_name, prop_value):
    host_worker.post_task(main_id, "set_property", {"property": prop_name, "val": prop_value})
    return