Exemplo n.º 1
0
def project(raw_path):
    path = FilePath(raw_path)

    git_dir = path.child(".git")
    if git_dir.isdir():
        return GitPath(git_dir)

    hg_dir = path.child(".hg")
    if hg_dir.isdir():
        return HgPath(path)

    return path
Exemplo n.º 2
0
load_filters(app)


wd = None
if wd is None:
    wd = os.getcwd()

wd = FilePath(wd)

app.debug = True

# This default should be sufficient to limp along for starters.
app.config["DCON_STATIC_URL"] = "/static/"

app.config["DCON_PATH"] = wd
app.config["DCON_PASSWORD_FILE"] = wd.child("passwords.dcon")
app.config["DCON_UPLOAD_PATH"] = wd.child("uploads")
app.config["SECRET_KEY"] = wd.child("secret.key").open("rb").read()

app.config["UPLOADS_DEFAULT_DEST"] = app.config["DCON_UPLOAD_PATH"].path
app.config["SESSION_PROTECTION"] = None

load_config(app)

configure_uploads(app, (images,))
patch_request_class(app)

db.init_app(app)
lm.setup_app(app)

app.register_blueprint(users)