def create_app():
    path = os.path.dirname(__file__)
    config = yaml.load(open(os.path.join(path, "config.yaml")))

    app = Flask(__name__)
    app.config["CELERY_BROKER_URL"] = config["CELERY_BROKER_URL"]
    app.config["CELERY_RESULT_BACKEND"] = config["CELERY_RESULT_BACKEND"]
    app.config["CELERY_IMPORTS"] = "worker"
    app.config["LOCATIONS"] = config["LOCATIONS"]
    app.config["TESTSUITES"] = config["TESTSUITES"]
    app.config["PORT"] = config["PORT"]
    app.config["DBNAME"] = config["DBNAME"]
    app.config["DBUSER"] = config["DBUSER"]
    app.config["DBPASSWD"] = config["DBPASSWD"]
    app.config["BROKER_TRANSPORT_OPTIONS"] = {"socket_timeout": 7200}
    app.config["URL"] = config["URL"]
    app.config["CALLBACK_URL"] = config["CALLBACK_URL"]
    app.config["CELERY_TASK_SERIALIZER"] = "json"
    return app
import tempfile
from urlparse import urlparse, urldefrag

from celery import Celery
from cwltool.load_tool import fetch_document, validate_document
from flask import Flask, render_template, request, redirect, jsonify, url_for
import easywebdav
import magic
import minio
import ruamel.yaml as yaml
from swiftclient.service import SwiftService, SwiftUploadObject

app = Flask(__name__)
app.config.from_pyfile("settings.cfg")
app.config["CELERY_TRACK_STARTED"] = True
app.config["CELERY_TASK_SERIALIZER"] = "json"
app.config["CELERY_ACCEPT_CONTENT"] = ["json"]
app.config["CELERY_RESULT_SERIALIZER"] = "json"

celery = Celery(app.name, broker=app.config["CELERY_BROKER_URL"])
celery.conf.update(app.config)

logger = logging.getLogger("onebuttoncompute")


class WebDAVClient(object):
    def __init__(self, root, username, password):
        self.root = root
        o = urlparse(root)
        logging.warning(o)
        logging.warning(o.path)