More Python2 migrations, patch from KA.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-01-21 00:04:37 +00:00
parent f86c833fe0
commit 76bad85642
11 changed files with 13 additions and 16 deletions

View File

@@ -7,7 +7,7 @@ will be created.
""" """
import sys, os, string, time import sys, os, time
KEEP_TEMPS = 0 KEEP_TEMPS = 0
ISCC = r"%s\InnoSetup2Ex\ISCC.exe %s" ISCC = r"%s\InnoSetup2Ex\ISCC.exe %s"
@@ -335,7 +335,7 @@ def find_DLLs():
proc.close() proc.close()
for line in lines: for line in lines:
if line[:6] == " wx": if line[:6] == " wx":
WXDLL = string.strip(line) WXDLL = line.strip()
if line[:10] == " python": if line[:10] == " python":
PYTHONVER = line[10] + '.' + line[11] PYTHONVER = line[10] + '.' + line[11]
@@ -370,7 +370,7 @@ def main():
# Starting with 2.3.3 the hybrid build is the release build too, so # Starting with 2.3.3 the hybrid build is the release build too, so
# no need to label it that way. # no need to label it that way.
##if string.find(WXDLL, "h") != -1: ##if WXDLL.find("h") != -1:
## PYVER = PYVER + "-hybrid" ## PYVER = PYVER + "-hybrid"
MSLU='' MSLU=''

View File

@@ -104,7 +104,7 @@ class MyCellEditor(wxPyGridCellEditor):
elif key < 256 and key >= 0 and chr(key) in string.printable: elif key < 256 and key >= 0 and chr(key) in string.printable:
ch = chr(key) ch = chr(key)
if not evt.ShiftDown(): if not evt.ShiftDown():
ch = string.lower(ch) ch = ch.lower()
if ch is not None: if ch is not None:
# Replace the text. Other option would be to append it. # Replace the text. Other option would be to append it.

View File

@@ -14,7 +14,7 @@ Have fun with it,
Harm van der Heijden (H.v.d.Heijden@phys.tue.nl)""" Harm van der Heijden (H.v.d.Heijden@phys.tue.nl)"""
import random,re,string import random,re
from wxPython.wx import * from wxPython.wx import *
class WordFetcher: class WordFetcher:

View File

@@ -1,5 +1,4 @@
from wxPython.wx import * from wxPython.wx import *
import string, sys
class Test: class Test:
def __init__(self): def __init__(self):

View File

@@ -3,7 +3,7 @@ Build a GUI Tree (wxWindows) from an XML file
using pyExpat using pyExpat
""" """
import sys,string import sys
from xml.parsers import pyexpat from xml.parsers import pyexpat
from wxPython.wx import * from wxPython.wx import *
@@ -59,7 +59,7 @@ def EndElement( name ):
def CharacterData ( data ): def CharacterData ( data ):
global NodeStack global NodeStack
if string.strip(data): if data.strip():
app.tree.AppendItem(NodeStack[-1],data) app.tree.AppendItem(NodeStack[-1],data)

View File

@@ -1,5 +1,4 @@
from wxPython.wx import * from wxPython.wx import *
import string
class floatValidator(wxPyValidator): class floatValidator(wxPyValidator):
@@ -24,7 +23,7 @@ class floatValidator(wxPyValidator):
if self.obj and self.attrName: if self.obj and self.attrName:
tc = wxPyTypeCast(self.GetWindow(), "wxTextCtrl") tc = wxPyTypeCast(self.GetWindow(), "wxTextCtrl")
text = tc.GetValue() text = tc.GetValue()
setattr(self.obj, self.attrName, string.atof(text)) setattr(self.obj, self.attrName, float(text))
return true return true

View File

@@ -20,7 +20,6 @@ Original comment follows below:
""" """
from wxPython import wx from wxPython import wx
import string
# Not everybody will have Numeric, so let's be cool about it... # Not everybody will have Numeric, so let's be cool about it...
try: try:

View File

@@ -62,7 +62,7 @@ class ParamBinaryOr(PPanel):
dlg = wxDialog(self, -1, 'Choices') dlg = wxDialog(self, -1, 'Choices')
topSizer = wxBoxSizer(wxVERTICAL) topSizer = wxBoxSizer(wxVERTICAL)
listBox = wxCheckListBox(dlg, -1, choices=self.values, size=(250,200)) listBox = wxCheckListBox(dlg, -1, choices=self.values, size=(250,200))
value = map(string.strip, string.split(self.text.GetValue(), '|')) value = map(string.strip, self.text.GetValue().split('|'))
if value == ['']: value = [] if value == ['']: value = []
ignored = [] ignored = []
for i in value: for i in value:

View File

@@ -672,7 +672,7 @@ class Frame(wxFrame):
except: except:
(etype, value, tb) =sys.exc_info() (etype, value, tb) =sys.exc_info()
tblist =traceback.extract_tb(tb)[1:] tblist =traceback.extract_tb(tb)[1:]
msg =string.join(traceback.format_exception_only(etype, value) msg =' '.join(traceback.format_exception_only(etype, value)
+traceback.format_list(tblist)) +traceback.format_list(tblist))
print msg print msg

View File

@@ -10,7 +10,7 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
import sys, os, glob, getopt, string import sys, os, glob, getopt
from wxPython.wx import * from wxPython.wx import *
if wxPlatform == "__WXGTK__": if wxPlatform == "__WXGTK__":
@@ -20,7 +20,7 @@ if wxPlatform == "__WXGTK__":
wxInitAllImageHandlers() wxInitAllImageHandlers()
def convert(file, maskClr, outputDir, outputName, outType, outExt): def convert(file, maskClr, outputDir, outputName, outType, outExt):
if string.lower(os.path.splitext(file)[1]) == ".ico": if os.path.splitext(file)[1].lower() == ".ico":
icon = wxIcon(file, wxBITMAP_TYPE_ICO) icon = wxIcon(file, wxBITMAP_TYPE_ICO)
img = wxBitmapFromIcon(icon) img = wxBitmapFromIcon(icon)
else: else:

View File

@@ -56,7 +56,7 @@ Options:
# #
import sys, os, glob, getopt, tempfile, string import sys, os, glob, getopt, tempfile
import cPickle, cStringIO, zlib import cPickle, cStringIO, zlib
import img2img import img2img
from wxPython import wx from wxPython import wx