예제 #1
0
 def test_ims(self):
     """ SendFile: If-Modified-Since"""
     request.environ['HTTP_IF_MODIFIED_SINCE'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime())
     try:
         send_file(os.path.basename(__file__), root='./')
     except HTTPError, e:
         self.assertEqual(304 ,e.status)
예제 #2
0
 def test_mime(self):
     """ SendFile: Mime Guessing"""
     try:
         send_file(os.path.basename(__file__), root='./')
     except BreakTheBottle, e:
         self.assertTrue(
             response.content_type in ('application/x-python-code',
                                       'text/x-python'))
예제 #3
0
파일: app.py 프로젝트: admp/protein-search
def accessions(id):
    session = Session(SESSION_DIR, id)
    accession = request.GET.get('accession')
    if accession:
        return template('blast_progress', session=session,
                        accession=accession)
    else:
        send_file('accessions.html', root=session.dir)
예제 #4
0
def serve_resources(file):
    try:
        if file.endswith(".gz"):
            response.headers['Content-Encoding'] = "gzip"
    except Exception as e:
        print(e)
            
    send_file(file, root='web/') 
예제 #5
0
def download(filename):
    testBottle.logger.info(
        "pouet %s, path: %s", filename,
        str(os.path.join(testBottle.rootPath, "files", "uploads")))
    send_file(filename,
              root=os.path.join(testBottle.rootPath, "files", "machine",
                                "scanFiles"),
              download=filename)
예제 #6
0
def serve_resources(file):
    try:
        if file.endswith(".gz"):
            response.headers['Content-Encoding'] = "gzip"
    except Exception as e:
        print(e)

    send_file(file, root='web/')
예제 #7
0
def framework_log_full(fid, log_type):
    sid = get_slave().id
    if sid != -1:
        dir = "%s/slave-%s/fw-%s" % (work_dir, sid, fid)
        i = max(os.listdir(dir))
        exec_dir = "%s/slave-%s/fw-%s/%s" % (work_dir, sid, fid, i)
        send_file(log_type, root=exec_dir, guessmime=False, mimetype="text/plain")
    else:
        abort(403, "Slave not yet registered with master")
예제 #8
0
 def test_ims(self):
     """ SendFile: If-Modified-Since"""
     request.environ['HTTP_IF_MODIFIED_SINCE'] = time.strftime(
         "%a, %d %b %Y %H:%M:%S GMT", time.gmtime())
     response.bind()
     try:
         send_file(os.path.basename(__file__), root='./')
     except HTTPError, e:
         self.assertEqual(304, e.http_status)
예제 #9
0
파일: webui.py 프로젝트: ferrouswheel/mdig
def instance_occ_envelope_gif(model, instance, ls_id):
    """ Return the occupancy envelope for an instance as a gif """
    dm = model
    idx = int(instance)
    if not validate_instance(dm, idx):
        abort(404, "No such instance")
    instance = dm.get_instances()[idx]
    # do per lifestage!
    fn = instance.get_occ_envelope_img_filenames(ls=ls_id, gif=True)
    root_dir = os.path.dirname(fn)
    send_file(os.path.basename(fn), root=root_dir)
예제 #10
0
파일: webui.py 프로젝트: dgpreatoni/mdig
def instance_occ_envelope_gif(model, instance, ls_id):
    """ Return the occupancy envelope for an instance as a gif """
    dm = model
    idx = int(instance)
    if not validate_instance(dm, idx):
        abort(404, "No such instance")
    instance = dm.get_instances()[idx]
    # do per lifestage!
    fn = instance.get_occ_envelope_img_filenames(ls=ls_id, gif=True)
    root_dir = os.path.dirname(fn)
    send_file(os.path.basename(fn), root=root_dir)
예제 #11
0
def framework_log_full(fid, log_type):
    sid = get_slave().id
    if sid != -1:
        dir = '%s/slave-%s/fw-%s' % (work_dir, sid, fid)
        i = max(os.listdir(dir))
        exec_dir = '%s/slave-%s/fw-%s/%s' % (work_dir, sid, fid, i)
        send_file(log_type,
                  root=exec_dir,
                  guessmime=False,
                  mimetype='text/plain')
    else:
        abort(403, 'Slave not yet registered with master')
예제 #12
0
파일: webui.py 프로젝트: vicever/mesos
def framework_log_full(fid, eid, log_type):
    url = "http://localhost:" + slave_port + "/" + slave_id + "/state.json"
    data = urllib.urlopen(url).read()
    state = json.loads(data)
    sid = state["id"]
    if sid != -1:
        dir = "%s/slaves/%s/frameworks/%s/executors/%s/runs/" % (work_dir, sid, fid, eid)
        i = max(os.listdir(dir))
        exec_dir = "%s/slaves/%s/frameworks/%s/executors/%s/runs/%s" % (work_dir, sid, fid, eid, i)
        send_file(log_type, root=exec_dir, guessmime=False, mimetype="text/plain")
    else:
        abort(403, "Slave not yet registered with master")
예제 #13
0
def framework_log_full(fid, eid, log_type):
  url = "http://localhost:" + slave_port + "/slave/state.json"
  data = urllib.urlopen(url).read()
  state = json.loads(data)
  sid = state['id']
  if sid != -1:
    dir = '%s/slaves/%s/frameworks/%s/executors/%s/runs/' % (work_dir, sid, fid, eid)
    i = max(os.listdir(dir))
    exec_dir = '%s/slaves/%s/frameworks/%s/executors/%s/runs/%s' % (work_dir, sid, fid, eid, i)
    send_file(log_type, root = exec_dir,
              guessmime = False, mimetype = 'text/plain')
  else:
    abort(403, 'Slave not yet registered with master')
예제 #14
0
파일: webui.py 프로젝트: viirya/mesos
def framework_log_full(fid, log_type):
  url = "http://localhost:" + slave_port + "/slave/state.json"
  data = urllib.urlopen(url).read()
  state = json.loads(data)
  sid = state['id']
  if sid != -1:
    dir = '%s/slave-%s/fw-%s' % (work_dir, sid, fid)
    i = max(os.listdir(dir))
    exec_dir = '%s/slave-%s/fw-%s/%s' % (work_dir, sid, fid, i)
    send_file(log_type, root = exec_dir,
              guessmime = False, mimetype = 'text/plain')
  else:
    abort(403, 'Slave not yet registered with master')
예제 #15
0
파일: webui.py 프로젝트: dgpreatoni/mdig
def replicate_spread_gif(model, instance, replicate, ls_id):
    dm = model
    idx = int(instance)
    if not validate_instance(dm, idx):
        abort(404, "No such instance")
    instance = dm.get_instances()[idx]
    replicate = int(replicate)
    if not validate_replicate(instance, replicate):
        abort(404, "No such replicate, or replicate doesn't exist yet")
    r = instance.replicates[replicate]
    # do per lifestage!
    fn = r.get_base_filenames(ls=ls_id, extension='_anim.gif', single_file=True)
    root_dir = os.path.dirname(fn)
    send_file(os.path.basename(fn), root=root_dir)
예제 #16
0
파일: webui.py 프로젝트: dgpreatoni/mdig
def instance_occ_envelope_map_pack(model, instance, ls_id):
    dm = model
    idx = int(instance)
    if not validate_instance(dm, idx):
        abort(404, "No such instance")
    instance = dm.get_instances()[idx]
    # do per lifestage!
    fn = instance.get_occ_envelope_img_filenames(
        ls=ls_id, extension=False, gif=True)
    fn += '.zip'
    if os.path.isfile(fn):
        add_to_map_pack_lfu(fn)
        root_dir = os.path.dirname(fn)
        send_file(os.path.basename(fn), root=root_dir)
    abort(404, "No map pack generated")
예제 #17
0
파일: webui.py 프로젝트: ferrouswheel/mdig
def replicate_spread_gif(model, instance, replicate, ls_id):
    dm = model
    idx = int(instance)
    if not validate_instance(dm, idx):
        abort(404, "No such instance")
    instance = dm.get_instances()[idx]
    replicate = int(replicate)
    if not validate_replicate(instance, replicate):
        abort(404, "No such replicate, or replicate doesn't exist yet")
    r = instance.replicates[replicate]
    # do per lifestage!
    fn = r.get_base_filenames(ls=ls_id,
                              extension='_anim.gif',
                              single_file=True)
    root_dir = os.path.dirname(fn)
    send_file(os.path.basename(fn), root=root_dir)
예제 #18
0
파일: webui.py 프로젝트: ferrouswheel/mdig
def instance_occ_envelope_map_pack(model, instance, ls_id):
    dm = model
    idx = int(instance)
    if not validate_instance(dm, idx):
        abort(404, "No such instance")
    instance = dm.get_instances()[idx]
    # do per lifestage!
    fn = instance.get_occ_envelope_img_filenames(ls=ls_id,
                                                 extension=False,
                                                 gif=True)
    fn += '.zip'
    if os.path.isfile(fn):
        add_to_map_pack_lfu(fn)
        root_dir = os.path.dirname(fn)
        send_file(os.path.basename(fn), root=root_dir)
    abort(404, "No map pack generated")
예제 #19
0
 def static_file(filename):
     log.debug("'%s'" % filename)
     if filename == '/jquery-ui.js':
         send_file('/usr/share/javascript/jquery-ui/jquery-ui.js') #TODO: support other distros
     elif filename == 'jquery.min.js':
         send_file('/usr/share/javascript/jquery/jquery.min.js', root='/')
     elif filename == 'jquery-ui.custom.css': #TODO: support version change
         send_file('/usr/share/javascript/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css')
     else:
         send_file(filename, root='static')
예제 #20
0
def static_file(filename):
    """Serving static files, allowing two directories at maximum."""
    log.debug("'%s'" % filename)
#    print filename
    if filename == '/jquery-ui.js':
        send_file('/usr/share/javascript/jquery-ui/jquery-ui.js')
    elif filename == 'jquery.min.js':
        send_file('/usr/share/javascript/jquery/jquery.min.js', root='/')
    elif filename == 'jquery-ui.custom.css': #TODO: support version change
        send_file('/usr/share/javascript/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css')
    else:
        send_file(filename, root='static')
예제 #21
0
파일: webui.py 프로젝트: pwendell/mesos
def static(filename):
  send_file(filename, root = './webui/static')
예제 #22
0
def static_file_keys(dir,filename):
	## request.environ['HTTP_IF_MODIFIED_SINCE'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(100))
	send_file(filename, root=setup.keydir+'/'+dir, mimetype='text/plain')	
예제 #23
0
def image_file2(filename, f):
    print filename
    return send_file(filename + "/" + f, root=os.getcwd() + "/images/")
예제 #24
0
def image_file(filename):
    print filename
    return send_file(filename, root=os.getcwd() + "/images/")
예제 #25
0
def index():
    send_file("index.html",
              root=os.path.join(testBottle.rootPath, 'files', "static"))
예제 #26
0
def server_static(path):
    send_file(path,
              root=os.path.join(testBottle.rootPath, "files", "static", "css"))
예제 #27
0
def image_file(filename):
	return send_file( filename, root=os.getcwd()+'/images/' )
예제 #28
0
파일: webui.py 프로젝트: ferrouswheel/mdig
def static_resources(filename):
    send_file(filename, root=resource_dir)
예제 #29
0
def static(filename):
    send_file(filename, root=webui_dir + '/static')
예제 #30
0
def static_file(filename):
    bottle.send_file(filename,
                     root=os.path.join(os.environ['OPENSHIFT_REPO_DIR'],
                                       'wsgi', 'static'))
예제 #31
0
def static_file(filename):
    """Archivos estáticos (CSS etc)"""
    bottle.send_file(filename, root='./static/')
예제 #32
0
def static_file(filename):
    send_file(filename, root='static')
예제 #33
0
def static_file(filename):
    bottle.send_file(filename, root='static/')
예제 #34
0
def static_file(filename):
    send_file(filename, root='./static/css/')
예제 #35
0
파일: webui.py 프로젝트: adegtiar/sceem
def log_full(level):
  send_file('mesos-master.' + level, root = log_dir,
            guessmime = False, mimetype = 'text/plain')
예제 #36
0
def log_file(filename):
	return send_file( filename, root=os.getcwd()+ uploads )
예제 #37
0
def static_file(filename):
    send_file(filename, root='/path/to/static/files/')
예제 #38
0
def sendimage(image):
    bottle.send_file(image, root='static/images')
예제 #39
0
def flot(filename):
    send_file(filename, root=APP_CWD + '/static/flot/')
예제 #40
0
def static_file(filename):
    send_file(filename,
              root=os.path.join(testBottle.rootPath, 'files', "static"))
예제 #41
0
def static_file(filename):
    send_file(filename, root='./static/css/')
예제 #42
0
def server_static(path):
    response.headers['Cache-Control'] = "no-store, no-cache, must-revalidate"
    response.headers['Pragma'] = "no-cache"
    response.headers['expires'] = 0
    send_file(path,
              root=os.path.join(testBottle.rootPath, "files", "static", "img"))
예제 #43
0
파일: main.py 프로젝트: apg/muxtube
def static_file(filename):
    send_file(filename, root='static/images')
예제 #44
0
def favi():
    return send_file("favicon.ico", root=os.getcwd() + "/images/")
예제 #45
0
파일: main.py 프로젝트: apg/muxtube
def static_file(filename):
    send_file(filename, root='static/css')
예제 #46
0
def style(name):
    bottle.send_file(name, root='static')
예제 #47
0
def static_file(filename):
    send_file(filename,
              root='/root/work/code/lanzw_bottle/evolution/evolution_02/')
예제 #48
0
파일: webui.py 프로젝트: pwendell/mesos
def log_full(level):
  send_file('mesos-master.' + level, root = log_dir,
            guessmime = False, mimetype = 'text/plain')
예제 #49
0
파일: redweb.py 프로젝트: gnrfan/redweb
def static_file(filename):
    send_file(filename, root='../redweb/static')
예제 #50
0
def static_file(filename):
    """Archivos estáticos (CSS etc)"""
    bottle.send_file(filename, root="./static/")
예제 #51
0
def style(name):
    bottle.send_file(name,root='static')
예제 #52
0
def static_file(filename):
	return send_file( filename, root=os.getcwd()+'/static/' )
예제 #53
0
def sendimage(image):
    bottle.send_file(image,root='static/images')
예제 #54
0
def favi():
	return send_file( 'favicon.ico', root=os.getcwd()+'/images/' )
예제 #55
0
파일: webui.py 프로젝트: ferrouswheel/mdig
def static_resources():
    send_file("favicon.ico", root=resource_dir)
예제 #56
0
파일: webui.py 프로젝트: adegtiar/sceem
def static(filename):
  send_file(filename, root = webui_dir + '/static')
예제 #57
0
def static(filename):
    send_file(filename, root=APP_CWD + '/static')
예제 #58
0
파일: app.py 프로젝트: wightman/speakeasy
def static_file(filename):
  bottle.send_file(filename, root='static/')
예제 #59
0
def favicon():
    send_file('favicon.ico', root='static')