mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Work a bit more on tkinter demos.
This commit is contained in:
parent
19208900f4
commit
f19ff1ea7d
9 changed files with 99 additions and 90 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue