コード例 #1
0
ファイル: buildhck.py プロジェクト: vodik/buildhck
def get_build_file(project=None, branch=None, system=None, fsdate=None, bfile=None):
    '''get file for build'''
    validate_build(project, branch, system)

    ext = os.path.splitext(bfile)[1]
    path = os.path.join(SETTINGS['builds_directory'], project)
    path = os.path.join(path, branch)
    path = os.path.join(path, system)
    path = os.path.join(path, fsdate)

    if not os.path.exists(path):
        abort(404, "Build does not exist.")

    if bfile == 'build-status.png':
        response.set_header('Cache-control', 'no-cache')
        response.set_header('Pragma', 'no-cache')
        if not failure_for_build(project, branch, system, fsdate):
            return static_file('ok.png', root='media/status/')
        return static_file('fail.png', root='media/status/')
    elif ext == '.zip':
        return static_file(bfile, root=path)
    elif ext == '.bz2':
        return static_file(bfile, root=path)
    elif ext == '.txt':
        response.content_type = 'text/plain'
        path = os.path.join(path, bfile.replace('.txt', '.bz2'))
        if os.path.exists(path):
            return bz2.BZ2File(path).read()

    abort(404, 'No such file.')
コード例 #2
0
ファイル: pur.py プロジェクト: Cloudef/PUR
def get_image(image=None, sub=None):
    '''fetch image'''
    if image == 'moe':
        import random
        image = random.choice(os.listdir('views/images/moe'))
        return static_file(image, root=('views/images/moe'))
    if sub:
        from os.path import join as path_join
        return static_file(image, root=path_join('views/images', sub))
    return static_file(image, root='views/images')
コード例 #3
0
ファイル: pur.py プロジェクト: Cloudef/PUR
def get_recipe_revision_file(pkgname=None, revision=None, recipefile=None):
    '''fetch recipe revision file'''
    if revision:
        recipe = RECIPEMANAGER.get_revision(pkgname, revision)
    else:
        recipe = RECIPEMANAGER.get_recipe(pkgname)
    if not recipe:
        abort(404)
    path = os.path.join('userdata/recipes', recipe['pkgname'], recipe['directory'])
    if recipefile == 'PNDBUILD':
        if request.query.get('syntax'):
            data = None
            with open(os.path.join(path, recipefile), 'r') as fle:
                data = fle.read()
            if not data:
                abort(404, _('PNDBUILD file not found'))
            syntax = replace.syntax(data, 'bash')
            return syntax if is_ajax_request() else template('syntax', title='PNDBUILD', syntax=syntax)
        return static_file(recipefile, root=path, mimetype='text/plain')
    return static_file(recipefile, root=path, download=True, mimetype='application/octet-stream')
コード例 #4
0
ファイル: pur.py プロジェクト: Cloudef/PUR
def recipes_page():
    '''recipes page'''
    if is_json_request():
        cachepath = 'userdata/cache/recipes.json'
        if not os.path.exists(cachepath) or os.path.getmtime(cachepath) < RECIPEMANAGER.modified():
            with open(cachepath, 'w') as fle:
                import json
                recipes = RECIPEMANAGER.query_recipes('ORDER BY pkgname')
                fle.write(json.dumps(recipes))
        return static_file('recipes.json', 'userdata/cache')
    results, matches, pages, options = search(RECIPEMANAGER.query_recipes, RECIPEMANAGER.query_recipes_count)
    return template('results', title=_('Recipes'), user=None, results=results, pages=pages, matches=matches, options=options)
コード例 #5
0
def favicon():
    return static_file('favicon.ico', root='files')
コード例 #6
0
ファイル: hobo.py プロジェクト: Epictetus/hobo-1
def favicon():
    return static_file('favicon.ico', root='files')
コード例 #7
0
def server_static(filepath):
    return static_file(filepath, root=config["paths"]["dir_assets"])
コード例 #8
0
ファイル: index.py プロジェクト: kmasaya/bottle.peewee.sample
def static_view( filename):
    return static_file( filename, root=STATIC_DIR)
コード例 #9
0
def server_assets(static_filename):
    """
    加载js、css、图片等资源
    """
    assets_path = "./assets"
    return static_file(filename=static_filename, root=assets_path)
コード例 #10
0
def static_serve(filepath):
    return static_file(filepath, root='staticfiles')
コード例 #11
0
def humans():
  return static_file('humans.txt', root='./static/')
コード例 #12
0
ファイル: pur.py プロジェクト: Cloudef/PUR
def get_js(jsf=None):
    '''fetch js script'''
    return static_file(jsf, root='views/js')
コード例 #13
0
def send_static(filename):
    return static_file(filename, root='./core/webserver')
コード例 #14
0
ファイル: list_server.py プロジェクト: BenDoan/lists
def static(path):
    return static_file(path, root=get_script_rel_path("static"))
コード例 #15
0
ファイル: server.py プロジェクト: XanderStrike/redditredux
def asset(filename):
    return static_file(filename, root='./assets/')
コード例 #16
0
ファイル: start.py プロジェクト: reasonz/projects
def static(filename):
    return static_file(filename,STATIC_PATH)
コード例 #17
0
ファイル: webserver.py プロジェクト: HeyMan7/Code
def send_static(filename):
    return static_file(filename, root='./core/webserver')
コード例 #18
0
def server_static(filename):
    return static_file(filename,
                       root=os.path.join(CUCKOO_ROOT, "data", "html"))
コード例 #19
0
ファイル: pur.py プロジェクト: Cloudef/PUR
def get_css(css=None):
    '''fetch css'''
    return static_file(css, root='views/css')
コード例 #20
0
def static(filename):
    return static_file(filename, root='./static/')
コード例 #21
0
def static_serve(filepath):
    return static_file(filepath, root='staticfiles')
コード例 #22
0
def send_static(filename):
  return static_file(filename, root='./static/')
コード例 #23
0
ファイル: hobo.py プロジェクト: misalabs/misalabs.com
def pgp_publick_key():
    return static_file('pgp.txt', root='files')
コード例 #24
0
ファイル: hobo.py プロジェクト: misalabs/misalabs
def pgp_publick_key():
    return static_file('pgp.txt', root='files')
コード例 #25
0
ファイル: routes.py プロジェクト: ionelanton/restbodal
def web_client_sammy(filepath):
    return static_file(filepath, root='web/clients/sammy')
コード例 #26
0
def serve_static(filename):
    return static_file(filename, root='src/IHM/img/')
コード例 #27
0
ファイル: web_server.py プロジェクト: evgs89/remote_sensors
 def server_static(self, filename):
     return static_file(filename, root='./static')
コード例 #28
0
ファイル: routes.py プロジェクト: bovard/clash-tracker
def display_home():
    auth_required()
    return static_file('index.html', root='./')
コード例 #29
0
def send_static(filename):
    return static_file(filename, root='C:/Users/runar/projects/pi/camera')
コード例 #30
0
ファイル: routes.py プロジェクト: ionelanton/restbodal
def static(filepath):
    return static_file(filepath, root='web')
コード例 #31
0
ファイル: buildhck.py プロジェクト: vodik/buildhck
def get_platform_icon(bfile=None):
    '''get platform icon'''
    return static_file(bfile, root='media/platform/')
コード例 #32
0
ファイル: routes.py プロジェクト: ionelanton/restbodal
def index():
    return static_file('index.html', root='web')
コード例 #33
0
ファイル: buildhck.py プロジェクト: vodik/buildhck
def get_favicon():
    '''fetch favicon'''
    return static_file('favicon.ico', root='.')
コード例 #34
0
ファイル: hobo.py プロジェクト: Epictetus/hobo-1
def server_static(filepath):
    return static_file(filepath, root='files')
コード例 #35
0
ファイル: main.py プロジェクト: paul-schwendenman/paste-math
def help():
    static_file('help.html', root='.')
コード例 #36
0
def server_static(filepath):
    return static_file(filepath, root='files')
コード例 #37
0
ファイル: main.py プロジェクト: paul-schwendenman/paste-math
def static(filename):
    return static_file(filename, root='static')
コード例 #38
0
def display_home():
    return static_file('index.html', root='./')
コード例 #39
0
ファイル: web_analysis.py プロジェクト: BwRy/test-av
def server_static(filename):
    return static_file(filename, root=os.path.join(CUCKOO_ROOT, "data", "html"))
コード例 #40
0
def index():
    return static_file("index.html", root='./static/')
コード例 #41
0
ファイル: api.py プロジェクト: pxe-la/musicLed
def process(filepath):
    return bottle.static_file(filepath, root="static")
コード例 #42
0
def graph():
  return static_file('customgraph.html', root='./static/')
コード例 #43
0
ファイル: api.py プロジェクト: pxe-la/musicLed
def process():
    return bottle.static_file('index.html', root="static")
コード例 #44
0
def index():
  return static_file('home.html', root='./static/')
コード例 #45
0
ファイル: list_server.py プロジェクト: BenDoan/lists
def static(path):
    return static_file(path, root=get_script_rel_path("static"))
コード例 #46
0
ファイル: server.py プロジェクト: XanderStrike/redditredux
def asset(filename):
  return static_file(filename, root='./assets/')
コード例 #47
0
def static(filepath):
    return static_file(filepath, root="./static")
コード例 #48
0
def display_home():
    return static_file('index.html', root='./')
コード例 #49
0
 def staticfiles(filename):
     return bottle.static_file(filename, root='data/theme/')