[pypy-dev] Pygame viewer

Armin Rigo arigo at tunes.org
Fri Jun 15 11:55:56 CEST 2007

Hi all,

I've refactored a bit the Pygame viewer.  Can people with OS/X or
Windows give it a try?  It is currently in the branch
pypy/branch/graphserver-dist/.  I'll merge it when I'm sure there are no
platform issues.  It is supposed to support the following features:

* all pygame usage is done in a subprocess, which cannot take away the
  whole parent process if it segfaults.

* regular usage should continue to work as before, e.g. t.view() in
  translatorshell.py, as well as the translate.py extended pdb+ commands
  like "classhier" to show the class hierarchy.

* closing the Pygame window now really closes it and shuts down the
  subprocess, instead of the previous hack that left the title bar of
  the window around just because it's not always possible to re-open
  Pygame in the same process.

* the tool should be really stand-alone now: if you check out only
  http://codespeak.net/svn/pypy/branch/graphserver-dist/dotviewer then
  the dotviewer.py included there should have no pypy or py lib
  dependency.  It should also contact the CGI script on codespeak
  automatically, to compile graphs if 'dot' is not installed locally.
  It won't install Pygame for you nor brew your coffee, though.

* I've kept the best for the end: *all* regular usage (t.view() and
  anything display graphs from translate.py) works remotely too.  Here's
  an example setup (pick your own port number instead of 8515):

  - on your local machine, run: 
        pypy/bin/dotviewer.py --server

  - connect to a remote machine, allowing the remote side to contact
    your local dotviewer:
        ssh -R8515:localhost:8515 machinename

  - set the $GRAPHSERVER env var on the remote machine to point to the
    redirected port: export GRAPHSERVER=:8515

  - then any graph-viewing command you execute while $GRAPHSERVER is set
    will reach your local dotviewer and basically appear to work
    completely transparently.

  - to automate steps 2 and 3, I've put the following entry in my local
                    Host wyvern
                        HostName wyvern.cs.uni-duesseldorf.de
                        Port 922
                        RemoteForward 8515

    (hence, please pick another port number, because if two people log
    in trying to redirect the port there is a conflict :-)

    and I've added the "export GRAPHSERVER=:8515" line to my .bashrc on

A bientot,


More information about the Pypy-dev mailing list