Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def description():
filename = kwargs.get('corpus_desc')
if not filename:
response.status = 404
return "File not found"
filename = get_static_resource_path(filename)
root, filename = os.path.split(filename)
return static_file(filename, root=root)
def retrieveSkeleton(bodyId):
return static_file(str(bodyId) + '.swc',
root='/Users/zhaot/Work/neutube/neurolabi/data/flyem/TEM/data_release/bundle1/swc')
@route('/')
def server_static(path):
response.headers['Expires'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT",
time.gmtime(time.time() + 60 * 60 * 24 * 7))
response.headers['Cache-control'] = "public"
resp = static_file(path, root=join(PROJECT_DIR, app_path))
# Also serve from .tmp folder in dev mode
if resp.status_code == 404 and app_path == "app":
return static_file(path, root=join(PROJECT_DIR, '.tmp'))
return resp
def server_static(filepath):
"""Handler for static files, used with the development server."""
root_folder = os.path.abspath(os.path.dirname(__file__))
return bottle.static_file(filepath, root=os.path.join(root_folder, 'static'))
@route('/:username/xmls/:id')
def xmls(username, id, db):
doc = db.getDocument(id)
return static_file('%s.xml' % doc.id, root=config.XMLS_DIR)
@route('/')
def root():
return static_file('index.html', root='./static')
def index():
return static_file('index.html',root=here())
def send_file(filename):
return static_file(filename, root='../redweb/static')
def server_static(filepath):
"""Handler for static files, used with the development server."""
root_folder = os.path.abspath(os.path.dirname(__file__))
return bottle.static_file(filepath, root=os.path.join(root_folder, 'static'))
def img(staticFiles) :
return static_file(staticFiles , root="/home/pi/Desktop/SMARTHOME/html/Application/fonts")