[pypy-svn] r44268 - in pypy/branch/graphserver-dist: dotviewer pypy/jit/codegen/i386
arigo at codespeak.net
arigo at codespeak.net
Fri Jun 15 10:49:46 CEST 2007
Author: arigo
Date: Fri Jun 15 10:49:46 2007
New Revision: 44268
Modified:
pypy/branch/graphserver-dist/dotviewer/graphclient.py
pypy/branch/graphserver-dist/dotviewer/graphparse.py
pypy/branch/graphserver-dist/dotviewer/graphserver.py
pypy/branch/graphserver-dist/dotviewer/msgstruct.py
pypy/branch/graphserver-dist/pypy/jit/codegen/i386/viewcode.py
Log:
Fix more imports. Support fixedfont.
Modified: pypy/branch/graphserver-dist/dotviewer/graphclient.py
==============================================================================
--- pypy/branch/graphserver-dist/dotviewer/graphclient.py (original)
+++ pypy/branch/graphserver-dist/dotviewer/graphclient.py Fri Jun 15 10:49:46 2007
@@ -70,7 +70,8 @@
def page_messages(page, graph_id):
import graphparse
- return graphparse.parse_dot(graph_id, page.source, page.links)
+ return graphparse.parse_dot(graph_id, page.source, page.links,
+ getattr(page, 'fixedfont', False))
def send_graph_messages(io, messages):
ioerror = None
Modified: pypy/branch/graphserver-dist/dotviewer/graphparse.py
==============================================================================
--- pypy/branch/graphserver-dist/dotviewer/graphparse.py (original)
+++ pypy/branch/graphserver-dist/dotviewer/graphparse.py Fri Jun 15 10:49:46 2007
@@ -60,7 +60,7 @@
result.append(word)
return result
-def parse_plain(graph_id, plaincontent, links={}):
+def parse_plain(graph_id, plaincontent, links={}, fixedfont=False):
lines = plaincontent.splitlines(True)
for i in range(len(lines)-2, -1, -1):
if lines[i].endswith('\\\n'): # line ending in '\'
@@ -106,13 +106,16 @@
yield (msgstruct.CMSG_ADD_LINK, word, statusbartext)
seen[word] = True
+ if fixedfont:
+ yield (msgstruct.CMSG_FIXED_FONT,)
+
yield (msgstruct.CMSG_STOP_GRAPH,)
-def parse_dot(graph_id, content, links={}):
+def parse_dot(graph_id, content, links={}, fixedfont=False):
try:
plaincontent = dot2plain(content, use_codespeak=False)
- return list(parse_plain(graph_id, plaincontent, links))
+ return list(parse_plain(graph_id, plaincontent, links, fixedfont))
except PlainParseError:
# failed, retry via codespeak
plaincontent = dot2plain(content, use_codespeak=True)
- return list(parse_plain(graph_id, plaincontent, links))
+ return list(parse_plain(graph_id, plaincontent, links, fixedfont))
Modified: pypy/branch/graphserver-dist/dotviewer/graphserver.py
==============================================================================
--- pypy/branch/graphserver-dist/dotviewer/graphserver.py (original)
+++ pypy/branch/graphserver-dist/dotviewer/graphserver.py Fri Jun 15 10:49:46 2007
@@ -86,6 +86,9 @@
info = (info[0], info[1:4])
self.newlayout.links[word] = info
+ def cmsg_fixed_font(self, *rest):
+ self.newlayout.fixedfont = True
+
def cmsg_stop_graph(self, *rest):
self.setlayout(self.newlayout)
del self.newlayout
@@ -103,6 +106,7 @@
msgstruct.CMSG_ADD_NODE: cmsg_add_node,
msgstruct.CMSG_ADD_EDGE: cmsg_add_edge,
msgstruct.CMSG_ADD_LINK: cmsg_add_link,
+ msgstruct.CMSG_FIXED_FONT: cmsg_fixed_font,
msgstruct.CMSG_STOP_GRAPH: cmsg_stop_graph,
msgstruct.CMSG_MISSING_LINK:cmsg_missing_link,
msgstruct.CMSG_SAY: cmsg_say,
Modified: pypy/branch/graphserver-dist/dotviewer/msgstruct.py
==============================================================================
--- pypy/branch/graphserver-dist/dotviewer/msgstruct.py (original)
+++ pypy/branch/graphserver-dist/dotviewer/msgstruct.py Fri Jun 15 10:49:46 2007
@@ -8,6 +8,7 @@
CMSG_ADD_NODE = 'n'
CMSG_ADD_EDGE = 'e'
CMSG_ADD_LINK = 'l'
+CMSG_FIXED_FONT = 'f'
CMSG_STOP_GRAPH = ']'
CMSG_MISSING_LINK= 'm'
CMSG_SAY = 's'
Modified: pypy/branch/graphserver-dist/pypy/jit/codegen/i386/viewcode.py
==============================================================================
--- pypy/branch/graphserver-dist/pypy/jit/codegen/i386/viewcode.py (original)
+++ pypy/branch/graphserver-dist/pypy/jit/codegen/i386/viewcode.py Fri Jun 15 10:49:46 2007
@@ -288,7 +288,7 @@
# but needs to be a bit more subtle later
from pypy.translator.tool.make_dot import DotGen
-from pypy.translator.tool.pygame.graphclient import display_layout
+from dotviewer.graphclient import display_page
class Graph(DotGen):
@@ -302,7 +302,7 @@
def display(self):
"Display a graph page locally."
- display_layout(_Page(self))
+ display_page(_Page(self))
class NoGraph(Exception):
More information about the pypy-svn
mailing list