Beispiel #1
0
 def get(self):
     if KangExtension().check(self) == False: return
     branch = qs_branch(self)
     device = qs_device(self)
     kang = qs_kang_name(self)
     kangId = qs_kang_id(self)
     
     kangs = Change.gql("WHERE branch = :branch AND project = 'KANG'", branch=branch)
     
     cmd_done = 0
     self.response.headers['Content-Type'] = 'text/html; charset=UTF-8'
     self.response.out.write("<h2>New KANG name '"+kang+"'</h2>\n")
     self.response.out.write("<table>")
     self.response.out.write("<thead><tr><td>id (click to rename)</td><td>info</td><td>branch</td><td>subject</td><td>project</td><td>last_updated</td></tr></thead><tbody>")
     for k in kangs:
         self.response.out.write('<tr><td><a href="/rename_kang-off/?branch='+k.branch+'&kang='+kang+'--NewName&kangId='+str(k.id)+'">'+str(k.id)+'</a></td><td>Checking KANG</td><td>'+k.branch+'</td><td>'+k.subject+'</td><td>'+k.project+'</td><td>'+str(k.last_updated)+'</td></tr>\n')
         if (str(k.id) == kangId):
             old_name = k.subject
             k.subject = kang+"#dev:"+device
             k.put()
             memcache_delete_multi(['last_changes', 'filtered'])
             self.response.out.write('<tr><td><a href="">'+str(k.id)+'</a></td><td>Renamed KANG (old: '+old_name+'; new: '+kang+')</td><td>'+k.branch+'</td><td>'+k.subject+'</td><td>'+k.project+'</td><td>'+str(k.last_updated)+'</td></tr>\n')
             cmd_done = 1
             break
     self.response.out.write("</tbody></table>")
     
     if cmd_done == 0:
         self.response.out.write("<h2>KANG not found: "+kangId+"</h2>\n")
Beispiel #2
0
 def get(self):
     if KangExtension().check(self) == False: return
     kang = qs_kang_name(self)
     kangId = qs_kang_id(self)
     branch = qs_branch(self)
     
     kangs = Change.gql("WHERE project = 'KANG' AND branch=:branch", branch=branch)
     
     cmd_done = 0;
     self.response.headers['Content-Type'] = 'text/html; charset=UTF-8'
     self.response.out.write("<table>")
     self.response.out.write("<thead><tr><td>id (click to rename)</td><td>info</td><td>branch</td><td>subject</td><td>project</td><td>last_updated</td></tr></thead><tbody>")
     for k in kangs:
         self.response.out.write('<tr><td><a href="/remove_kang-off/?branch='+k.branch+'&kang='+kang+'&kangId='+str(k.id)+'">'+str(k.id)+'</a></td><td>Checking KANG</td><td>'+k.branch+'</td><td>'+k.subject+'</td><td>'+k.project+'</td><td>'+str(k.last_updated)+'</td></tr>\n')
         if (k.subject == kang) or (str(k.id) == kangId):
             db.delete(k)
             memcache_delete_multi(['last_changes', 'filtered'])
             self.response.out.write('<tr><td>'+str(k.id)+'</td><td>Removed KANG</td><td>'+k.branch+'</td><td>'+k.subject+'</td><td>'+k.project+'</td><td>'+str(k.last_updated)+'</td></tr>\n')
             cmd_done = 1;
             break
     self.response.out.write("</tbody></table>")
     
     if cmd_done == 0:
         self.response.out.write("<h2>KANG not found: "+kangId+" - '"+kang+"'</h2>\n")