예제 #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)
예제 #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
 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)