def create_graph(self, nodes, edges,options=None):
        self.web_server.start()
        url = self.web_server.url(self.web_page)

        self.render_page.get_page_html_via_browser(url)

        self.load_page(True)
        layout = {
                    "springLength" : 100,
                    "springCoeff"  : 0.0008,
                    "dragCoeff"    : 0.02,
                    "gravity"      : -10.2
                 };

        self.invoke_js("set_layout",layout)
        js_code = ""
        #for key,issue in nodes.items():
        for node in nodes:
            key   = node.get('key')
            label = node.get('label')
            img   = node.get('img')
            params = { "label" : label, "img": img}
            js_code += 'graph.addNode("{0}",{1});'.format(key,Misc.json_dumps(params))
        for edge in edges:
            js_code += 'graph.addLink("{0}","{1}");\n'.format(edge[0],edge[2])
        js_code += "run_graph()"
        self.exec_js(js_code)
        self.web_server.stop()
        return 42
 def request_put(self, path, data):
     json_data = Misc.json_dumps(data)
     (server, username, password) = self.config()
     path = '{0}/rest/api/2/{1}'.format(server, path)
     headers = {'Content-Type': 'application/json'}
     response = requests.put(path,
                             json_data,
                             headers=headers,
                             auth=(username, password))
     if 200 <= response.status_code < 300:
         return True
     Dev.pprint('[Error][request_put]: {0}'.format(response.text))
     return False