예제 #1
0
파일: artifact.py 프로젝트: fidian/pyshelf
def get_metadata_property(container, bucket_name, path, item):
    manager = container.metadata.manager
    data = manager.metadata.get(item)
    if None is data:
        response = response_map.create_404()
    else:
        response = response_map.create_200(data)

    return response
예제 #2
0
def get_metadata_property(container, bucket_name, path, item):
    manager = container.metadata.manager
    data = manager.metadata.get(item)
    if None is data:
        response = response_map.create_404()
    else:
        response = response_map.create_200(data)

    return response
예제 #3
0
파일: app.py 프로젝트: kyle-long/pyshelf
def format_response(response):
    response.headers["Cache-Control"] = "no-cache"

    if response.status_code == 404:
        response = response_map.create_404()

    if response.headers["Content-Type"] == "application/json":
        data = response.get_data()
        data += "\n"
        response.set_data(data)
    return response