devtools/testlib.py
changeset 10614 57dfde80df11
parent 10612 84468b90e9c1
child 10621 987fbc88f097
equal deleted inserted replaced
10613:8d9fe02387e3 10614:57dfde80df11
    61     html into a temporary file and open a web browser to examinate it.
    61     html into a temporary file and open a web browser to examinate it.
    62     """
    62     """
    63     def do_view(self, arg):
    63     def do_view(self, arg):
    64         import webbrowser
    64         import webbrowser
    65         data = self._getval(arg)
    65         data = self._getval(arg)
    66         with file('/tmp/toto.html', 'w') as toto:
    66         with open('/tmp/toto.html', 'w') as toto:
    67             toto.write(data)
    67             toto.write(data)
    68         webbrowser.open('file:///tmp/toto.html')
    68         webbrowser.open('file:///tmp/toto.html')
    69 
    69 
    70 def line_context_filter(line_no, center, before=3, after=None):
    70 def line_context_filter(line_no, center, before=3, after=None):
    71     """return true if line are in context
    71     """return true if line are in context