def graph(start_with, end_with, details): g = signals.detailed_connection_graph(start_with=start_with, end_with=end_with, details=details) nx.nx_pydot.write_dot(g, 'graph.dot') fabric_api.local('dot -Tsvg graph.dot -o graph.svg')
def graph(start_with, end_with, details): g = signals.detailed_connection_graph(start_with=start_with, end_with=end_with, details=details) nx.nx_pydot.write_dot(g, 'graph.dot') fabric_api.local('dot -Tsvg graph.dot -o graph.svg')
def graph(end_with, start_with): #g = xs.connection_graph() g = signals.detailed_connection_graph(start_with=start_with, end_with=end_with) nx.write_dot(g, 'graph.dot') fabric_api.local('dot -Tpng graph.dot -o graph.png')
def stage_changes(): log = data.SL() log.clean() conn_graph = signals.detailed_connection_graph() staged = {r.name: r.args_show() for r in resource.load_all().values()} commited = data.CD() return _stage_changes(staged, conn_graph, commited, log)
def test_all(): results = {} conn_graph = signals.detailed_connection_graph() #srt = nx.topological_sort(conn_graph) for name in conn_graph: log.debug('Trying {}'.format(name)) r = resource.load(name) script_path = os.path.join(r.metadata['base_path'], 'test.py') if not os.path.exists(script_path): log.warning('resource {} has no tests'.format(name)) continue log.debug('File {} found'.format(script_path)) with open(script_path) as f: module = imp.load_module( '{}_test'.format(name), f, script_path, ('', 'r', imp.PY_SOURCE) ) try: module.test(r) results[name] = { 'status': 'ok', } except Exception: results[name] = { 'status': 'error', 'message': traceback.format_exc(), } return results