def manage_file(path): if request.method == 'DELETE': return Service().delete(path) elif request.method == 'GET': return path else: return Service().put(path)
def file(path): print(path, flush=True) v = 'production' if g.token_data['version'] != 'production': v = 'draft' return Service().get_contents(path, v)
def get_files(): files = Service().get_all() for f in files: if g.token_data['version'] == 'production': f.update(f['production']) else: f.update(f['draft']) f.pop('draft') f.pop('production') return files
def status(): return Service().status()
def callback(): return Service().callback()
def login(): return Service().login()
def production(path): return Service().get_contents(path, 'production')
def draft(path): return Service().get_contents(path, 'draft')
def init(): if os.environ.get('DEV_MODE', 'False').lower() == 'true': import dev_mock from behavior import Service dm = dev_mock.ServiceDevMock(Service().do_properties)
def clear_delete_marker(path): return Service().clear_delete_marker(path)
def get_signed_put_url(path): return Service().get_presign_url('PUT', path)
def get_signed_post_url(): return Service().get_presign_url('POST')
def files(): if request.method == 'GET': return Service().get_all() else: return Service().post()
def show_status(): return Service().show_status()
def publish(): return Service().publish()
def properties(): return Service().properties()
def data(route_path): if request.method == 'POST': return Service().post_data(route_path) else: return Service().get_data(route_path)