def show_file(path): import serve_file files = serve_file.file_request_handler() #newPath = libs.thumb.picThumbGenerator.genPicThumb(path, "d:/tmp/") #thumbFile = libs.thumb.picThumbGenerator.returnThumbString(path) #files.serveStringFile(thumbFile, path) files.serve(path)
def show_file(path): import serve_file files = serve_file.file_request_handler() path = transformDirToInternal(path) try: u = pathDb[path] except KeyError: u = str(uuid.uuid4()) pathDb[path] = u uuidDb[u] = path try: newPath = thumbDb[u] except: newPath = libs.thumb.picThumbGenerator.genPicThumb(path, gThumbPath) thumbDb[u] = newPath #thumbFile = libs.thumb.picThumbGenerator.returnThumbString(path) #files.serveStringFile(thumbFile, path) #files.serve(path) files.serve(newPath)