# Path: papaye/models.py
# STATUS = status_type(*range(0, len(status_type._fields)))
# 
# Path: papaye/evolve/managers.py
# def load_model(model_name):
#     def decorated(func):
#         func.load_model = importlib.import_module(model_name)
#         return func
#     return decorated
# 
# def context_from_root(root):
#     return root[APP_ROOT_NAME]


from papaye.models import STATUS
from papaye.evolve.managers import load_model, context_from_root


@load_model('papaye.evolve.models.snapshot1')
def evolve(root, config=None):
    context = context_from_root(root)
    repository = context.get('repository', tuple())

    for package_name in repository:
        package = repository[package_name]
        for release_name in package.releases:
            release = package[release_name]
            for release_filename in release.release_files:
                release_file = release[release_filename]
                if None in release.original_metadata:

# Path: papaye/models.py
# STATUS = status_type(*range(0, len(status_type._fields)))
# 
# Path: papaye/evolve/managers.py
# def load_model(model_name):
#     def decorated(func):
#         func.load_model = importlib.import_module(model_name)
#         return func
#     return decorated
# 
# def context_from_root(root):
#     return root[APP_ROOT_NAME]


# Path: papaye/evolve/evolve5.py
from papaye.models import STATUS
from papaye.evolve.managers import load_model, context_from_root



@load_model('papaye.evolve.models.snapshot1')
def evolve(root, config=None):
    context = context_from_root(root)
    repository = context.get('repository', tuple())

    for package_name in repository:
        package = repository[package_name]
        for release_name in package.releases:
            release = package[release_name]
            for release_filename in release.release_files:
                release_file = release[release_filename]
                if None in release.original_metadata:

                    release_file.status = STATUS.local