Beispiel #1
0
 def get(self, directory, file_name, test_path):
     try:
         # print 'browser id =', 'new'
         # print 'useragent', self.request.headers.get("User-Agent")
         # print 'page url =', self.request.headers.get("Referer","??")
         # print 'pipeline =', 'na'
         # print 'page stage', 'loaded vs poll no vs other'
         path = join(directory,'verify')
         verify = VerifySource.get(path,file_name[:-3])
         if not verify.source:
             raise tornado.web.HTTPError(404)
         
         self.write(verify.render(xsrf_token = self.xsrf_token, arguments = self.request.arguments))
         VerifySource.discard(path,file_name[:-3]) #TODO configure in application settings, drop-js-cache
     except Exception,e:
         print e
         import traceback; traceback.print_exc()
Beispiel #2
0
    def get(self, file_name, test_path):
        try:
            source = self.getSource(file_name)
            src = join(structure.JS_DIR,file_name,'verify')
            if not isdir(src):
                raise tornado.web.HTTPError(404)

            specs = VerifySource.list(src)
            #TODO if index.html exists use that
            self.render("verify/index.html", 
                title="Specs for %s - %s" % (file_name,test_path), 
                reload_url='../verify/',
                source = source, specs = specs)
        except Exception,e:
            print e
Beispiel #3
0
 def post(self, directory, file_name, test_path):
     try:
         results = VerifySource.posted_results(self.request.arguments)
         # print 'posted results: ', directory, file_name, results
         info = {
             "SITE_TITLE": "pagespec.com",
             "MEDIA_URL": "",
             "messages": None,
             "reload_url": "../verify/",
             "title": "Results for %s %s" % (directory,file_name),
             "parts": [self.split_part(key,val) for key,val in results]
         }
         self.render("verify/results.html",**info)
     except Exception,e:
         print e
         import traceback; traceback.print_exc()