示例#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
 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
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)