~homeworkprod/byceps

b5e217cc1f24de8b656e667b60df2d2371fc926d — Jochen Kupperschmidt 3 years ago 4397651
Flip argument order to better reflect the key/value relationship
1 files changed, 4 insertions(+), 4 deletions(-)

M app.py
M app.py => app.py +4 -4
@@ 36,14 36,14 @@ init_app(app)
def _assemble_exports():
    exports = {}

    _export_path_if_configured(exports, 'PATH_GLOBAL', STATIC_URL_PREFIX_GLOBAL)
    _export_path_if_configured(exports, 'PATH_BRAND', STATIC_URL_PREFIX_BRAND)
    _export_path_if_configured(exports, 'PATH_PARTY', STATIC_URL_PREFIX_PARTY)
    _export_path_if_configured(exports, STATIC_URL_PREFIX_GLOBAL, 'PATH_GLOBAL')
    _export_path_if_configured(exports, STATIC_URL_PREFIX_BRAND, 'PATH_BRAND')
    _export_path_if_configured(exports, STATIC_URL_PREFIX_PARTY, 'PATH_PARTY')

    return exports


def _export_path_if_configured(exports, config_key, url_path):
def _export_path_if_configured(exports, url_path, config_key):
    path = app.config.get(config_key)
    if path:
        exports[url_path] = str(path)