Beispiel #1
0
 def get(self):
     platform = self.request.get("platform")
     version = int(self.request.get("version"))
     pathname = self.request.get("pathname")
     clientfile = ClientFile.get(client_file_key(platform, version, pathname))
     self.response.headers["Content-type"] = "text/html"
     self.response.out.write(clientfile.content)
Beispiel #2
0
 def post(self):
     values = {}
     pathname = self.request.get("pathname")
     version = int(self.request.get("version"))
     platform = self.request.get("platform")
     content = self.request.get("content")
     clientfile = ClientFile(key_name = client_file_key_name(platform, version, pathname), 
             pathname = pathname,
             version = version,
             platform = platform,
             content = content
             )
     clientfile.put()
     self.render("ClientContentUpload.html", values)
     
     
Beispiel #3
0
 def get(self):
     pathname = self.request.get("pathname")
     platform = self.request.get("platform")
     if pathname:
         q = ClientFile.all()
         q.filter("platform =", platform)
         q.filter("pathname =", pathname)
         q.order("-version")
         f = q.fetch(1)
         if len(f) == 0:
             self.response.out.write(-1)
         else:
             self.response.out.write(f[0].version)
     else:
         q = ClientVersion.all()
         q.filter("platform =", platform)
         q.order("-version")
         f = q.fetch(1)
         if len(f) == 0:
             self.response.out.write("-1")
         else:
             self.response.out.write('{"version":%s, "url": "%s"}' % (f[0].version, f[0].url))