def GET(self, sid, fn): web.header('Content-Disposition', 'attachment; filename="' + crypto.displayid(sid).replace(' ', '_') + '_' + fn + '"') web.header('Cache-Control', 'no-cache, no-store, must-revalidate') web.header('Pragma', 'no-cache') web.header('Expires', '-1') return file(store.path(sid, fn)).read()
def GET(self, sid, fn): web.header( 'Content-Disposition', 'attachment; filename="' + crypto.displayid(sid).replace(' ', '_') + '_' + fn + '"') web.header('Cache-Control', 'no-cache, no-store, must-revalidate') web.header('Pragma', 'no-cache') web.header('Expires', '-1') return file(store.path(sid, fn)).read()
def GET(self, sid): fns = os.listdir(store.path(sid)) docs = [] for f in fns: docs.append(web.storage( name=f, date=str(datetime.datetime.fromtimestamp(float(store.cleanname(f)))).split('.')[0] )) docs.sort(lambda x,y: cmp(x.date, y.date)) haskey = bool(crypto.getkey(sid)) web.header('Cache-Control', 'no-cache, no-store, must-revalidate') web.header('Pragma', 'no-cache') web.header('Expires', '-1') return render.col(docs, sid, haskey, codename=crypto.displayid(sid))
def GET(self): dirs = os.listdir(config.STORE_DIR) cols = [] for d in dirs: if not os.listdir(store.path(d)): continue cols.append(web.storage(name=d, codename=crypto.displayid(d), date= str(datetime.datetime.fromtimestamp( os.stat(store.path(d)).st_mtime )).split('.')[0] )) cols.sort(lambda x,y: cmp(x.date, y.date), reverse=True) web.header('Cache-Control', 'no-cache, no-store, must-revalidate') web.header('Pragma', 'no-cache') web.header('Expires', '-1') return render.index(cols)
def GET(self, sid): fns = os.listdir(store.path(sid)) docs = [] for f in fns: docs.append(web.storage( name=f, date=str(datetime.datetime.fromtimestamp(os.stat(store.path(sid, f)).st_mtime)) )) docs.sort(lambda x,y: cmp(x.date, y.date)) haskey = bool(crypto.getkey(sid)) web.header('Cache-Control', 'no-cache, no-store, must-revalidate') web.header('Pragma', 'no-cache') web.header('Expires', '-1') return render.col(docs, sid, haskey, codename=crypto.displayid(sid))