Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
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)
Exemplo n.º 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)