def __init__(self, web_root=None): self.src_tmp = '/tmp/temp_web_server' if web_root: self.web_root = web_root else: self.web_root = self.src_tmp + '/html' self.html_file = Files.path_combine(self.web_root, 'index.html') self.port = Misc.random_number(10000, 60000) self.server_proc = None
def create_dashboard_with_test_data(self): self.create_dashboard_with_R1_R2() rows = 6 cells = 6 js_codes = [] for i in range(1, cells + 1): for j in range(1, rows + 1): r2_id = "r{0}_{1}".format(i, j) color = Misc.random_number(1, 5) #color = j self.js_apply_css_color(js_codes, r2_id, color) self.js_eval(js_codes) return self
def make_random_points(size=None, max=None): if size is None : size = 20 if max is None : max = 100 return [Misc.random_number(0,max) for _ in range(0,size)]