pypy / dotviewer /

Armin Rigo ae5d5dc 

Armin Rigo 013f558 

Armin Rigo df5cadc 
Armin Rigo ae5d5dc 
Armin Rigo df5cadc 
Armin Rigo ae5d5dc 

Armin Rigo df5cadc 
Armin Rigo ae5d5dc 

Armin Rigo 592ae47 

Armin Rigo 013f558 
Armin Rigo 592ae47 

Armin Rigo ae5d5dc 

Maciej Fijalkows… 2192fca 

Armin Rigo ae5d5dc 

class GraphPage(object):
    """Base class for the client-side content of one of the 'pages'
    (one graph) sent over to and displayed by the external process.
    save_tmp_file = None

    def __init__(self, *args, **kwds):
        self.args = args
        self.kwds = kwds

    def content(self):
        """Compute the content of the page.
        This doesn't modify the page in place; it returns a new GraphPage.
        if hasattr(self, 'source'):
            return self
            new = self.__class__()
            new.source = ''  # '''dot source'''
            new.links  = {}  # {'word': 'statusbar text'}
            new.compute(*self.args, **self.kwds)   # defined in subclasses
            return new

    def followlink(self, word):
        raise KeyError

    def display(self):
        "Display a graph page."
        import graphclient, msgstruct
            graphclient.display_page(self, save_tmp_file=self.save_tmp_file)
        except msgstruct.RemoteError, e:
            import sys
            print >> sys.stderr, "Exception in the graph viewer:", str(e)

    def display_background(self):
        "Display a graph page in a background thread."
            import thread
            thread.start_new_thread(self.display, ())
        except ImportError:

class DotFileGraphPage(GraphPage):
    def compute(self, dotfile):
        f = open(dotfile, 'r')
        self.source =