Ejemplo n.º 1
0
 def POST(self):
     global taxes
     with open(settings.taxonomy_path, 'w') as f:
         try:
             x = web.input(myfile={})
             taxes = [taxonomy.parse_xml(x['myfile'].file)]
             raise web.seeother("/static/index.html")
         except Exception as e:
             taxes = []
             raise web.seeother("/static/index.html?%s" % e.message)
         finally:
             cPickle.dump(taxes, f)
             map_terms()
Ejemplo n.º 2
0
 def POST(self, id):
     form = self.form()
     anime = anidb.query(anidb.QUERY_ANIME, int(id))
     if not form.validates():
         return render.add(form, anime)
     metadata.newAnime(anime, form.d.subber, form.d.location, form.d.airTime, form.d.quality)
     raise web.seeother('/anime/%s' % int(id))
Ejemplo n.º 3
0
 def POST(self, id):
     form = self.form()
     anime = anidb.query(anidb.QUERY_ANIME, int(id))
     if not form.validates():
         return render.add(form, anime)
     metadata.newAnime(anime, form.d.subber, form.d.location, form.d.quality)
     raise web.seeother('/anime/%s' % int(id))
Ejemplo n.º 4
0
 def GET(self, id):
     metadata.refreshForAnime(int(id))
     raise web.seeother('/anime/%s' % id)
Ejemplo n.º 5
0
 def GET(self, id):
     model.remove_anime(id)
     raise web.seeother('/')
Ejemplo n.º 6
0
def manage_interceptor(next):
    user = ctx.request.user
    if user and user.admin:
        return next()
    raise seeother('/signin')
Ejemplo n.º 7
0
def manage_index():
    raise seeother('/manage/blogs')
Ejemplo n.º 8
0
def signout():
    ctx.response.delete_cookie(_COOKIE_NAME)
    raise seeother('/')
Ejemplo n.º 9
0
 def GET(self):
     raise web.seeother(settings.root_url)
Ejemplo n.º 10
0
def manage_interceptor(next):
    user = ctx.request.user
    if user and user.admin:
        return next()
    raise seeother('/signin')
Ejemplo n.º 11
0
def manage_index():
    raise seeother('/manage/blogs')
Ejemplo n.º 12
0
def signout():
    ctx.response.delete_cookie(_COOKIE_NAME)
    raise seeother('/')
Ejemplo n.º 13
0
 def GET(self, id):
     metadata.refreshForAnime(int(id))
     raise web.seeother('/anime/%s' % id)
Ejemplo n.º 14
0
 def GET(self, id):
     model.remove_anime(id)
     raise web.seeother('/')