def __init__(self, cfg, theme, info_bar, xdot ): super(xupdater, self).__init__() self.quit = False self.focus_start_ctime = None self.focus_stop_ctime = None self.xdot = xdot self.first_update = False self.graph_disconnect = False self.action_required = True self.oldest_ctime = None self.newest_ctime = None self.orientation = "TB" # Top to Bottom ordering of nodes, by default. self.best_fit = False # If True, xdot will zoom to page size self.normal_fit = False # if True, xdot will zoom to 1.0 scale self.crop = False self.filter_include = None self.filter_exclude = None self.state_filter = None self.families = [] self.family_nodes = [] self.graphed_family_nodes = [] self.live_graph_movie = False self.prev_graph_id = () self.cfg = cfg self.theme = theme self.info_bar = info_bar self.stop_summary = None self.god = None self.mode = "waiting..." self.dt = "waiting..." self.status = None self.poll_schd = PollSchd() # empty graphw object: self.graphw = graphing.CGraphPlain( self.cfg.suite ) self.reconnect() # TO DO: handle failure to get a remote proxy in reconnect() self.graph_warned = {} self.group = [] self.ungroup = [] self.ungroup_recursive = False self.group_all = False self.ungroup_all = False self.graph_frame_count = 0
class xupdater(threading.Thread): def __init__(self, cfg, theme, info_bar, xdot ): super(xupdater, self).__init__() self.quit = False self.focus_start_ctime = None self.focus_stop_ctime = None self.xdot = xdot self.first_update = False self.graph_disconnect = False self.action_required = True self.oldest_ctime = None self.newest_ctime = None self.orientation = "TB" # Top to Bottom ordering of nodes, by default. self.best_fit = False # If True, xdot will zoom to page size self.normal_fit = False # if True, xdot will zoom to 1.0 scale self.crop = False self.filter_include = None self.filter_exclude = None self.state_filter = None self.families = [] self.family_nodes = [] self.graphed_family_nodes = [] self.live_graph_movie = False self.prev_graph_id = () self.cfg = cfg self.theme = theme self.info_bar = info_bar self.stop_summary = None self.god = None self.mode = "waiting..." self.dt = "waiting..." self.status = None self.poll_schd = PollSchd() # empty graphw object: self.graphw = graphing.CGraphPlain( self.cfg.suite ) self.reconnect() # TO DO: handle failure to get a remote proxy in reconnect() self.graph_warned = {} self.group = [] self.ungroup = [] self.ungroup_recursive = False self.group_all = False self.ungroup_all = False self.graph_frame_count = 0 def reconnect( self ): self.prev_graph_id = () try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.sinfo = client.get_proxy( 'suite-info' ) # on reconnection retrieve static info self.family_nodes = self.sinfo.get( 'family nodes' ) self.graphed_family_nodes = self.sinfo.get( 'graphed family nodes' ) self.families = self.sinfo.get( 'first-parent descendants' ) self.live_graph_movie, self.live_graph_dir = self.sinfo.get( 'do live graph movie' ) except: # connection lost if self.stop_summary is None: self.stop_summary = dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) if self.stop_summary is not None and any(self.stop_summary): self.info_bar.set_stop_summary(self.stop_summary) return False else: self.stop_summary = None self.status = "connected" self.first_update = True self.info_bar.set_status( self.status ) if self.live_graph_movie: try: mkdir_p( self.live_graph_dir ) except Exception, x: print >> sys.stderr, x print >> sys.stderr, "Disabling live graph movie" self.live_graph_movie = False self.first_update = True self.status = "connected" self.poll_schd.stop() self.info_bar.set_status( self.status ) return True