コード例 #1
0
 def GET(self, url):
     url = config.raw_url + url
     raw = entryService.find_raw(url)
     if not raw == None:
         web.header('Context-Type', 'text/plain')
         web.header('Content-Encoding', 'utf-8')
         return raw
     params = entryService.archive(entryService.types.raw, url)
     if params.entries == None:
         raise web.notfound(render.error(params))
     return render.archive(params)
コード例 #2
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def GET(self, url):
     url = config.raw_url + url
     raw = entryService.find_raw(url)
     if not raw == None:
         web.header('Context-Type', 'text/plain')
         web.header('Content-Encoding','utf-8')
         return raw
     params = entryService.archive(entryService.types.raw, url)
     if params.entries  == None:
         raise web.notfound(render.error(params))
     return render.archive(params)
コード例 #3
0
ファイル: routes.py プロジェクト: tyjsee/YouMd
def PrivateRaw(url):
    url = config.raw_url + url
    raw = entryService.find_raw(url)
    if not raw == None:
        response.headers['Content-Type'] = 'text/plain'
        response.headers['Content-Encoding'] = 'utf-8'
        return raw.strip()
    params = entryService.archive(entryService.types.raw, url, private=True)
    if params.entries == None:
        return template('error', params=params, config=config)
    return template('private', params=params, config=config)
コード例 #4
0
ファイル: routes.py プロジェクト: MaloneQQ/YouMd
def Raw(url):
    url = config.raw_url + url
    raw = entryService.find_raw(url)
    if not raw == None:
        response.headers['Content-Type'] = 'text/plain'
        response.headers['Content-Encoding'] = 'utf-8'
        return raw.strip()
    params = entryService.archive(entryService.types.raw, url)
    if params.entries  == None:
        return template('error', params=params, config=config)
    return template('archive', params=params, config=config)
コード例 #5
0
ファイル: routes.py プロジェクト: JoneXiong/YouMd
def PrivateRaw(url):
    session = get_current_session()
    username = session.get('username', '')
    
    url = config.raw_url + url
    raw = entryService.find_raw(url)
    if not raw == None:
        response.headers['Content-Type'] = 'text/plain'
        response.headers['Content-Encoding'] = 'utf-8'
        return raw.strip()
    params = entryService.archive(entryService.types.raw, url, private=True, username=username)
    if params.entries == None:
        return template('error', params=params, config=config)
    return template('private', params=params, config=config)
コード例 #6
0
ファイル: routes.py プロジェクト: zhangliutian/YouMd
def PrivateRaw(url):
    session = get_current_session()
    username = session.get('username', '')

    url = config.raw_url + url
    raw = entryService.find_raw(url)
    if not raw == None:
        response.headers['Content-Type'] = 'text/plain'
        response.headers['Content-Encoding'] = 'utf-8'
        return raw.strip()
    params = entryService.archive(entryService.types.raw,
                                  url,
                                  private=True,
                                  username=username)
    if params.entries == None:
        return template('error', params=params, config=config)
    return template('private', params=params, config=config)
コード例 #7
0
 def GET(self, url):
     url = config.archive_url + url
     params = entryService.archive(entryService.types.entry, url)
     if params.entries == None:
         raise web.notfound(render.error(params))
     return render.archive(params)
コード例 #8
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def GET(self, url):
     url= config.archive_url + url
     params = entryService.archive(entryService.types.entry, url)
     if params.entries == None:
         raise web.notfound(render.error(params))
     return render.archive(params)
コード例 #9
0
ファイル: routes.py プロジェクト: tyjsee/YouMd
def Archive(url):
    url = config.archive_url + url
    params = entryService.archive(entryService.types.entry, url)
    if params.entries == None:
        return template('error', params=params, config=config)
    return template('archive', params=params, config=config)
コード例 #10
0
ファイル: routes.py プロジェクト: MaloneQQ/YouMd
def Archive(url):
    url= config.archive_url + url
    params = entryService.archive(entryService.types.entry, url)
    if params.entries == None:
        return template('error', params=params, config=config)
    return template('archive', params=params, config=config)