Exemplo n.º 1
0
 def set_active_generator(self, name):
     g = self._find_generator(name)
     if not g:
         if not generators.valid(name):
             return False
         g = self.objfac('Generator', name=name)
         self.add_generator(g)
     self.active_generator = g
     return True
Exemplo n.º 2
0
 def get(self):
     self.response.headers['Content-Type'] = "text/plain"      
     count = 0
     q = db.GqlQuery("SELECT from Style")
     offset = 0
     while True:
         styles = q.fetch(FETCHSET, offset=offset)
         offset += FETCHSET
         for style in styles:
             g = style.get_active_generator().me().get_name()
             if not generators.valid(g):
                 count += 1
                 style.set_active_generator('gradient')
                 style.put()
         # if len(styles) != FETCHSET:
         self.response.out.write("replaced %d instances" % count)
         return
     return