Some fixes and cleanups
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
|
||||
from wxPython.wx import *
|
||||
from wxPython.lib.colourselect import *
|
||||
import string
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@@ -86,7 +85,7 @@ class TestColourSelect(wxPanel):
|
||||
colour = button.GetColour() # get the colour selection button result
|
||||
result.append(name + ": " + str(colour)) # create string list for easy viewing of results
|
||||
|
||||
out_result = string.joinfields(result, ', ')
|
||||
out_result = ', '.join(result)
|
||||
self.log.WriteText("Colour Results: " + out_result + "\n")
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
@@ -36,6 +36,5 @@ def runTest(frame, nb, log):
|
||||
|
||||
|
||||
|
||||
import string
|
||||
overview = string.replace(fancytext.__doc__, "<", "<")
|
||||
overview = fancytext.__doc__.replace("<", "<")
|
||||
|
||||
|
@@ -1,8 +1,6 @@
|
||||
from wxPython.wx import *
|
||||
from wxPython.grid import *
|
||||
|
||||
import string
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class CustomDataTable(wxPyGridTableBase):
|
||||
@@ -93,7 +91,7 @@ class CustomDataTable(wxPyGridTableBase):
|
||||
# editor and renderer. This allows you to enforce some type-safety
|
||||
# in the grid.
|
||||
def CanGetValueAs(self, row, col, typeName):
|
||||
colType = string.split(self.dataTypes[col], ':')[0]
|
||||
colType = self.dataTypes[col].split(':')[0]
|
||||
if typeName == colType:
|
||||
return true
|
||||
else:
|
||||
|
@@ -20,6 +20,7 @@ cvsroot=:pserver:anoncvs@cvs.wxwindows.org:/pack/cvsroots/wxwindows
|
||||
pythonbin=/usr/bin/python
|
||||
port=GTK
|
||||
lcport=gtk
|
||||
unicode=0
|
||||
tarname=wxPythonSrc
|
||||
|
||||
|
||||
@@ -38,6 +39,7 @@ function useage {
|
||||
echo " skiptar Don't build the tarball"
|
||||
echo " skiprpm Don't build the RPM (but why?)"
|
||||
echo " skipclean Don't do the cleanup at the end"
|
||||
echo " gtk2 Build using wxGTK2 and Unicode"
|
||||
echo " speconly Do nothing but write the RPM spec file"
|
||||
echo " smp Add SMP=2 to the envivonment to speed wxGTK build"
|
||||
}
|
||||
@@ -73,6 +75,7 @@ function makespec {
|
||||
| sed s:@TARNAME@:${tarname}:g \
|
||||
| sed s:@VERSION@:${version}:g \
|
||||
| sed s:@VER2@:${ver2}:g \
|
||||
| sed s:@UNICODE@:${unicode}:g \
|
||||
> ${distdir}/wxPython${port}.spec
|
||||
}
|
||||
|
||||
@@ -80,12 +83,13 @@ function makespec {
|
||||
|
||||
for flag in $*; do
|
||||
case ${flag} in
|
||||
skipcvs) skipcvs=1 ;;
|
||||
skipclean) skipclean=1 ;;
|
||||
skiptar) skiptar=1 ;;
|
||||
skiprpm) skiprpm=1 ;;
|
||||
smp) export SMP=2 ;;
|
||||
speconly) makespec; exit 0 ;;
|
||||
skipcvs) skipcvs=1 ;;
|
||||
skipclean) skipclean=1 ;;
|
||||
skiptar) skiptar=1 ;;
|
||||
skiprpm) skiprpm=1 ;;
|
||||
gtk2) unicode=1; port=GTK2; lcport=gtk2 ;;
|
||||
smp) export SMP=2 ;;
|
||||
speconly) makespec; exit 0 ;;
|
||||
|
||||
*) echo "Unknown flag \"${flag}\""
|
||||
useage
|
||||
|
@@ -3,6 +3,7 @@
|
||||
%define pyver @PYVER@
|
||||
%define port @PORT@
|
||||
%define lcport @LCPORT@
|
||||
%define unicode @UNICODE@
|
||||
%define tarname @TARNAME@
|
||||
%define version @VERSION@
|
||||
%define ver2 @VER2@
|
||||
@@ -10,13 +11,16 @@
|
||||
%define wxpref %{pref}/lib/wxPython
|
||||
%define name wxPython%{port}-py%{pyver}
|
||||
|
||||
# Should the builtin image and etc. libs be used, or system libs?
|
||||
# Distro specific RPMs should probably set this to 0, generic ones
|
||||
# should use 1
|
||||
%define builtin_libs 1
|
||||
|
||||
# Should --enable-debug_flag be used in release builds?
|
||||
# Using it defines __WXDEBUG__ and gives us runtime diagnostics
|
||||
# that are turned into Python exceptions starting with 2.3.4.
|
||||
%define debug_flag 1
|
||||
|
||||
|
||||
|
||||
%if %{debug_flag}
|
||||
%define wxconfigname %{wxpref}/bin/wx%{lcport}d-%{ver2}-config
|
||||
%else
|
||||
@@ -91,16 +95,21 @@ $WXDIR/configure --with-%{lcport} \
|
||||
--disable-soname \
|
||||
--enable-rpath=%{wxpref}/lib \
|
||||
--with-opengl \
|
||||
%if %{unicode}
|
||||
--enable-gtk2 \
|
||||
--enable-unicode \
|
||||
%endif
|
||||
--enable-geometry \
|
||||
--enable-optimise \
|
||||
%if %{debug_flag}
|
||||
--enable-debug_flag \
|
||||
%endif
|
||||
%if %{builtin_libs}
|
||||
--with-libjpeg=builtin \
|
||||
--with-libpng=builtin \
|
||||
--with-libtiff=builtin \
|
||||
--with-zlib=builtin \
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
# Build wxWindows
|
||||
|
@@ -449,7 +449,7 @@ class MessageAdapter:
|
||||
def notify(self, message):
|
||||
event = message.data # Extract the wxEvent
|
||||
self.eventHandler(event) # Perform the call as wxWindows would
|
||||
event.Skip(1) # Make sure Skip(1) wasn't set. ##????
|
||||
##event.Skip(1) # Make sure Skip(1) wasn't set. ##????
|
||||
|
||||
|
||||
def Destroy(self):
|
||||
|
@@ -350,7 +350,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
|
||||
x, y = self.DC.GetTextExtent("W")
|
||||
self.space = y
|
||||
|
||||
if self.total_pages == None:
|
||||
if self.total_pages is None:
|
||||
self.GetTotalPages() # total pages for display/printing
|
||||
|
||||
self.data_cnt = self.page_index[self.page-1]
|
||||
@@ -500,7 +500,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
|
||||
col = 0
|
||||
for colour in self.column_bgcolour:
|
||||
cellcolour = self.GetCellColour(self.data_cnt, col)
|
||||
if cellcolour != None:
|
||||
if cellcolour is not None:
|
||||
colour = cellcolour
|
||||
|
||||
brush = wxBrush(colour, wxSOLID)
|
||||
@@ -527,7 +527,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
|
||||
|
||||
fcolour = self.column_txtcolour[self.col] # set font colour
|
||||
celltext = self.GetCellText(self.data_cnt, self.col)
|
||||
if celltext != None:
|
||||
if celltext is not None:
|
||||
fcolour = celltext # override the column colour
|
||||
|
||||
self.DC.SetTextForeground(fcolour)
|
||||
@@ -800,30 +800,30 @@ class PrintTable:
|
||||
def SetHeader(self, text = "", type = "Text", font=None, align = None, indent = None, colour = None, size = None):
|
||||
set = { "Text": text }
|
||||
|
||||
if font == None:
|
||||
if font is None:
|
||||
set["Font"] = copy.copy(self.default_font)
|
||||
else:
|
||||
set["Font"] = font
|
||||
|
||||
if colour != None:
|
||||
if colour is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Colour"] = self.GetColour(colour)
|
||||
|
||||
if size != None:
|
||||
if size is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Size"] = size
|
||||
|
||||
if align == None:
|
||||
if align is None:
|
||||
set["Align"] = self.header_align
|
||||
else:
|
||||
set["Align"] = align
|
||||
|
||||
if indent == None:
|
||||
if indent is None:
|
||||
set["Indent"] = self.header_indent
|
||||
else:
|
||||
set["Indent"] = indent
|
||||
|
||||
if type == None:
|
||||
if type is None:
|
||||
set["Type"] = self.header_type
|
||||
else:
|
||||
set["Type"] = type
|
||||
@@ -833,30 +833,30 @@ class PrintTable:
|
||||
def SetFooter(self, text = "", type = None, font=None, align = None, indent = None, colour = None, size = None):
|
||||
set = { "Text": text }
|
||||
|
||||
if font == None:
|
||||
if font is None:
|
||||
set["Font"] = copy.copy(self.default_font)
|
||||
else:
|
||||
set["Font"] = font
|
||||
|
||||
if colour != None:
|
||||
if colour is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Colour"] = self.GetColour(colour)
|
||||
|
||||
if size != None:
|
||||
if size is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Size"] = size
|
||||
|
||||
if align == None:
|
||||
if align is None:
|
||||
set["Align"] = self.footer_align
|
||||
else:
|
||||
set["Align"] = align
|
||||
|
||||
if indent == None:
|
||||
if indent is None:
|
||||
set["Indent"] = self.footer_indent
|
||||
else:
|
||||
set["Indent"] = indent
|
||||
|
||||
if type == None:
|
||||
if type is None:
|
||||
set["Type"] = self.footer_type
|
||||
else:
|
||||
set["Type"] = type
|
||||
@@ -956,9 +956,9 @@ class PrintTable:
|
||||
|
||||
class PrintGrid:
|
||||
def __init__(self, parent, grid, format = [], total_col = None, total_row = None):
|
||||
if total_row == None:
|
||||
if total_row is None:
|
||||
total_row = grid.GetNumberRows()
|
||||
if total_col == None:
|
||||
if total_col is None:
|
||||
total_col = grid.GetNumberCols()
|
||||
|
||||
self.total_row = total_row
|
||||
|
Reference in New Issue
Block a user