예제 #1
0
def load_and_save(src_path, out_path=None, use_cache=True):
    mkdir_if_not(out_path)

    data = load(src_path, use_cache)
    data.save(join(src_path, '_cache.json'))

    copy_images(data, join(out_path, cfg.img_dir))

    data.remove_keys_startswith('_')
    data.save(join(out_path, cfg.sturct_filename), 'var full_data= ')
예제 #2
0
 def get(self):
     self.set_header('Content-Type', 'application/json')
     self.write(dumps(load(cfg.img_dir, True)))
예제 #3
0
 def render_POST(self, request):
     tmpl = loader.load('index.html') 
     self.log.setLevel( getattr(logging, str(request.args["logLevel"][0]).upper()) );
     stream = tmpl.generate(log=self.log.currentLog, counts=self.counter.getCounts(), currentLevel=logging.getLevelName(self.log.level))
     return stream.render('html', doctype='html').encode('utf-8')
예제 #4
0
 def render_GET(self, request):
     tmpl = loader.load('config.html')
     stream = tmpl.generate(config=_config)
     return stream.render('html', doctype='html').encode('utf-8')
예제 #5
0
 def render_GET(self, request):
     tmpl = loader.load('index.html')
     stream = tmpl.generate(log=self.log.currentLog, counts=self.counter.getCounts(), currentLevel=logging.getLevelName(self.log.level))
     return stream.render('html', doctype='html').encode('utf-8')