コード例 #1
0
ファイル: diff.py プロジェクト: awalon/gae-cm-nightlies
 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")
コード例 #2
0
ファイル: diff.py プロジェクト: awalon/gae-cm-nightlies
 def get(self):
     if KangExtension().check(self) == False: return
     kang = qs_kang_name(self)
     branch = qs_branch(self)
     device = qs_device(self)
     
     change = Change(id=int(time.time() * -1),
             branch = branch,
             project = 'KANG',
             subject = kang+'#dev:'+device,
             last_updated = time.strftime('%Y-%m-%d %H:%M:%S.000000000', time.gmtime(time.time()))
             )
     change.put()
     memcache_delete_multi(['last_changes', 'filtered'])
     self.response.headers['Content-Type'] = 'text/plain; charset=UTF-8'
     self.response.out.write("KEY: '"+str(change.key().id())+"'\n")
     self.response.out.write("Added KANG: '"+kang+"'\n")
コード例 #3
0
ファイル: diff.py プロジェクト: awalon/gae-cm-nightlies
 def get(self):
     kang = qs_kang_name(self)
     branch = qs_branch(self)
     device = qs_device(self)
     lc = LastChanges().get(branch)
     
     self.response.headers['Content-Type'] = 'text/plain; charset=UTF-8'
     status = 200
     for c in lc:
         if c.project == 'KANG' and re.search("^"+kang+"(#dev:"+device+")?$", c.subject):
             status = 201
             break
         elif c.project != 'KANG':
             break
     self.response.out.write("Changes available ("+str(status)+"): ")
     if status == 200:
         self.response.out.write("yes")
     else:
         self.response.out.write("no")
     self.response.out.write("\n")
     
     self.response.set_status(status)
     return status
コード例 #4
0
ファイル: diff.py プロジェクト: awalon/gae-cm-nightlies
 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")