Apply diff2.txt from SF patch http://www.python.org/sf/572113

(with one small bugfix in bgen/bgen/scantools.py)

This replaces string module functions with string methods
for the stuff in the Tools directory. Several uses of
string.letters etc. are still remaining.
This commit is contained in:
Walter Dörwald 2002-09-11 20:36:02 +00:00
parent 6a0477b099
commit aaab30e00c
70 changed files with 271 additions and 346 deletions

View file

@ -1,7 +1,6 @@
"""Assorted Tk-related subroutines used in Grail."""
import string
from types import *
from Tkinter import *
@ -335,7 +334,7 @@ def flatten(msg):
"""Turn a list or tuple into a single string -- recursively."""
t = type(msg)
if t in (ListType, TupleType):
msg = string.join(map(flatten, msg))
msg = ' '.join(map(flatten, msg))
elif t is ClassType:
msg = msg.__name__
else:
@ -345,7 +344,7 @@ def flatten(msg):
def boolean(s):
"""Test whether a string is a Tk boolean, without error checking."""
if string.lower(s) in ('', '0', 'no', 'off', 'false'): return 0
if s.lower() in ('', '0', 'no', 'off', 'false'): return 0
else: return 1