diff options
author | Georg Brandl <georg@python.org> | 2010-10-26 10:39:14 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-26 10:39:14 +0000 |
commit | f19ff1ea7dcc21776b939e02a481a1ddac3a8c8c (patch) | |
tree | d522816f9bf3e8a0bfc87e04a10f8b7ddce2975d /Demo/tkinter/guido/ss1.py | |
parent | 19208900f4c0e4a35a749029db7d54a8a0bda1e7 (diff) | |
download | cpython-f19ff1ea7dcc21776b939e02a481a1ddac3a8c8c.tar.gz cpython-f19ff1ea7dcc21776b939e02a481a1ddac3a8c8c.zip |
Work a bit more on tkinter demos.
Diffstat (limited to 'Demo/tkinter/guido/ss1.py')
-rw-r--r-- | Demo/tkinter/guido/ss1.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Demo/tkinter/guido/ss1.py b/Demo/tkinter/guido/ss1.py index a6c8c2181ed..8b074895e49 100644 --- a/Demo/tkinter/guido/ss1.py +++ b/Demo/tkinter/guido/ss1.py @@ -3,7 +3,7 @@ import os import re import sys -import cgi +import html from xml.parsers import expat LEFT, CENTER, RIGHT = "LEFT", "CENTER", "RIGHT" @@ -201,7 +201,7 @@ class Sheet: if hasattr(cell, 'xml'): cellxml = cell.xml() else: - cellxml = '<value>%s</value>' % cgi.escape(cell) + cellxml = '<value>%s</value>' % html.escape(cell) out.append('<cell row="%s" col="%s">\n %s\n</cell>' % (y, x, cellxml)) out.append('</spreadsheet>') @@ -216,7 +216,7 @@ class Sheet: f.close() def load(self, filename): - f = open(filename, 'r') + f = open(filename, 'rb') SheetParser(self).parsefile(f) f.close() @@ -382,7 +382,7 @@ class StringCell(BaseCell): return s % ( align2xml[self.alignment], self.fmt, - cgi.escape(self.text)) + html.escape(self.text)) class FormulaCell(BaseCell): |