Exemplo n.º 1
0
Arquivo: fabfile.py Projeto: tel/365x6
def add_image(photographer, path):
    with closing(app.get_db()) as db:
        image = app.Image.fromfile(db, os.path.expanduser(path), photographer.lower().capitalize())
        image.store(db)
        day = app.Day.current(db)
        app.link_image(db, image, day)
        db.commit()
    local('rm %s' % path)
Exemplo n.º 2
0
Arquivo: fabfile.py Projeto: tel/365x6
def update_day():
    with closing(app.get_db()) as db:
        # Refresh today
        day = app.Day.today(db)
        db.commit()