jwrdegoede pushed to londonlaw (master). "New upstream: https://github.com/anyc/londonlaw (..more)"
notifications at fedoraproject.org
notifications at fedoraproject.org
Mon May 18 13:09:26 UTC 2015
From b9e4a248506ec312b3d6b46005335c31d6b4eeb0 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede at redhat.com>
Date: Mon, 18 May 2015 15:09:18 +0200
Subject: New upstream: https://github.com/anyc/londonlaw
- Update to new upstream 0.3.0-pre2 release
diff --git a/.gitignore b/.gitignore
index 5f727cc..2d7111b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
londonlaw-0.2.1.tar.gz
+/v0.3.0_pre2.tar.gz
diff --git a/londonlaw-0.2.1-new-twisted.patch b/londonlaw-0.2.1-new-twisted.patch
deleted file mode 100644
index 576c181..0000000
--- a/londonlaw-0.2.1-new-twisted.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -up londonlaw-0.2.1/londonlaw/server/Game.py~ londonlaw-0.2.1/londonlaw/server/Game.py
---- londonlaw-0.2.1/londonlaw/server/Game.py~ 2007-09-23 10:34:43.000000000 +0200
-+++ londonlaw-0.2.1/londonlaw/server/Game.py 2007-09-23 10:34:43.000000000 +0200
-@@ -20,6 +20,7 @@ import sets
-
- from twisted.python import components
- from twisted.python import log
-+from zope import interface
-
- from londonlaw.common.protocol import *
- from londonlaw.common.map import *
-@@ -32,7 +33,7 @@ class GameError(Exception):
- pass
-
-
--class IGameListener(components.Interface):
-+class IGameListener(interface.Interface):
- def announceHistory(self, history):
- pass
-
diff --git a/londonlaw.spec b/londonlaw.spec
index f0b0245..4fd544b 100644
--- a/londonlaw.spec
+++ b/londonlaw.spec
@@ -1,17 +1,15 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: londonlaw
-Version: 0.2.1
-Release: 18%{?dist}
+Version: 0.3.0
+Release: 0.1.pre2%{?dist}
Summary: Online multiplayer version of a well known detective boardgame
License: GPLv2
Group: Amusements/Games
-URL: http://pessimization.com/software/londonlaw/
-Source0: http://pessimization.com/software/%{name}/%{name}-%{version}.tar.gz
+URL: http://github.com/anyc/londonlaw
+Source0: http://github.com/anyc/londonlaw/archive/v0.3.0_pre2.tar.gz
Source1: %{name}.desktop
Source2: %{name}-server.desktop
-Patch0: londonlaw-0.2.1-new-twisted.patch
-Patch1: wxpy3.0-compat.patch
BuildRequires: python-devel wxPython ghostscript ImageMagick
BuildRequires: tex(latex) tex(fullpage.sty) desktop-file-utils
BuildArch: noarch
@@ -29,9 +27,7 @@ Law features an attractive map overlaid on high-resolution satellite imagery.
%prep
-%setup -q
-%patch0 -p1
-%patch1 -p1
+%setup -q -n %{name}-%{version}_pre2
chmod +x setup.py
@@ -42,8 +38,6 @@ make -C doc manual.pdf
%install
./setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT
-# already in /usr/bin
-rm $RPM_BUILD_ROOT%{python_sitelib}/%{name}/london-{client,server}.py
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps
convert londonlaw/guiclient/images/playericon1.jpg -resize 48x48 \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
@@ -67,16 +61,20 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
-%doc COPYING ChangeLog doc/TODO doc/*.pdf doc/readme.protocol
+%doc COPYING doc/ChangeLog doc/TODO doc/*.pdf doc/readme.protocol
%{_bindir}/london-*
%{_datadir}/%{name}
%{python_sitelib}/%{name}
-%{python_sitelib}/%{name}-%{version}-py?.?.egg-info
+%{python_sitelib}/%{name}-%{version}*-py?.?.egg-info
%{_datadir}/applications/*%{name}*.desktop
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%changelog
+* Mon May 18 2015 Hans de Goede <hdegoede at redhat.com> - 0.3.0-0.1.pre2
+- New upstream: https://github.com/anyc/londonlaw
+- Update to new upstream 0.3.0-pre2 release
+
* Fri Feb 20 2015 Hans de Goede <hdegoede at redhat.com> - 0.2.1-18
- Fix londonlaw not running with wxPython 3.0 (rhbz#1191318)
diff --git a/sources b/sources
index c176a68..2df545e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-8e7b630de309c75edd07974ca2574c41 londonlaw-0.2.1.tar.gz
+e009483d29fd47563560995fc96d7b34 v0.3.0_pre2.tar.gz
diff --git a/wxpy3.0-compat.patch b/wxpy3.0-compat.patch
deleted file mode 100644
index 3b18fd4..0000000
--- a/wxpy3.0-compat.patch
+++ /dev/null
@@ -1,2297 +0,0 @@
-Description: Update for wxPython3.0 compatibility.
-Author: Olly Betts <olly at survex.com>
-Forwarded: no
-Bug-Debian: https://bugs.debian.org/759084
-Last-Update: 2014-08-15
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/__init__.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/__init__.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/__init__.py
-@@ -17,13 +17,19 @@
-
- # Note: unfortunately the twisted "wxreactor" is broken at present and is
- # unlikely to be fixed anytime soon. Rather than trying to integrate the event
--# loops, the solution used here is to run a single-threaded wxApp with a wxTimer
-+# loops, the solution used here is to run a single-threaded wx.App with a wx.Timer
- # that runs the twisted event loop periodically.
-
-
- from twisted.internet import protocol, reactor
- from twisted.python import log
--from wxPython.wx import *
-+import wxversion
-+try:
-+ wxversion.select("3.0")
-+except wxversion.VersionError:
-+ wxversion.select("2.8")
-+
-+import wx
- from ConnectWindow import *
- from GameListWindow import *
- from RegistrationWindow import *
-@@ -46,7 +52,7 @@ class LLawClientFactory(protocol.ClientF
-
-
- # Run the whole shebang.
--class MyApp(wxApp):
-+class MyApp(wx.App):
-
- def OnInit(self):
- TIMERID = 999999
-@@ -57,14 +63,13 @@ class MyApp(wxApp):
- messenger.registerRegistrationWindowLauncher(self.register)
- messenger.registerMainWindowLauncher(self.startGame)
-
-- wxInitAllImageHandlers() # Required to be able to load compressed images
- messenger.guiLaunchConnectionWindow()
-
-- EVT_TIMER(self, TIMERID, self.OnTimer)
-- self.timer = wxTimer(self, TIMERID)
-+ wx.EVT_TIMER(self, TIMERID, self.OnTimer)
-+ self.timer = wx.Timer(self, TIMERID)
- self.timer.Start(250, False)
-
-- return true
-+ return True
-
-
- def OnTimer(self, event):
-@@ -79,7 +84,7 @@ class MyApp(wxApp):
- self.connectFrame.Fit()
- self.connectFrame.Show(1)
- self.currentWindow = self.connectFrame
-- EVT_BUTTON(self.connectFrame, self.connectFrame.connectButton.GetId(), self.connect)
-+ wx.EVT_BUTTON(self.connectFrame, self.connectFrame.connectButton.GetId(), self.connect)
- return self.connectFrame
-
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/AutoListCtrl.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/AutoListCtrl.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/AutoListCtrl.py
-@@ -20,9 +20,9 @@
- # AutoListCtrl.py
- #
- # This module contains a base class list control that does the following:
--# * sort by column when clicking on headers (wxColumnSorterMixin)
-+# * sort by column when clicking on headers (ColumnSorterMixin)
- # * auto-expands the width of the last column to fill available space
--# (wxListCtrlAutoWidthMixin)
-+# (ListCtrlAutoWidthMixin)
- # * supports realtime addition and removal of items
- #
- # This base class will be used in both the game room browser and the
-@@ -35,8 +35,8 @@
-
-
- from twisted.python import log
--from wxPython.wx import *
--from wxPython.lib.mixins.listctrl import wxColumnSorterMixin, wxListCtrlAutoWidthMixin
-+import wx
-+from wx.lib.mixins.listctrl import ColumnSorterMixin, ListCtrlAutoWidthMixin
- from londonlaw.common.config import *
- import os.path
-
-@@ -44,37 +44,37 @@ import os.path
-
- # the AutoWidthMixin simply resizes the last column of of the
- # ListCtrl to take up all remaining space.
--class AutoWidthListCtrl(wxListCtrl, wxListCtrlAutoWidthMixin):
-- def __init__(self, parent, ID, pos = wxDefaultPosition,
-- size = wxDefaultSize, style = 0):
-- wxListCtrl.__init__(self, parent, ID, pos, size, style)
-- wxListCtrlAutoWidthMixin.__init__(self)
-+class AutoWidthListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin):
-+ def __init__(self, parent, ID, pos = wx.DefaultPosition,
-+ size = wx.DefaultSize, style = 0):
-+ wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
-+ ListCtrlAutoWidthMixin.__init__(self)
-
-
- # 'headers' is a list of column headers.
- # 'placeholder' should be a list of display data that is shown when
- # the list is empty (same length as 'headers').
--class AutoListCtrl(AutoWidthListCtrl, wxColumnSorterMixin):
-+class AutoListCtrl(AutoWidthListCtrl, ColumnSorterMixin):
- def __init__(self, parent, ID, headers, placeholder = None):
-- AutoWidthListCtrl.__init__(self, parent, ID, wxDefaultPosition, wxDefaultSize,
-- wxLC_REPORT|wxLC_SINGLE_SEL)
-+ AutoWidthListCtrl.__init__(self, parent, ID, wx.DefaultPosition, wx.DefaultSize,
-+ wx.LC_REPORT|wx.LC_SINGLE_SEL)
-
- self.headers = headers
-
-- # load in the tiny arrow images that wxColumnSorterMixin draws
-+ # load in the tiny arrow images that ColumnSorterMixin draws
- # in the headers of sorted columns
- # WARNING: this segfaults if imageList is a local variable.
- # Maybe a wxPython bug... imageList falls out of scope and gets deleted prematurely?
-- self.imageList = wxImageList(16, 16, TRUE)
-+ self.imageList = wx.ImageList(16, 16, True)
- file1 = os.path.normpath(os.path.join(MEDIAROOT, "images/smalluparrow.png"))
- file2 = os.path.normpath(os.path.join(MEDIAROOT, "images/smalldownarrow.png"))
-- image = wxImage(file1, wxBITMAP_TYPE_ANY)
-+ image = wx.Image(file1, wx.BITMAP_TYPE_ANY)
- image.SetMaskColour(255, 255, 255)
-- self.smallUpArrow = self.imageList.Add(wxBitmapFromImage(image))
-- image = wxImage(file2, wxBITMAP_TYPE_ANY)
-+ self.smallUpArrow = self.imageList.Add(wx.BitmapFromImage(image))
-+ image = wx.Image(file2, wx.BITMAP_TYPE_ANY)
- image.SetMaskColour(255, 255, 255)
-- self.smallDnArrow = self.imageList.Add(wxBitmapFromImage(image))
-- self.SetImageList(self.imageList, wxIMAGE_LIST_SMALL)
-+ self.smallDnArrow = self.imageList.Add(wx.BitmapFromImage(image))
-+ self.SetImageList(self.imageList, wx.IMAGE_LIST_SMALL)
-
- self.placeholder = placeholder
- # data from the server should be formatted as
-@@ -86,14 +86,14 @@ class AutoListCtrl(AutoWidthListCtrl, wx
- self.populateList()
-
- # this must be called *after* the list has been created
-- wxColumnSorterMixin.__init__(self, len(self.headers))
-+ ColumnSorterMixin.__init__(self, len(self.headers))
-
-
- def populateList(self):
-- info = wxListItem()
-- info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE | wxLIST_MASK_FORMAT
-+ info = wx.ListItem()
-+ info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE | wx.LIST_MASK_FORMAT
- info.m_image = -1
-- info.m_format = wxLIST_FORMAT_CENTRE
-+ info.m_format = wx.LIST_FORMAT_CENTRE
-
- for i in range(len(self.headers)):
- info.m_text = self.headers[i]
-@@ -107,16 +107,16 @@ class AutoListCtrl(AutoWidthListCtrl, wx
- self.SetStringItem(i, j, data[j])
- self.SetItemData(i, key)
-
-- # dirty hack... wxWidgets needs a wxLIST_AUTOSIZE_* that
-+ # dirty hack... wxWidgets needs a wx.LIST_AUTOSIZE_* that
- # chooses the maximum of BOTH header size and list item size
- for i in range(len(self.headers) - 1):
-- self.SetColumnWidth(i, wxLIST_AUTOSIZE)
-+ self.SetColumnWidth(i, wx.LIST_AUTOSIZE)
- itemWidth = self.GetColumnWidth(i)
-- self.SetColumnWidth(i, wxLIST_AUTOSIZE_USEHEADER)
-+ self.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER)
- headerWidth = self.GetColumnWidth(i)
- if headerWidth < itemWidth:
-- self.SetColumnWidth(i, wxLIST_AUTOSIZE)
-- # size of last column is set automatically by wxListCtrlAutoWidthMixin
-+ self.SetColumnWidth(i, wx.LIST_AUTOSIZE)
-+ # size of last column is set automatically by ListCtrlAutoWidthMixin
-
-
- # def logListData(self):
-@@ -183,12 +183,12 @@ class AutoListCtrl(AutoWidthListCtrl, wx
- self.SetItemData(item, key)
-
-
-- # required by wxColumnSorterMixin
-+ # required by ColumnSorterMixin
- def GetListCtrl(self):
- return self
-
-
-- # used by wxColumnSorterMixin to display up and down arrows
-+ # used by ColumnSorterMixin to display up and down arrows
- # on sorted column headers
- def GetSortImages(self):
- return (self.smallDnArrow, self.smallUpArrow)
-Index: londonlaw-0.2.1/londonlaw/guiclient/ChatPanel.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/ChatPanel.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/ChatPanel.py
-@@ -21,38 +21,38 @@
- #
- # This class creates a combined chat entry and chat message display area.
-
--from wxPython.wx import *
-+import wx
- from ScrolledLabel import *
-
- # Wrapped in a StaticBox.
--class ChatPanel(wxPanel):
-+class ChatPanel(wx.Panel):
- def __init__(self, parent, text, enableSendTo):
-- wxPanel.__init__(self, parent, -1)
-+ wx.Panel.__init__(self, parent, -1)
-
-
- # create a scrollable display for the chat messages
- self.chatDisplay = ScrolledLabel(self, text)
-
- # create the "send to" radio button
-- self.chatRadio = wxRadioBox(self, -1, "send to:", wxDefaultPosition, wxDefaultSize,
-- ["all", "team"], 1, wxRA_SPECIFY_COLS)
-+ self.chatRadio = wx.RadioBox(self, -1, "send to:", wx.DefaultPosition, wx.DefaultSize,
-+ ["all", "team"], 1, wx.RA_SPECIFY_COLS)
- self.chatRadio.Enable(enableSendTo)
-
- # create a chat entry box
-- self.chatEntry = wxTextCtrl(self, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER)
-+ self.chatEntry = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER)
- self.chatEntry.SetMaxLength(254) # messages longer than this would get truncated by ESocket.write_string()
-
-
- # set up the geometry.
- # line the chat display and the radio button horizontally...
-- sizer2 = wxBoxSizer(wxHORIZONTAL)
-- sizer2.Add(self.chatDisplay, 1, wxEXPAND|wxALL, 5)
-- sizer2.Add(self.chatRadio, 0, wxALIGN_BOTTOM|wxALL, 5)
-+ sizer2 = wx.BoxSizer(wx.HORIZONTAL)
-+ sizer2.Add(self.chatDisplay, 1, wx.EXPAND|wx.ALL, 5)
-+ sizer2.Add(self.chatRadio, 0, wx.ALIGN_BOTTOM|wx.ALL, 5)
-
- # ... and line up the rest vertically
-- self.topSizer = wxBoxSizer(wxVERTICAL)
-- self.topSizer.Add(sizer2, 1, wxEXPAND)
-- self.topSizer.Add(self.chatEntry, 0, wxEXPAND|wxALL, 5)
-+ self.topSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.topSizer.Add(sizer2, 1, wx.EXPAND)
-+ self.topSizer.Add(self.chatEntry, 0, wx.EXPAND|wx.ALL, 5)
- self.SetSizer(self.topSizer)
- self.topSizer.SetSizeHints(self)
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/ConnectWindow.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/ConnectWindow.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/ConnectWindow.py
-@@ -22,23 +22,23 @@
- # This class handles the initial connection window, where players
- # enter server information and provide usernames.
-
--from wxPython.wx import *
-+import wx
- from twisted.internet import reactor
- from londonlaw.common.protocol import *
- import sys
-
-
- # Initial window. Creates a form for the user to enter a host, port, and user information.
--class ConnectWindow(wxFrame):
-+class ConnectWindow(wx.Frame):
- def __init__(self, parent, ID, title):
-- wxFrame.__init__(self, parent, ID, title)
-+ wx.Frame.__init__(self, parent, ID, title)
-
- EXIT = 100
-
- # Create a menu bar
-- fileMenu = wxMenu("File")
-+ fileMenu = wx.Menu("File")
- fileMenu.Append(EXIT, "Exit\tCTRL+Q", "Exit London Law")
-- menuBar = wxMenuBar()
-+ menuBar = wx.MenuBar()
- menuBar.Append(fileMenu, "File")
- self.SetMenuBar(menuBar)
-
-@@ -46,77 +46,77 @@ class ConnectWindow(wxFrame):
- self.status = self.CreateStatusBar()
-
- # stick everything in a panel to enable tab traversal
-- mainPanel = wxPanel(self, -1)
-+ mainPanel = wx.Panel(self, -1)
-
-- labelFont = wxFont(self.GetFont().GetPointSize(), wxDEFAULT, wxNORMAL, wxBOLD)
-- labelFont.SetWeight(wxBOLD)
-- connectLabel = wxStaticText(mainPanel, -1, "Connect to: ")
-+ labelFont = wx.Font(self.GetFont().GetPointSize(), wx.DEFAULT, wx.NORMAL, wx.BOLD)
-+ labelFont.SetWeight(wx.BOLD)
-+ connectLabel = wx.StaticText(mainPanel, -1, "Connect to: ")
- connectLabel.SetFont(labelFont)
-- self.hostEntryLabel = wxStaticText(mainPanel, -1, "host:", wxPoint(0,0))
-- self.hostEntry = wxTextCtrl(mainPanel, -1, "localhost", wxDefaultPosition, (170, wxDefaultSize[1]))
-- self.portEntryLabel = wxStaticText(mainPanel, -1, "port:", wxPoint(0,0))
-- self.portEntry = wxTextCtrl(mainPanel, -1, str(LLAW_PORT), wxDefaultPosition, (50, wxDefaultSize[1]))
-+ self.hostEntryLabel = wx.StaticText(mainPanel, -1, "host:", wx.Point(0,0))
-+ self.hostEntry = wx.TextCtrl(mainPanel, -1, "localhost", wx.DefaultPosition, (170, wx.DefaultSize[1]))
-+ self.portEntryLabel = wx.StaticText(mainPanel, -1, "port:", wx.Point(0,0))
-+ self.portEntry = wx.TextCtrl(mainPanel, -1, str(LLAW_PORT), wx.DefaultPosition, (50, wx.DefaultSize[1]))
- self.portEntry.SetMaxLength(5)
-
-- connectSizer = wxBoxSizer(wxHORIZONTAL)
-+ connectSizer = wx.BoxSizer(wx.HORIZONTAL)
- connectSizer.Add((30,1),0,0)
-- connectSizer.Add(self.hostEntryLabel, 0, wxALIGN_CENTRE | wxLEFT, 5)
-- connectSizer.Add(self.hostEntry, 0, wxALIGN_CENTRE | wxALL, 5)
-+ connectSizer.Add(self.hostEntryLabel, 0, wx.ALIGN_CENTRE | wx.LEFT, 5)
-+ connectSizer.Add(self.hostEntry, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
- connectSizer.Add((10,1),0,0)
-- connectSizer.Add(self.portEntryLabel, 0, wxALIGN_CENTRE)
-- connectSizer.Add(self.portEntry, 0, wxALIGN_CENTRE | wxALL, 5)
-+ connectSizer.Add(self.portEntryLabel, 0, wx.ALIGN_CENTRE)
-+ connectSizer.Add(self.portEntry, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-
-- userLabel = wxStaticText(mainPanel, -1, "User information: ")
-+ userLabel = wx.StaticText(mainPanel, -1, "User information: ")
- userLabel.SetFont(labelFont)
-- self.usernameEntryLabel = wxStaticText(mainPanel, -1, "username:", wxPoint(0,0))
-- self.usernameEntry = wxTextCtrl(mainPanel, -1)
-+ self.usernameEntryLabel = wx.StaticText(mainPanel, -1, "username:", wx.Point(0,0))
-+ self.usernameEntry = wx.TextCtrl(mainPanel, -1)
- self.usernameEntry.SetMaxLength(20)
-- self.passEntryLabel = wxStaticText(mainPanel, -1, "password:", wxPoint(0,0))
-- self.passEntry = wxTextCtrl(mainPanel, -1, style=wxTE_PASSWORD)
-+ self.passEntryLabel = wx.StaticText(mainPanel, -1, "password:", wx.Point(0,0))
-+ self.passEntry = wx.TextCtrl(mainPanel, -1, style=wx.TE_PASSWORD)
- self.passEntry.SetMaxLength(20)
-
-- userSizer = wxBoxSizer(wxHORIZONTAL)
-+ userSizer = wx.BoxSizer(wx.HORIZONTAL)
- userSizer.Add((30,1),0,0)
-- userSizer.Add(self.usernameEntryLabel, 0, wxALIGN_CENTRE)
-- userSizer.Add(self.usernameEntry, 0, wxALIGN_CENTRE | wxALL, 5)
-+ userSizer.Add(self.usernameEntryLabel, 0, wx.ALIGN_CENTRE)
-+ userSizer.Add(self.usernameEntry, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
- userSizer.Add((10,1),1,1)
-- userSizer.Add(self.passEntryLabel, 0, wxALIGN_CENTRE)
-- userSizer.Add(self.passEntry, 0, wxALIGN_CENTRE | wxALL, 5)
-+ userSizer.Add(self.passEntryLabel, 0, wx.ALIGN_CENTRE)
-+ userSizer.Add(self.passEntry, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-
- # Add some buttons
-- self.connectButton = wxButton(mainPanel, -1, "Connect")
-- self.quitButton = wxButton(mainPanel, -1, "Quit")
-- buttonSizer = wxBoxSizer(wxHORIZONTAL)
-- buttonSizer.Add(self.quitButton, 0, wxALIGN_CENTRE | wxALL, 5)
-+ self.connectButton = wx.Button(mainPanel, -1, "Connect")
-+ self.quitButton = wx.Button(mainPanel, -1, "Quit")
-+ buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ buttonSizer.Add(self.quitButton, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
- if sys.platform.lower()[:-3] == "win":
- # Win32 users like their buttons in the wrong order
-- buttonSizer.Prepend(self.connectButton, 0, wxALIGN_CENTRE | wxALL, 5)
-+ buttonSizer.Prepend(self.connectButton, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
- else:
-- buttonSizer.Add(self.connectButton, 0, wxALIGN_CENTRE | wxALL, 5)
-- buttonSizer.Prepend((10,1),1,wxEXPAND)
-+ buttonSizer.Add(self.connectButton, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-+ buttonSizer.Prepend((10,1),1,wx.EXPAND)
-
-- self.topSizer = wxBoxSizer(wxVERTICAL)
-- self.topSizer.Add(connectLabel, 0, wxALIGN_LEFT | wxLEFT | wxTOP, 10)
-- self.topSizer.Add(connectSizer, 0, wxALIGN_LEFT | wxALL, 5)
-- self.topSizer.Add(userLabel, 0, wxALIGN_LEFT | wxLEFT | wxTOP, 10)
-- self.topSizer.Add(userSizer, 0, wxALIGN_LEFT | wxALL, 5)
-- self.topSizer.Add((10,10),1,wxEXPAND)
-- self.topSizer.Add(buttonSizer, 0, wxEXPAND | wxALL, 5)
-+ self.topSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.topSizer.Add(connectLabel, 0, wx.ALIGN_LEFT | wx.LEFT | wx.TOP, 10)
-+ self.topSizer.Add(connectSizer, 0, wx.ALIGN_LEFT | wx.ALL, 5)
-+ self.topSizer.Add(userLabel, 0, wx.ALIGN_LEFT | wx.LEFT | wx.TOP, 10)
-+ self.topSizer.Add(userSizer, 0, wx.ALIGN_LEFT | wx.ALL, 5)
-+ self.topSizer.Add((10,10),1,wx.EXPAND)
-+ self.topSizer.Add(buttonSizer, 0, wx.EXPAND | wx.ALL, 5)
- mainPanel.SetSizer(self.topSizer)
-- self.topSizer.Fit(mainPanel)
-+ self.topSizer.Fit(self)
- mainPanel.SetAutoLayout(1)
-
- self.hostEntry.SetFocus()
-
-- EVT_SET_FOCUS(self.hostEntry, self.selectFocused)
-- EVT_SET_FOCUS(self.portEntry, self.selectFocused)
-- EVT_SET_FOCUS(self.usernameEntry, self.selectFocused)
-- EVT_SET_FOCUS(self.passEntry, self.selectFocused)
-- EVT_BUTTON(self, self.quitButton.GetId(), self.menuExit)
-- EVT_MENU(self, EXIT, self.menuExit)
-+ wx.EVT_SET_FOCUS(self.hostEntry, self.selectFocused)
-+ wx.EVT_SET_FOCUS(self.portEntry, self.selectFocused)
-+ wx.EVT_SET_FOCUS(self.usernameEntry, self.selectFocused)
-+ wx.EVT_SET_FOCUS(self.passEntry, self.selectFocused)
-+ wx.EVT_BUTTON(self, self.quitButton.GetId(), self.menuExit)
-+ wx.EVT_MENU(self, EXIT, self.menuExit)
-
-
-- # select contents of a focused wxTextCtrl
-+ # select contents of a focused wx.TextCtrl
- def selectFocused(self, ev):
- self.hostEntry.SetSelection(0,0)
- self.portEntry.SetSelection(0,0)
-@@ -140,8 +140,8 @@ class ConnectWindow(wxFrame):
-
- def showInfoAlert(self, info):
- self.PushStatusText("")
-- alert = wxMessageDialog(self, info,
-- "Server Message", wxOK|wxICON_INFORMATION)
-+ alert = wx.MessageDialog(self, info,
-+ "Server Message", wx.OK|wx.ICON_INFORMATION)
- alert.ShowModal()
-
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/GameListWindow.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/GameListWindow.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/GameListWindow.py
-@@ -25,7 +25,7 @@
-
-
- from twisted.python import log
--from wxPython.wx import *
-+import wx
- from londonlaw.common.protocol import *
- from londonlaw.common.config import *
- from AutoListCtrl import *
-@@ -35,54 +35,54 @@ import os.path
-
-
- # Create a small dialog for creating a game
--class NewGameDialog(wxDialog):
-+class NewGameDialog(wx.Dialog):
- def __init__(self, parent, returnValue):
-- wxDialog.__init__(self, parent, -1, "Create a New Game",
-- wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxSUNKEN_BORDER)
-- panel = wxPanel(self, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
-+ wx.Dialog.__init__(self, parent, -1, "Create a New Game",
-+ wx.DefaultPosition, wx.DefaultSize, wx.DEFAULT_DIALOG_STYLE|wx.SUNKEN_BORDER)
-+ panel = wx.Panel(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL)
-
- self.returnValue = returnValue
-
-- labelFont = wxFont(self.GetFont().GetPointSize(), wxDEFAULT, wxNORMAL, wxBOLD)
-- labelFont.SetWeight(wxBOLD)
-- newGameLabel = wxStaticText(panel, -1, "New Game: ")
-+ labelFont = wx.Font(self.GetFont().GetPointSize(), wx.DEFAULT, wx.NORMAL, wx.BOLD)
-+ labelFont.SetWeight(wx.BOLD)
-+ newGameLabel = wx.StaticText(panel, -1, "New Game: ")
- newGameLabel.SetFont(labelFont)
-- nameLabel = wxStaticText(panel, -1, "game room name:", wxPoint(0,0))
-- self.nameEntry = wxTextCtrl(panel, -1, "", wxDefaultPosition, (170, wxDefaultSize[1]))
-- typeLabel = wxStaticText(panel, -1, "game type:", wxPoint(0,0))
-- self.typeList = wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, ["standard"])
-- self.submitButton = wxButton(panel, wxID_OK, "OK")
-- self.cancelButton = wxButton(panel, wxID_CANCEL, "Cancel")
-+ nameLabel = wx.StaticText(panel, -1, "game room name:", wx.Point(0,0))
-+ self.nameEntry = wx.TextCtrl(panel, -1, "", wx.DefaultPosition, (170, wx.DefaultSize[1]))
-+ typeLabel = wx.StaticText(panel, -1, "game type:", wx.Point(0,0))
-+ self.typeList = wx.Choice(panel, -1, wx.DefaultPosition, wx.DefaultSize, ["standard"])
-+ self.submitButton = wx.Button(panel, wx.ID_OK, "OK")
-+ self.cancelButton = wx.Button(panel, wx.ID_CANCEL, "Cancel")
- self.typeList.SetSelection(0)
-
-- hSizer = wxBoxSizer(wxHORIZONTAL)
-+ hSizer = wx.BoxSizer(wx.HORIZONTAL)
- hSizer.Add((30, 1), 0, 0)
-- hSizer.Add(nameLabel, 0, wxALIGN_CENTRE|wxALL, 5)
-- hSizer.Add(self.nameEntry, 0, wxALIGN_CENTRE|wxALL, 5)
-+ hSizer.Add(nameLabel, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-+ hSizer.Add(self.nameEntry, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
- hSizer.Add((10, 1), 0, 0)
-- hSizer.Add(typeLabel, 0, wxALIGN_CENTRE|wxALL, 5)
-- hSizer.Add(self.typeList, 0, wxALIGN_CENTRE|wxALL, 5)
-+ hSizer.Add(typeLabel, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-+ hSizer.Add(self.typeList, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-
-- bSizer = wxBoxSizer(wxHORIZONTAL)
-+ bSizer = wx.BoxSizer(wx.HORIZONTAL)
- bSizer.Add((1, 1), 1, 0)
-- bSizer.Add(self.cancelButton, 0, wxALIGN_CENTRE|wxALL, 5)
-- bSizer.Add(self.submitButton, 0, wxALIGN_CENTRE|wxALL, 5)
-+ bSizer.Add(self.cancelButton, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-+ bSizer.Add(self.submitButton, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-
-- vSizer = wxBoxSizer(wxVERTICAL)
-- vSizer.Add(newGameLabel, 0, wxALIGN_LEFT|wxALL, 5)
-- vSizer.Add(hSizer, 0, wxALIGN_LEFT|wxALL, 5)
-- vSizer.Add(bSizer, 0, wxEXPAND|wxALL, 5)
-+ vSizer = wx.BoxSizer(wx.VERTICAL)
-+ vSizer.Add(newGameLabel, 0, wx.ALIGN_LEFT|wx.ALL, 5)
-+ vSizer.Add(hSizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)
-+ vSizer.Add(bSizer, 0, wx.EXPAND|wx.ALL, 5)
-
- panel.SetSizer(vSizer)
- vSizer.Fit(panel)
-- sizer = wxBoxSizer(wxVERTICAL)
-- sizer.Add(panel, 1, wxEXPAND | wxALL, 5)
-+ sizer = wx.BoxSizer(wx.VERTICAL)
-+ sizer.Add(panel, 1, wx.EXPAND | wx.ALL, 5)
- self.SetSizer(sizer)
- sizer.Fit(self)
- self.SetAutoLayout(1)
-
-- EVT_BUTTON(self, wxID_OK, self.submit)
-- EVT_BUTTON(self, wxID_CANCEL, self.cancel)
-+ wx.EVT_BUTTON(self, wx.ID_OK, self.submit)
-+ wx.EVT_BUTTON(self, wx.ID_CANCEL, self.cancel)
-
-
- def submit(self, event):
-@@ -97,9 +97,9 @@ class NewGameDialog(wxDialog):
-
-
- # Generate the main registration window.
--class GameListWindow(wxFrame):
-+class GameListWindow(wx.Frame):
- def __init__(self, parent, ID, title, messenger):
-- wxFrame.__init__(self, parent, ID, title)
-+ wx.Frame.__init__(self, parent, ID, title)
-
- self._messenger = messenger
-
-@@ -107,17 +107,17 @@ class GameListWindow(wxFrame):
- EXIT = 101
-
- # Create a menu bar
-- fileMenu = wxMenu("File")
-+ fileMenu = wx.Menu("File")
- fileMenu.Append(DISCONNECT, "Disconnect", "Disconnect from server")
- fileMenu.Append(EXIT, "Exit\tCTRL+Q", "Exit London Law")
-- menuBar = wxMenuBar()
-+ menuBar = wx.MenuBar()
- menuBar.Append(fileMenu, "File")
- self.SetMenuBar(menuBar)
-
- self.status = self.CreateStatusBar()
-
- # stick everything in a panel
-- mainPanel = wxPanel(self, -1)
-+ mainPanel = wx.Panel(self, -1)
-
- self.list = AutoListCtrl(mainPanel, -1,
- ("Game Room", "Status", "Game Type", "Players"),
-@@ -126,27 +126,27 @@ class GameListWindow(wxFrame):
- self.list.SetColumnWidth(1, 140)
- self.list.SetColumnWidth(2, 140)
-
-- mainSizer = wxBoxSizer(wxVERTICAL)
-- mainSizer.Add(self.list, 1, wxALIGN_CENTRE|wxEXPAND|wxALL, 5)
-+ mainSizer = wx.BoxSizer(wx.VERTICAL)
-+ mainSizer.Add(self.list, 1, wx.ALIGN_CENTRE|wx.EXPAND|wx.ALL, 5)
-
-- self.selectButton = wxButton(mainPanel, -1, "Join Game")
-+ self.selectButton = wx.Button(mainPanel, -1, "Join Game")
- self.selectButton.Disable()
-- self.createButton = wxButton(mainPanel, -1, "New Game")
-- buttonSizer = wxBoxSizer(wxHORIZONTAL)
-- buttonSizer.Add((1, 1), 1, wxEXPAND)
-- buttonSizer.Add(self.createButton, 0, wxALIGN_CENTRE | wxRIGHT | wxBOTTOM | wxALL, 5)
-- buttonSizer.Add(self.selectButton, 0, wxALIGN_CENTRE | wxRIGHT | wxBOTTOM | wxALL, 5)
-- mainSizer.Add(buttonSizer, 0, wxEXPAND, 0)
-+ self.createButton = wx.Button(mainPanel, -1, "New Game")
-+ buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ buttonSizer.Add((1, 1), 1, wx.EXPAND)
-+ buttonSizer.Add(self.createButton, 0, wx.ALIGN_CENTRE | wx.RIGHT | wx.BOTTOM | wx.ALL, 5)
-+ buttonSizer.Add(self.selectButton, 0, wx.ALIGN_CENTRE | wx.RIGHT | wx.BOTTOM | wx.ALL, 5)
-+ mainSizer.Add(buttonSizer, 0, wx.EXPAND, 0)
-
- mainPanel.SetSizer(mainSizer)
- mainSizer.Fit(mainPanel)
-
-- EVT_MENU(self, EXIT, self.menuExit)
-- EVT_MENU(self, DISCONNECT, self.menuDisconnect)
-- EVT_LIST_ITEM_SELECTED(self, self.list.GetId(), self.enableSelectButton)
-- EVT_LIST_ITEM_DESELECTED(self, self.list.GetId(), self.disableSelectButton)
-- EVT_BUTTON(self, self.selectButton.GetId(), self.joinGame)
-- EVT_BUTTON(self, self.createButton.GetId(), self.createGame)
-+ wx.EVT_MENU(self, EXIT, self.menuExit)
-+ wx.EVT_MENU(self, DISCONNECT, self.menuDisconnect)
-+ wx.EVT_LIST_ITEM_SELECTED(self, self.list.GetId(), self.enableSelectButton)
-+ wx.EVT_LIST_ITEM_DESELECTED(self, self.list.GetId(), self.disableSelectButton)
-+ wx.EVT_BUTTON(self, self.selectButton.GetId(), self.joinGame)
-+ wx.EVT_BUTTON(self, self.createButton.GetId(), self.createGame)
-
-
- def addGame(self, data):
-@@ -160,7 +160,7 @@ class GameListWindow(wxFrame):
-
-
- def enableSelectButton(self, event):
-- self.selectButton.Enable(TRUE)
-+ self.selectButton.Enable(True)
-
-
- def disableSelectButton(self, event):
-@@ -176,29 +176,29 @@ class GameListWindow(wxFrame):
-
-
- def joinGame(self, event):
-- selected = self.list.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)
-+ selected = self.list.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
- self._messenger.netJoinGame(self.list.GetItemText(selected))
-
-
- def showInfoAlert(self, info):
- self.PushStatusText("")
-- alert = wxMessageDialog(self, info,
-- "Server Message", wxOK|wxICON_INFORMATION)
-+ alert = wx.MessageDialog(self, info,
-+ "Server Message", wx.OK|wx.ICON_INFORMATION)
- alert.ShowModal()
-
-
- def menuExit(self, event):
-- alert = wxMessageDialog(self, "Disconnect from the server and exit London Law?",
-- "Disconnect and Quit", wxYES_NO|wxICON_EXCLAMATION)
-- if alert.ShowModal() == wxID_YES:
-+ alert = wx.MessageDialog(self, "Disconnect from the server and exit London Law?",
-+ "Disconnect and Quit", wx.YES_NO|wx.ICON_EXCLAMATION)
-+ if alert.ShowModal() == wx.ID_YES:
- self._messenger.netDisconnect()
- self.Close()
-
-
- def menuDisconnect(self, event):
-- alert = wxMessageDialog(self, "Disconnect from the server?",
-- "Disconnect", wxYES_NO|wxICON_EXCLAMATION)
-- if alert.ShowModal() == wxID_YES:
-+ alert = wx.MessageDialog(self, "Disconnect from the server?",
-+ "Disconnect", wx.YES_NO|wx.ICON_EXCLAMATION)
-+ if alert.ShowModal() == wx.ID_YES:
- self._messenger.netDisconnect()
- self._messenger.guiLaunchConnectionWindow()
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/HistoryWindow.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/HistoryWindow.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/HistoryWindow.py
-@@ -22,27 +22,27 @@
- # has a scroll bar to control the view.
-
-
--from wxPython.wx import *
-+import wx
- from TextPanel import *
- from StaticBitmap import *
- from londonlaw.common.config import *
- import os, sys, string
-
--class HistoryWindow(wxScrolledWindow):
-+class HistoryWindow(wx.ScrolledWindow):
- def __init__(self, parent):
-- wxScrolledWindow.__init__(self, parent)
-+ wx.ScrolledWindow.__init__(self, parent)
-
- # load in the ticket images
- self.ticketImages = []
- for i in range(5):
- filename = os.path.normpath(os.path.join(MEDIAROOT, "images/ticket" + str(i) + ".png"))
-- self.ticketImages.append(wxImage(filename, wxBITMAP_TYPE_ANY))
-+ self.ticketImages.append(wx.Image(filename, wx.BITMAP_TYPE_ANY))
-
- # the toplevel sizer is this two-column FlexGridSizer;
- # the left column is filled with vertical wxBoxSizers,
- # each of which places the turn number above Mr. X's
- # known locations.
-- self.ticketSizer = wxFlexGridSizer(24, 2, 0, 0)
-+ self.ticketSizer = wx.FlexGridSizer(24, 2, 0, 0)
-
- self.vbSizers = []
- self.turns = []
-@@ -55,28 +55,28 @@ class HistoryWindow(wxScrolledWindow):
- self.panels2 = []
- self.panelSizers2 = []
- for i in range(24):
-- self.panels.append(wxPanel(self, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER))
-+ self.panels.append(wx.Panel(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.SIMPLE_BORDER))
- self.turns.append(TextPanel(self.panels[i], " Turn " + str(i+1) + " ",
- 12, 0))
- self.locations.append(TextPanel(self.panels[i], " ", 16, 0))
-
-- self.vbSizers.append(wxBoxSizer(wxVERTICAL))
-- self.vbSizers[i].Add(self.turns[i], 1, wxEXPAND|wxCENTRE|wxADJUST_MINSIZE)
-- self.vbSizers[i].Add(self.locations[i], 1, wxEXPAND|wxCENTRE|wxADJUST_MINSIZE)
-+ self.vbSizers.append(wx.BoxSizer(wx.VERTICAL))
-+ self.vbSizers[i].Add(self.turns[i], 1, wx.EXPAND|wx.CENTRE|wx.ADJUST_MINSIZE)
-+ self.vbSizers[i].Add(self.locations[i], 1, wx.EXPAND|wx.CENTRE|wx.ADJUST_MINSIZE)
-
-- self.panelSizers.append(wxBoxSizer(wxHORIZONTAL))
-- self.panelSizers[i].Add(self.vbSizers[i], 1, wxEXPAND)
-+ self.panelSizers.append(wx.BoxSizer(wx.HORIZONTAL))
-+ self.panelSizers[i].Add(self.vbSizers[i], 1, wx.EXPAND)
- self.panels[i].SetSizerAndFit(self.panelSizers[i])
-
-- self.panels2.append(wxPanel(self, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER))
-- self.tickets.append(StaticBitmap(self.panels2[i], -1, wxBitmapFromImage(self.ticketImages[4])))
-+ self.panels2.append(wx.Panel(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.SIMPLE_BORDER))
-+ self.tickets.append(StaticBitmap(self.panels2[i], -1, wx.BitmapFromImage(self.ticketImages[4])))
-
-- self.panelSizers2.append(wxBoxSizer(wxHORIZONTAL))
-- self.panelSizers2[i].Add(self.tickets[i], 1, wxEXPAND)
-+ self.panelSizers2.append(wx.BoxSizer(wx.HORIZONTAL))
-+ self.panelSizers2[i].Add(self.tickets[i], 1, wx.EXPAND)
- self.panels2[i].SetSizerAndFit(self.panelSizers2[i])
-
-- self.ticketSizer.Add(self.panels[i], 0, wxEXPAND|wxCENTRE|wxLEFT|wxTOP, 5)
-- self.ticketSizer.Add(self.panels2[i], 0, wxEXPAND|wxCENTRE|wxLEFT|wxTOP|wxRIGHT, 5)
-+ self.ticketSizer.Add(self.panels[i], 0, wx.EXPAND|wx.CENTRE|wx.LEFT|wx.TOP, 5)
-+ self.ticketSizer.Add(self.panels2[i], 0, wx.EXPAND|wx.CENTRE|wx.LEFT|wx.TOP|wx.RIGHT, 5)
-
- self.showSurfacingTurns()
-
-@@ -86,12 +86,12 @@ class HistoryWindow(wxScrolledWindow):
- # pform = string.lower(sys.platform)
- # if pform.startswith("win") or pform.startswith("darwin"):
- (w, h) = self.ticketSizer.GetMinSize()
-- self.ticketSizer.SetMinSize(wxSize(w+15, h))
-+ self.ticketSizer.SetMinSize(wx.Size(w+15, h))
-
- self.ticketSizer.Fit(self)
- self.SetScrollRate(0, 10)
-
-- # The following doesn't seem to work in wxGTK...
-+ # The following doesn't seem to work in wx.GTK...
- # self.SetSizerAndFit(self.ticketSizer)
-
-
-@@ -101,15 +101,15 @@ class HistoryWindow(wxScrolledWindow):
- self.locations[turnNum].Destroy()
- self.locations[turnNum] = TextPanel(self.panels[turnNum], " " + locStr + " ",
- 16, 0)
-- self.vbSizers[turnNum].Add(self.locations[turnNum], 1, wxEXPAND|wxCENTRE)
-+ self.vbSizers[turnNum].Add(self.locations[turnNum], 1, wx.EXPAND|wx.CENTRE)
-
- self.panelSizers[turnNum].Layout()
-
-
- # update one of the ticket graphics
- def setTicket(self, turnNum, tickNum):
-- self.tickets[turnNum].SetBitmap(wxBitmapFromImage(self.ticketImages[tickNum]))
-- self.tickets[turnNum].Refresh(FALSE)
-+ self.tickets[turnNum].SetBitmap(wx.BitmapFromImage(self.ticketImages[tickNum]))
-+ self.tickets[turnNum].Refresh(False)
-
-
- # draw question marks for the location entries where Mr. X will
-Index: londonlaw-0.2.1/londonlaw/guiclient/MainWindow.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/MainWindow.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/MainWindow.py
-@@ -21,7 +21,7 @@
- # This class handles the main in-game window. It has a map window,
- # a set of player status icons, a chat area, and some useful buttons.
-
--from wxPython.wx import *
-+import wx
- from MapWindow import *
- from ChatPanel import *
- from PlayerIcon import *
-@@ -33,11 +33,11 @@ import time
-
-
-
--class MainWindow(wxFrame):
-+class MainWindow(wx.Frame):
- # players is a list of Mr. X and all detectives, their
- # positions, and their tokens
- def __init__(self, parent, ID, title, username, playerList, messenger):
-- wxFrame.__init__(self, parent, ID, title)
-+ wx.Frame.__init__(self, parent, ID, title)
-
- self.username = username
- self.playerList = playerList
-@@ -62,18 +62,18 @@ class MainWindow(wxFrame):
- self.ABOUT = 105
-
- # Create a menu bar
-- menuBar = wxMenuBar()
-- self.fileMenu = wxMenu()
-+ menuBar = wx.MenuBar()
-+ self.fileMenu = wx.Menu()
- self.fileMenu.Append(self.DISCONNECT, "Disconnect", "Disconnect from server")
- self.fileMenu.Append(self.EXIT, "Exit\tCTRL+Q", "Exit London Law")
- menuBar.Append(self.fileMenu, "File")
-- self.viewMenu = wxMenu()
-+ self.viewMenu = wx.Menu()
- self.viewMenu.AppendCheckItem(self.FULLSCREEN, "Fullscreen Map\tCTRL+F11", "Toggle fullscreen map view")
- self.viewMenu.AppendCheckItem(self.ZOOM, "Map Zoom\tCTRL+Z", "Toggle map zoom level")
- self.viewMenu.AppendCheckItem(self.HISTORY, "Mr. X History\tCTRL+Y", "Show/hide the Mr. X history window")
-- self.viewMenu.Check(self.HISTORY, true)
-+ self.viewMenu.Check(self.HISTORY, True)
- menuBar.Append(self.viewMenu, "View")
-- self.helpMenu = wxMenu()
-+ self.helpMenu = wx.Menu()
- self.helpMenu.Append(self.ABOUT, "About London Law", "About London Law")
- menuBar.Append(self.helpMenu, "Help")
- self.SetMenuBar(menuBar)
-@@ -91,7 +91,7 @@ class MainWindow(wxFrame):
-
- # contain everything in a panel to get rid of the lame dark grey
- # background in Win32
-- self.panel = wxPanel(self, -1)
-+ self.panel = wx.Panel(self, -1)
-
- # create the map window
- self.mapWindow = MapWindow(self.panel, usernameList)
-@@ -113,39 +113,39 @@ class MainWindow(wxFrame):
- self.icons = PlayerIconGroup(self.panel, usernameList, tokenList)
-
- # create the pushbuttons
-- self.moveButton = wxButton(self.panel, -1, "Move")
-- self.moveButton.Enable(false)
-- self.historyButton = wxCheckBox(self.panel, -1, "View History")
-- self.historyButton.SetValue(true)
-- self.zoomButton = wxCheckBox(self.panel, -1, "Zoom")
-- self.buttonSizer = wxBoxSizer(wxVERTICAL)
-- self.buttonSizer.Add(self.zoomButton, 0, wxALL, 5)
-- self.buttonSizer.Add(self.historyButton, 0, wxALL, 5)
-- self.buttonSizer.Add(self.moveButton, 0, wxALL, 5)
-+ self.moveButton = wx.Button(self.panel, -1, "Move")
-+ self.moveButton.Enable(False)
-+ self.historyButton = wx.CheckBox(self.panel, -1, "View History")
-+ self.historyButton.SetValue(True)
-+ self.zoomButton = wx.CheckBox(self.panel, -1, "Zoom")
-+ self.buttonSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.buttonSizer.Add(self.zoomButton, 0, wx.ALL, 5)
-+ self.buttonSizer.Add(self.historyButton, 0, wx.ALL, 5)
-+ self.buttonSizer.Add(self.moveButton, 0, wx.ALL, 5)
-
- # create a history window
- self.historyWin = HistoryWindow(self.panel)
-
-- self.centerSizer = wxBoxSizer(wxHORIZONTAL)
-- self.centerSizer.Add(self.icons, 0, wxALIGN_CENTRE|wxALL)
-- self.centerSizer.Add(self.buttonSizer, 0, wxALIGN_CENTRE)
-+ self.centerSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ self.centerSizer.Add(self.icons, 0, wx.ALIGN_CENTRE|wx.ALL)
-+ self.centerSizer.Add(self.buttonSizer, 0, wx.ALIGN_CENTRE)
-
- # the main window is composed of three areas stacked vertically:
- # map window, player status icons, and chat windows.
- # Use a Sizer to handle this geometry.
-- self.mainSizer = wxBoxSizer(wxVERTICAL)
-- self.mainSizer.Add(self.mapWindow, 1, wxEXPAND|wxBOTTOM, 5)
-- self.mainSizer.Add(self.centerSizer, 0, wxALIGN_CENTRE)
-- self.mainSizer.Add(self.chatWindow, 0, wxEXPAND | wxALL, 5)
--
-- self.panelSizer = wxBoxSizer(wxHORIZONTAL)
-- self.panelSizer.Add(self.historyWin, 0, wxEXPAND)
-- self.panelSizer.Add(self.mainSizer, 1, wxEXPAND)
-+ self.mainSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.mainSizer.Add(self.mapWindow, 1, wx.EXPAND|wx.BOTTOM, 5)
-+ self.mainSizer.Add(self.centerSizer, 0, wx.ALIGN_CENTRE)
-+ self.mainSizer.Add(self.chatWindow, 0, wx.EXPAND | wx.ALL, 5)
-+
-+ self.panelSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ self.panelSizer.Add(self.historyWin, 0, wx.EXPAND)
-+ self.panelSizer.Add(self.mainSizer, 1, wx.EXPAND)
-
- self.panel.SetSizer(self.panelSizer)
-
-- self.topSizer = wxBoxSizer(wxVERTICAL)
-- self.topSizer.Add(self.panel, 1, wxEXPAND)
-+ self.topSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.topSizer.Add(self.panel, 1, wx.EXPAND)
- self.SetSizer(self.topSizer)
- self.topSizer.Fit(self)
- self.SetAutoLayout(1)
-@@ -154,29 +154,29 @@ class MainWindow(wxFrame):
-
- # need a data structure to hold a move from a MoveDialog
- self.move = []
-- self.moveDialogId = wxNewId()
-+ self.moveDialogId = wx.NewId()
-
- # initialize pixelToLoc algorithm
- generateGridHash()
-
- # make the buttons do some stuff
-- EVT_CHECKBOX(self, self.zoomButton.GetId(), self.toggleZoom)
-- EVT_CHECKBOX(self, self.historyButton.GetId(), self.toggleHistory)
-- EVT_BUTTON(self, self.moveButton.GetId(), self.makeMove)
-- EVT_TEXT_ENTER(self, self.chatWindow.chatEntry.GetId(), self.chatSend)
-- EVT_MENU(self, self.EXIT, self.menuExit)
-- EVT_MENU(self, self.DISCONNECT, self.menuDisconnect)
-- EVT_MENU(self, self.FULLSCREEN, self.toggleFullscreen)
-- EVT_MENU(self, self.ZOOM, self.toggleMenuZoom)
-- EVT_MENU(self, self.HISTORY, self.toggleMenuHistory)
-- EVT_MENU(self, self.ABOUT, self.showAbout)
-- EVT_LEFT_DCLICK(self.icons.players[0].icon, self.scrollToPlayer0)
-- EVT_LEFT_DCLICK(self.icons.players[1].icon, self.scrollToPlayer1)
-- EVT_LEFT_DCLICK(self.icons.players[2].icon, self.scrollToPlayer2)
-- EVT_LEFT_DCLICK(self.icons.players[3].icon, self.scrollToPlayer3)
-- EVT_LEFT_DCLICK(self.icons.players[4].icon, self.scrollToPlayer4)
-- EVT_LEFT_DCLICK(self.icons.players[5].icon, self.scrollToPlayer5)
-- EVT_LEFT_DCLICK(self.mapWindow, self.moveToClicked)
-+ wx.EVT_CHECKBOX(self, self.zoomButton.GetId(), self.toggleZoom)
-+ wx.EVT_CHECKBOX(self, self.historyButton.GetId(), self.toggleHistory)
-+ wx.EVT_BUTTON(self, self.moveButton.GetId(), self.makeMove)
-+ wx.EVT_TEXT_ENTER(self, self.chatWindow.chatEntry.GetId(), self.chatSend)
-+ wx.EVT_MENU(self, self.EXIT, self.menuExit)
-+ wx.EVT_MENU(self, self.DISCONNECT, self.menuDisconnect)
-+ wx.EVT_MENU(self, self.FULLSCREEN, self.toggleFullscreen)
-+ wx.EVT_MENU(self, self.ZOOM, self.toggleMenuZoom)
-+ wx.EVT_MENU(self, self.HISTORY, self.toggleMenuHistory)
-+ wx.EVT_MENU(self, self.ABOUT, self.showAbout)
-+ wx.EVT_LEFT_DCLICK(self.icons.players[0].icon, self.scrollToPlayer0)
-+ wx.EVT_LEFT_DCLICK(self.icons.players[1].icon, self.scrollToPlayer1)
-+ wx.EVT_LEFT_DCLICK(self.icons.players[2].icon, self.scrollToPlayer2)
-+ wx.EVT_LEFT_DCLICK(self.icons.players[3].icon, self.scrollToPlayer3)
-+ wx.EVT_LEFT_DCLICK(self.icons.players[4].icon, self.scrollToPlayer4)
-+ wx.EVT_LEFT_DCLICK(self.icons.players[5].icon, self.scrollToPlayer5)
-+ wx.EVT_LEFT_DCLICK(self.mapWindow, self.moveToClicked)
-
-
- def addChatMessage(self, chatType, data):
-@@ -187,17 +187,17 @@ class MainWindow(wxFrame):
-
-
- def menuExit(self, event):
-- alert = wxMessageDialog(self, "Disconnect from the server and exit London Law?",
-- "Disconnect and Quit", wxYES_NO|wxICON_EXCLAMATION)
-- if alert.ShowModal() == wxID_YES:
-+ alert = wx.MessageDialog(self, "Disconnect from the server and exit London Law?",
-+ "Disconnect and Quit", wx.YES_NO|wx.ICON_EXCLAMATION)
-+ if alert.ShowModal() == wx.ID_YES:
- self.messenger.netDisconnect()
- self.Close()
-
-
- def menuDisconnect(self, event):
-- alert = wxMessageDialog(self, "Disconnect from the server?",
-- "Disconnect", wxYES_NO|wxICON_EXCLAMATION)
-- if alert.ShowModal() == wxID_YES:
-+ alert = wx.MessageDialog(self, "Disconnect from the server?",
-+ "Disconnect", wx.YES_NO|wx.ICON_EXCLAMATION)
-+ if alert.ShowModal() == wx.ID_YES:
- self.messenger.netDisconnect()
- self.messenger.guiLaunchConnectionWindow()
-
-@@ -268,8 +268,8 @@ class MainWindow(wxFrame):
-
- # pop up an alert box when X uses a double move
- if mover == self.lastMover and not self.isMrX:
-- alert = wxMessageDialog(self, "Mr. X just used a double move ticket!",
-- "Double Move", wxOK|wxICON_INFORMATION)
-+ alert = wx.MessageDialog(self, "Mr. X just used a double move ticket!",
-+ "Double Move", wx.OK|wx.ICON_INFORMATION)
- alert.ShowModal()
-
- self.lastMover = mover
-@@ -320,17 +320,17 @@ class MainWindow(wxFrame):
-
-
- def showInfoAlert(self, info):
-- alert = wxMessageDialog(self, info,
-- "Server Message", wxOK|wxICON_INFORMATION)
-+ alert = wx.MessageDialog(self, info,
-+ "Server Message", wx.OK|wx.ICON_INFORMATION)
- alert.ShowModal()
-
-
- def toggleZoom(self, event):
- if self.zoomButton.GetValue():
-- self.viewMenu.Check(self.ZOOM, true)
-+ self.viewMenu.Check(self.ZOOM, True)
- self.mapWindow.zoomIn()
- else:
-- self.viewMenu.Check(self.ZOOM, false)
-+ self.viewMenu.Check(self.ZOOM, False)
- self.mapWindow.zoomOut()
-
-
-@@ -341,17 +341,17 @@ class MainWindow(wxFrame):
-
- def toggleHistory(self, event):
- if self.historyButton.GetValue():
-- self.viewMenu.Check(self.HISTORY, true)
-- self.panelSizer.Prepend(self.historyWin, 0, wxEXPAND)
-- self.historyWin.Show(true)
-+ self.viewMenu.Check(self.HISTORY, True)
-+ self.panelSizer.Prepend(self.historyWin, 0, wx.EXPAND)
-+ self.historyWin.Show(True)
- self.panelSizer.Layout()
- else:
-- self.viewMenu.Check(self.HISTORY, false)
-- self.historyWin.Show(false)
-- self.panelSizer.Remove(self.historyWin)
-+ self.viewMenu.Check(self.HISTORY, False)
-+ self.historyWin.Show(False)
-+ self.panelSizer.Detach(self.historyWin)
- self.panelSizer.Layout()
-
-- # fix for graphical glitches in wxMSW
-+ # fix for graphical glitches in wx.MSW
- self.zoomButton.Refresh()
- self.historyButton.Refresh()
- self.moveButton.Refresh()
-@@ -365,8 +365,8 @@ class MainWindow(wxFrame):
- def toggleFullscreen(self, event):
- if not self.fullscreen:
- self.fullscreen = 1
-- self.viewMenu.Enable(self.HISTORY, false)
-- self.viewMenu.Check(self.FULLSCREEN, true)
-+ self.viewMenu.Enable(self.HISTORY, False)
-+ self.viewMenu.Check(self.FULLSCREEN, True)
- if self.historyButton.GetValue():
- self.historyWin.Hide()
- self.panelSizer.Remove(self.historyWin)
-@@ -386,34 +386,34 @@ class MainWindow(wxFrame):
- self.panelSizer.Layout()
- else:
- self.fullscreen = 0
-- self.viewMenu.Enable(self.HISTORY, true)
-- self.viewMenu.Check(self.FULLSCREEN, false)
-+ self.viewMenu.Enable(self.HISTORY, True)
-+ self.viewMenu.Check(self.FULLSCREEN, False)
- if self.historyButton.GetValue():
- self.historyWin.Show()
-- self.panelSizer.Prepend(self.historyWin, 0, wxEXPAND)
-- self.buttonSizer = wxBoxSizer(wxVERTICAL)
-- self.buttonSizer.Add(self.zoomButton, 0, wxALL, 5)
-- self.buttonSizer.Add(self.historyButton, 0, wxALL, 5)
-- self.buttonSizer.Add(self.moveButton, 0, wxALL, 5)
-- self.centerSizer = wxBoxSizer(wxHORIZONTAL)
-- self.centerSizer.Add(self.icons, 0, wxALIGN_CENTRE|wxALL)
-- self.centerSizer.Add(self.buttonSizer, 0, wxALIGN_CENTRE)
-- self.mainSizer.Add(self.centerSizer, 0, wxALIGN_CENTRE)
-+ self.panelSizer.Prepend(self.historyWin, 0, wx.EXPAND)
-+ self.buttonSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.buttonSizer.Add(self.zoomButton, 0, wx.ALL, 5)
-+ self.buttonSizer.Add(self.historyButton, 0, wx.ALL, 5)
-+ self.buttonSizer.Add(self.moveButton, 0, wx.ALL, 5)
-+ self.centerSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ self.centerSizer.Add(self.icons, 0, wx.ALIGN_CENTRE|wx.ALL)
-+ self.centerSizer.Add(self.buttonSizer, 0, wx.ALIGN_CENTRE)
-+ self.mainSizer.Add(self.centerSizer, 0, wx.ALIGN_CENTRE)
- self.icons.Show()
- self.zoomButton.Show()
- self.historyButton.Show()
- self.moveButton.Show()
- self.chatWindow.Show()
-- self.mainSizer.Add(self.chatWindow, 0, wxEXPAND | wxALL, 5)
-+ self.mainSizer.Add(self.chatWindow, 0, wx.EXPAND | wx.ALL, 5)
- self.mainSizer.Layout()
- self.panelSizer.Layout()
-
-
- # display the About dialog
- def showAbout(self, event):
-- about = wxMessageDialog(self, "London Law v" + LLAW_VERSION +
-+ about = wx.MessageDialog(self, "London Law v" + LLAW_VERSION +
- "\n\nA multiplayer manhunting adventure by Paul Pelzl",
-- "About London Law", wxOK|wxICON_INFORMATION)
-+ "About London Law", wx.OK|wx.ICON_INFORMATION)
- about.ShowModal()
-
- def scrollToPlayer0(self, event):
-@@ -442,7 +442,7 @@ class MainWindow(wxFrame):
- def setPawnTurn(self, pawnName):
- if pawnName == "X":
- if self.playerList[0][0] == self.username:
-- self.moveButton.Enable(true)
-+ self.moveButton.Enable(True)
- usernameStr = "you"
- else:
- usernameStr = self.playerList[0][0]
-@@ -451,7 +451,7 @@ class MainWindow(wxFrame):
- self.icons.setTurn(0)
- elif pawnName == "Red":
- if self.playerList[1][0] == self.username:
-- self.moveButton.Enable(true)
-+ self.moveButton.Enable(True)
- usernameStr = "you"
- else:
- usernameStr = self.playerList[1][0]
-@@ -460,7 +460,7 @@ class MainWindow(wxFrame):
- self.icons.setTurn(1)
- elif pawnName == "Yellow":
- if self.playerList[2][0] == self.username:
-- self.moveButton.Enable(true)
-+ self.moveButton.Enable(True)
- usernameStr = "you"
- else:
- usernameStr = self.playerList[2][0]
-@@ -469,7 +469,7 @@ class MainWindow(wxFrame):
- self.icons.setTurn(2)
- elif pawnName == "Green":
- if self.playerList[3][0] == self.username:
-- self.moveButton.Enable(true)
-+ self.moveButton.Enable(True)
- usernameStr = "you"
- else:
- usernameStr = self.playerList[3][0]
-@@ -478,7 +478,7 @@ class MainWindow(wxFrame):
- self.icons.setTurn(3)
- elif pawnName == "Blue":
- if self.playerList[4][0] == self.username:
-- self.moveButton.Enable(true)
-+ self.moveButton.Enable(True)
- usernameStr = "you"
- else:
- usernameStr = self.playerList[4][0]
-@@ -487,7 +487,7 @@ class MainWindow(wxFrame):
- self.icons.setTurn(4)
- elif pawnName == "Black":
- if self.playerList[5][0] == self.username:
-- self.moveButton.Enable(true)
-+ self.moveButton.Enable(True)
- usernameStr = "you"
- else:
- usernameStr = self.playerList[5][0]
-@@ -511,7 +511,7 @@ class MainWindow(wxFrame):
- # if event[0] == "game socket":
- # self.socket = event[1]
- # elif event[0] == "created move":
--# self.moveButton.Enable(false)
-+# self.moveButton.Enable(False)
- # elif event[0] == "move dialog destroyed":
- # self.moveDialogExists = 0
- # elif event[0] == "incoming chat":
-@@ -547,14 +547,14 @@ class MainWindow(wxFrame):
- # self.status.PushStatusText("It is the Blue Detective's turn (you).", 0)
- # elif self.playerIdx == 5:
- # self.status.PushStatusText("It is the Black Detective's turn (you).", 0)
--# self.moveButton.Enable(true)
-+# self.moveButton.Enable(True)
- # elif event[0] == "move accepted":
--# self.moveButton.Enable(false)
-+# self.moveButton.Enable(False)
- # elif event[0] == "move rejected":
--# self.moveButton.Enable(true) # just in case
-+# self.moveButton.Enable(True) # just in case
- # self.status.PushStatusText("The server rejected your move. It is still your turn.", 0)
- # elif event[0] == "double rejected":
--# self.moveButton.Enable(true) # just in case
-+# self.moveButton.Enable(True) # just in case
- # self.status.PushStatusText("The server rejected your double move. It is still your turn.", 0)
- # elif event[0] == "someone moved":
- # mover = event[1]
-@@ -661,16 +661,16 @@ class MainWindow(wxFrame):
- # elif event[0] == "x survived":
- # self.gameover = 1
- # self.status.PushStatusText("Mr. X survived! Game over.", 0)
--# alert = wxMessageDialog(self, "Mr. X successfully evaded the detectives!\nGame over.",
--# "Game Over", wxOK|wxICON_INFORMATION)
-+# alert = wx.MessageDialog(self, "Mr. X successfully evaded the detectives!\nGame over.",
-+# "Game Over", wx.OK|wx.ICON_INFORMATION)
- # alert.ShowModal()
- # elif event[0] == "detectives all stuck":
- # for i in range(1, 6):
- # self.icons.setStuck(i)
- # self.gameover = 1
- # self.status.PushStatusText("The detectives are all stuck! Game over.", 0)
--# alert = wxMessageDialog(self, "The detectives are all stuck!\nMr. X makes a clean getaway. Game over.",
--# "Game Over", wxOK|wxICON_INFORMATION)
-+# alert = wx.MessageDialog(self, "The detectives are all stuck!\nMr. X makes a clean getaway. Game over.",
-+# "Game Over", wx.OK|wx.ICON_INFORMATION)
- # alert.ShowModal()
- # elif event[0] == "x is caught":
- # self.gameover = 1
-@@ -685,12 +685,12 @@ class MainWindow(wxFrame):
- # elif event[1] == 5:
- # detstr = "the Black Detective"
- # self.status.PushStatusText("Mr. X was caught by "+detstr+" at "+`event[2]`+". The detectives win!", 0)
--# alert = wxMessageDialog(self, "Mr. X was caught by "+detstr+" at "+`event[2]`+
--# ". The detectives win!\nGame over.", "Game Over", wxOK|wxICON_INFORMATION)
-+# alert = wx.MessageDialog(self, "Mr. X was caught by "+detstr+" at "+`event[2]`+
-+# ". The detectives win!\nGame over.", "Game Over", wx.OK|wx.ICON_INFORMATION)
- # alert.ShowModal()
- # elif event[0] == "connection error":
--# alert = wxMessageDialog(self, "The server reports that the connection to "+`event[1]`+" was lost.\n" +
--# "The game will end.", "Connection Error", wxOK|wxICON_INFORMATION)
-+# alert = wx.MessageDialog(self, "The server reports that the connection to "+`event[1]`+" was lost.\n" +
-+# "The game will end.", "Connection Error", wx.OK|wx.ICON_INFORMATION)
- # alert.ShowModal()
- # self.disconnecting = 1
- # # FIXME: need a little more here... disable some widgets and so forth
-@@ -703,8 +703,8 @@ class MainWindow(wxFrame):
- # self.status.PushStatusText("Disconnected from server.", 0)
- # # FIXME: need a little more here... disable some widgets and so forth
- # elif not self.gameover:
--# alert = wxMessageDialog(self, "The connection to the server was lost.\nThe game will end.",
--# "Connection Error", wxOK|wxICON_ERROR)
-+# alert = wx.MessageDialog(self, "The connection to the server was lost.\nThe game will end.",
-+# "Connection Error", wx.OK|wx.ICON_ERROR)
- # alert.ShowModal()
- # # FIXME: need a little more here... disable some widgets and so forth
- # elif event[0] == "replay turn":
-Index: londonlaw-0.2.1/londonlaw/guiclient/MapWindow.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/MapWindow.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/MapWindow.py
-@@ -24,7 +24,7 @@
- # to launch a MoveDialog.
-
-
--from wxPython.wx import *
-+import wx
- from TextPanel import *
- from graphicalmap import *
- from londonlaw.common.config import *
-@@ -34,18 +34,18 @@ import os
- PlayerNumError = "Player Number Error"
-
-
--class MapWindow(wxScrolledWindow):
-+class MapWindow(wx.ScrolledWindow):
- def __init__(self, parent, usernameList):
-- wxScrolledWindow.__init__(self, parent)
-+ wx.ScrolledWindow.__init__(self, parent)
-
- # load the map image and prepare a DC for it
- mapImageFile = os.path.normpath(os.path.join(MEDIAROOT, "images/map.jpg"))
-- mapImage = wxImage(mapImageFile, wxBITMAP_TYPE_JPEG)
-- self.mapBitmap = wxBitmapFromImage(mapImage)
-- self.bmpDC = wxMemoryDC()
-+ mapImage = wx.Image(mapImageFile, wx.BITMAP_TYPE_JPEG)
-+ self.mapBitmap = wx.BitmapFromImage(mapImage)
-+ self.bmpDC = wx.MemoryDC()
- mapImageFile = os.path.normpath(os.path.join(MEDIAROOT, "images/map-quarter.jpg"))
-- mapImage = wxImage(mapImageFile, wxBITMAP_TYPE_JPEG)
-- self.mapBitmapSmall = wxBitmapFromImage(mapImage)
-+ mapImage = wx.Image(mapImageFile, wx.BITMAP_TYPE_JPEG)
-+ self.mapBitmapSmall = wx.BitmapFromImage(mapImage)
- self.bmpDC.SelectObject(self.mapBitmapSmall)
-
- self.zoomLevel = 2
-@@ -56,13 +56,13 @@ class MapWindow(wxScrolledWindow):
- self.SetVirtualSize((self.mapBitmapSmall.GetWidth(), self.mapBitmapSmall.GetHeight()))
- self.SetScrollRate(10, 10)
-
-- self.maskColour = wxColour(10,10,10)
-- self.pen = wxPen(wxBLACK, 3, wxSOLID)
-- self.brush = wxBrush(wxWHITE, wxSOLID)
-- self.bgBrush = wxBrush(self.maskColour, wxSOLID)
-- self.pushpinDC = wxMemoryDC()
-+ self.maskColour = wx.Colour(10,10,10)
-+ self.pen = wx.Pen(wx.BLACK, 3, wx.SOLID)
-+ self.brush = wx.Brush(wx.WHITE, wx.SOLID)
-+ self.bgBrush = wx.Brush(self.maskColour, wx.SOLID)
-+ self.pushpinDC = wx.MemoryDC()
-
-- self.labelsShown = false
-+ self.labelsShown = False
-
- self.playerLoc = []
- self.pushpins = []
-@@ -72,33 +72,33 @@ class MapWindow(wxScrolledWindow):
- for i in range(6):
- self.playerLoc.append(0)
- filename = os.path.normpath(os.path.join(MEDIAROOT, "images/pin" + str(i) + ".png"))
-- pushpinImage = wxImage(filename, wxBITMAP_TYPE_ANY)
-+ pushpinImage = wx.Image(filename, wx.BITMAP_TYPE_ANY)
- pushpinImage.SetMaskColour(255, 0, 242) # the purplish colour is not to be drawn
-- pushpinBitmap = wxBitmapFromImage(pushpinImage)
-+ pushpinBitmap = wx.BitmapFromImage(pushpinImage)
- self.pushpins.append(pushpinBitmap)
-- pushpinBackBmp = wxEmptyBitmap(pushpinBitmap.GetWidth(), pushpinBitmap.GetHeight(), -1)
-+ pushpinBackBmp = wx.EmptyBitmap(pushpinBitmap.GetWidth(), pushpinBitmap.GetHeight(), -1)
- self.pushpinBackgrounds.append(pushpinBackBmp)
-- self.labels.append(TextPanel(self, " " + usernameList[i][:20] + " ", 10, wxSIMPLE_BORDER))
-+ self.labels.append(TextPanel(self, " " + usernameList[i][:20] + " ", 10, wx.SIMPLE_BORDER))
- self.labels[i].Hide()
-- self.labels[i].SetBackgroundColour(wxColour(220, 220, 220))
-+ self.labels[i].SetBackgroundColour(wx.Colour(220, 220, 220))
-
-
-- EVT_PAINT(self, self.OnPaint)
-- EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
-+ wx.EVT_PAINT(self, self.OnPaint)
-+ wx.EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
- # scroll the map on middle or right button drag
-- EVT_MIDDLE_DOWN(self, self.handleMiddleOrRightMouse)
-- EVT_RIGHT_DOWN(self, self.handleMiddleOrRightMouse)
-- EVT_MOTION(self, self.handleMoveMouse)
-+ wx.EVT_MIDDLE_DOWN(self, self.handleMiddleOrRightMouse)
-+ wx.EVT_RIGHT_DOWN(self, self.handleMiddleOrRightMouse)
-+ wx.EVT_MOTION(self, self.handleMoveMouse)
-
-
- def OnPaint(self, event):
-- dc = wxPaintDC(self)
-+ dc = wx.PaintDC(self)
- self.PrepareDC(dc)
- self.OnDraw(dc)
-
-
- # try to eliminate flicker from painting the window background.
-- # (why doesn't this work in wxGTK?)
-+ # (why doesn't this work in wx.GTK?)
- def OnEraseBackground(self, event):
- pass
-
-@@ -114,7 +114,7 @@ class MapWindow(wxScrolledWindow):
- newX, newY = event.GetPosition()
- stepX, stepY = self.GetScrollPixelsPerUnit()
- sX, sY = self.GetViewStart()
-- if (event.m_rightDown or event.m_middleDown) and event.Dragging():
-+ if (event.rightIsDown or event.middleIsDown) and event.Dragging():
- pixelDX = newX - self.oldX
- pixelDY = newY - self.oldY
- dx = pixelDX / stepX
-@@ -130,10 +130,10 @@ class MapWindow(wxScrolledWindow):
- if loc == self.playerLoc[i]:
- self.labels[i].Show()
- self.labels[i].Raise()
-- self.labelsShown = true
-+ self.labelsShown = True
- break
- elif self.labelsShown:
-- self.labelsShown = false
-+ self.labelsShown = False
- for i in range(6):
- self.labels[i].Hide()
-
-@@ -203,7 +203,7 @@ class MapWindow(wxScrolledWindow):
- self.pushpinDC.BeginDrawing()
- self.bmpDC.Blit(mapPixel[0]-self.pushpinOffset[0], mapPixel[1]-self.pushpinOffset[1],
- self.pushpinBackgrounds[playerNum].GetWidth(),
-- self.pushpinBackgrounds[playerNum].GetHeight(), self.pushpinDC, 0, 0, wxCOPY, TRUE)
-+ self.pushpinBackgrounds[playerNum].GetHeight(), self.pushpinDC, 0, 0, wx.COPY, True)
- self.pushpinDC.EndDrawing()
-
-
-@@ -256,7 +256,7 @@ class MapWindow(wxScrolledWindow):
- sX, sY = self.GetViewStart()
- self.labels[i].MoveXY(mapPixel[0] - 20 - sX*stepX, mapPixel[1] - 10 - sY*stepY)
-
-- self.Refresh(FALSE)
-+ self.Refresh(False)
-
-
- # switch to zoom level 2
-@@ -290,7 +290,7 @@ class MapWindow(wxScrolledWindow):
- sX, sY = self.GetViewStart()
- self.labels[i].MoveXY(mapPixel[0] - 20 - sX*stepX, mapPixel[1] - 10 - sY*stepY)
-
-- self.Refresh(FALSE)
-+ self.Refresh(False)
-
-
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/MoveDialog.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/MoveDialog.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/MoveDialog.py
-@@ -19,7 +19,7 @@
-
- # MoveDialog.py
- #
--# This class generates a wxDialog that is used to choose a move (or double move).
-+# This class generates a wx.Dialog that is used to choose a move (or double move).
- # Drop-down boxes allow the player to choose from the possible moves. The code
- # is rather lengthy because the MoveDialog validates itself on-the-fly: that is,
- # the transportation drop-down box always shows only transports that are available
-@@ -28,21 +28,21 @@
- # FIXME: this appears to be correct, but needs some major cleanup. Maybe some portions
- # can be factored better into functions.
-
--from wxPython.wx import *
-+import wx
- from londonlaw.common.map import *
-
-
-
--DIALOGDESTROYED = wxNewEventType()
-+DIALOGDESTROYED = wx.NewEventType()
-
- def EVT_DIALOGDESTROYED(window, function):
- """Your documentation here"""
- window.Connect(-1, -1, DIALOGDESTROYED, function)
-
--class DialogDestroyedEvent(wxPyCommandEvent):
-+class DialogDestroyedEvent(wx.PyCommandEvent):
- eventType = DIALOGDESTROYED
- def __init__(self, windowID):
-- wxPyCommandEvent.__init__(self, self.eventType, windowID)
-+ wx.PyCommandEvent.__init__(self, self.eventType, windowID)
-
- def Clone(self):
- self.__class__(self.GetId())
-@@ -50,19 +50,19 @@ class DialogDestroyedEvent(wxPyCommandEv
-
-
-
--class MoveDialog(wxDialog):
-+class MoveDialog(wx.Dialog):
- # currPos is an integer indicating the current player position
- # destPos is a first choice destination, which the player probably
- # chose by clicking on a map location
- # players is a list of locations and tokens for all players
- # playerIdx is the index if this player in that list
- # Use EVT_GOT_MOVE to catch the return values (insert derogatory comment about
-- # lack of flexibility in return values for wxDialog::EndModal())
-+ # lack of flexibility in return values for wx.Dialog::EndModal())
- def __init__(self, parent, ID, destPos, playerList, playerIdx, messenger):
-- wxDialog.__init__(self, parent, ID, "Choose a Move")
-+ wx.Dialog.__init__(self, parent, ID, "Choose a Move")
- self.parent = parent
-
-- self.panel = wxPanel(self, -1)
-+ self.panel = wx.Panel(self, -1)
-
- self.playerIdx = playerIdx
- self.playerList = playerList
-@@ -71,41 +71,41 @@ class MoveDialog(wxDialog):
-
- # Mr. X gets the option of a double move
- if self.playerIdx == 0:
-- self.moveType = wxRadioBox(self.panel, -1, "move type: ", wxDefaultPosition, wxDefaultSize,
-- ["Single", "Double"], 1, wxRA_SPECIFY_ROWS)
-+ self.moveType = wx.RadioBox(self.panel, -1, "move type: ", wx.DefaultPosition, wx.DefaultSize,
-+ ["Single", "Double"], 1, wx.RA_SPECIFY_ROWS)
- # If he has no double move tokens, then it's disabled
- if self.playerList[self.playerIdx][2][4] < 1:
-- self.moveType.Enable(false)
-+ self.moveType.Enable(False)
-
-- self.pos1Label = wxStaticText(self.panel, -1, "Move from "+`self.currPos`+" to ", wxPoint(0,0))
-- self.trans1Label = wxStaticText(self.panel, -1, " using ", wxPoint(0,0))
-+ self.pos1Label = wx.StaticText(self.panel, -1, "Move from "+`self.currPos`+" to ", wx.Point(0,0))
-+ self.trans1Label = wx.StaticText(self.panel, -1, " using ", wx.Point(0,0))
-
- self.moves, self.movesStr = self.getAvailMoves(self.currPos, self.playerList, self.playerIdx)
-- self.dest1Box = wxChoice(self.panel, -1, wxDefaultPosition, wxDefaultSize, self.movesStr)
-+ self.dest1Box = wx.Choice(self.panel, -1, wx.DefaultPosition, wx.DefaultSize, self.movesStr)
- self.dest1Box.SetSelection(0)
- if destPos in self.moves:
-- self.Show(TRUE)
-+ self.Show(True)
- for i in range(len(self.moves)):
- if self.moves[i] == destPos:
- self.dest1Box.SetSelection(i)
- break
- else:
-- self.Show(FALSE)
-+ self.Show(False)
- if destPos != 0:
- self.drawMoveErrorDialog()
-
-
-- self.trans1ID = wxNewId()
-+ self.trans1ID = wx.NewId()
- self.trans, self.transStr = self.getAvailTransports(self.currPos, self.moves[self.dest1Box.GetSelection()],
- self.playerList[self.playerIdx][2], self.playerIdx)
-- self.trans1Box = wxChoice(self.panel, self.trans1ID, wxDefaultPosition, wxDefaultSize, self.transStr)
-+ self.trans1Box = wx.Choice(self.panel, self.trans1ID, wx.DefaultPosition, wx.DefaultSize, self.transStr)
- self.trans1Box.SetSelection(0)
-
-
- # double move options
- if self.playerIdx == 0:
-- self.pos2Label = wxStaticText(self.panel, -1, "Move from "+self.dest1Box.GetStringSelection()+" to ", wxPoint(0,0))
-- self.trans2Label = wxStaticText(self.panel, -1, " using ", wxPoint(0,0))
-+ self.pos2Label = wx.StaticText(self.panel, -1, "Move from "+self.dest1Box.GetStringSelection()+" to ", wx.Point(0,0))
-+ self.trans2Label = wx.StaticText(self.panel, -1, " using ", wx.Point(0,0))
-
- # create a new playerList that has an updated location and list of tokens for Mr. X, assuming
- # that the first leg of the double move is complete. This new list is required to figure out
-@@ -123,79 +123,79 @@ class MoveDialog(wxDialog):
- for i in range(1, len(self.playerList)):
- pl2.append(self.playerList[i])
-
-- self.dest2ID = wxNewId()
-+ self.dest2ID = wx.NewId()
- self.moves2, self.moves2Str = self.getAvailMoves(self.moves[self.dest1Box.GetSelection()], pl2, 0)
-- self.dest2Box = wxChoice(self.panel, self.dest2ID, wxDefaultPosition, wxDefaultSize, self.moves2Str)
-+ self.dest2Box = wx.Choice(self.panel, self.dest2ID, wx.DefaultPosition, wx.DefaultSize, self.moves2Str)
- self.dest2Box.SetSelection(0)
-
-- self.trans2ID = wxNewId()
-+ self.trans2ID = wx.NewId()
- self.trans2, self.trans2Str = self.getAvailTransports(self.moves[self.dest1Box.GetSelection()],
- self.moves2[self.dest2Box.GetSelection()], pl2[0][2], 0)
-- self.trans2Box = wxChoice(self.panel, self.trans2ID, wxDefaultPosition, wxDefaultSize, self.trans2Str)
-+ self.trans2Box = wx.Choice(self.panel, self.trans2ID, wx.DefaultPosition, wx.DefaultSize, self.trans2Str)
- self.trans2Box.SetSelection(0)
-
-- self.move2Sizer = wxBoxSizer(wxHORIZONTAL)
-- self.move2Sizer.Add(self.pos2Label, 0, wxALIGN_CENTRE | wxALL | wxADJUST_MINSIZE, 5)
-- self.move2Sizer.Add(self.dest2Box, 0, wxALIGN_CENTRE | wxALL, 5)
-- self.move2Sizer.Add(self.trans2Label, 0, wxALIGN_CENTRE | wxALL | wxADJUST_MINSIZE, 5)
-- self.move2Sizer.Add(self.trans2Box, 0, wxALIGN_CENTRE | wxALL, 5)
--
-- labelFont = wxFont(self.GetFont().GetPointSize(), wxDEFAULT, wxNORMAL, wxBOLD)
-- labelFont.SetWeight(wxBOLD)
-- self.move1Label = wxStaticText(self.panel, -1, "Move One:")
-- self.move2Label = wxStaticText(self.panel, -1, "Move Two:")
-+ self.move2Sizer = wx.BoxSizer(wx.HORIZONTAL)
-+ self.move2Sizer.Add(self.pos2Label, 0, wx.ALIGN_CENTRE | wx.ALL | wx.ADJUST_MINSIZE, 5)
-+ self.move2Sizer.Add(self.dest2Box, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-+ self.move2Sizer.Add(self.trans2Label, 0, wx.ALIGN_CENTRE | wx.ALL | wx.ADJUST_MINSIZE, 5)
-+ self.move2Sizer.Add(self.trans2Box, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-+
-+ labelFont = wx.Font(self.GetFont().GetPointSize(), wx.DEFAULT, wx.NORMAL, wx.BOLD)
-+ labelFont.SetWeight(wx.BOLD)
-+ self.move1Label = wx.StaticText(self.panel, -1, "Move One:")
-+ self.move2Label = wx.StaticText(self.panel, -1, "Move Two:")
- self.move1Label.SetFont(labelFont)
- self.move2Label.SetFont(labelFont)
-
- if self.playerIdx == 0:
-- self.move2Label.Enable(false)
-- self.pos2Label.Enable(false)
-- self.trans2Label.Enable(false)
-- self.dest2Box.Enable(false)
-- self.trans2Box.Enable(false)
--
--
-- okButton = wxButton(self.panel, wxID_OK, "OK")
-- cancelButton = wxButton(self.panel, wxID_CANCEL, "Cancel")
--
-- self.move1Sizer = wxBoxSizer(wxHORIZONTAL)
-- self.move1Sizer.Add(self.pos1Label, 0, wxALIGN_CENTRE | wxALL | wxADJUST_MINSIZE, 5)
-- self.move1Sizer.Add(self.dest1Box, 0, wxALIGN_CENTRE | wxALL, 5)
-- self.move1Sizer.Add(self.trans1Label, 0, wxALIGN_CENTRE | wxALL | wxADJUST_MINSIZE, 5)
-- self.move1Sizer.Add(self.trans1Box, 0, wxALIGN_CENTRE | wxALL, 5)
--
-- buttonSizer = wxBoxSizer(wxHORIZONTAL)
-- buttonSizer.Add(cancelButton, 0, wxALIGN_CENTRE | wxALL, 5)
-- buttonSizer.Add(okButton, 0, wxALIGN_CENTRE | wxALL, 5)
-+ self.move2Label.Enable(False)
-+ self.pos2Label.Enable(False)
-+ self.trans2Label.Enable(False)
-+ self.dest2Box.Enable(False)
-+ self.trans2Box.Enable(False)
-+
-+
-+ okButton = wx.Button(self.panel, wx.ID_OK, "OK")
-+ cancelButton = wx.Button(self.panel, wx.ID_CANCEL, "Cancel")
-+
-+ self.move1Sizer = wx.BoxSizer(wx.HORIZONTAL)
-+ self.move1Sizer.Add(self.pos1Label, 0, wx.ALIGN_CENTRE | wx.ALL | wx.ADJUST_MINSIZE, 5)
-+ self.move1Sizer.Add(self.dest1Box, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-+ self.move1Sizer.Add(self.trans1Label, 0, wx.ALIGN_CENTRE | wx.ALL | wx.ADJUST_MINSIZE, 5)
-+ self.move1Sizer.Add(self.trans1Box, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-+
-+ buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ buttonSizer.Add(cancelButton, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-+ buttonSizer.Add(okButton, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-
-- self.pSizer = wxBoxSizer(wxVERTICAL)
-+ self.pSizer = wx.BoxSizer(wx.VERTICAL)
- if self.playerIdx == 0:
-- self.pSizer.Add(self.moveType, 0, wxALIGN_CENTRE | wxALL, 5)
-- self.pSizer.Add(self.move1Label, 0, wxALIGN_LEFT | wxLEFT | wxTOP, 5)
-+ self.pSizer.Add(self.moveType, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
-+ self.pSizer.Add(self.move1Label, 0, wx.ALIGN_LEFT | wx.LEFT | wx.TOP, 5)
- self.move1Sizer.Prepend((10,1),0,0)
-- self.pSizer.Add(self.move1Sizer, 0, wxALIGN_CENTRE | wxALL | wxADJUST_MINSIZE, 5)
-+ self.pSizer.Add(self.move1Sizer, 0, wx.ALIGN_CENTRE | wx.ALL | wx.ADJUST_MINSIZE, 5)
- if self.playerIdx == 0:
-- self.pSizer.Add(self.move2Label, 0, wxALIGN_LEFT | wxLEFT | wxTOP, 5)
-+ self.pSizer.Add(self.move2Label, 0, wx.ALIGN_LEFT | wx.LEFT | wx.TOP, 5)
- self.move2Sizer.Prepend((10,1),0,0)
-- self.pSizer.Add(self.move2Sizer, 0, wxALIGN_CENTRE | wxALL | wxADJUST_MINSIZE, 5)
-- self.pSizer.Add(buttonSizer, 0, wxALIGN_RIGHT | wxALL, 5)
-+ self.pSizer.Add(self.move2Sizer, 0, wx.ALIGN_CENTRE | wx.ALL | wx.ADJUST_MINSIZE, 5)
-+ self.pSizer.Add(buttonSizer, 0, wx.ALIGN_RIGHT | wx.ALL, 5)
-
- self.panel.SetSizer(self.pSizer)
- self.pSizer.Fit(self.panel)
-- self.sizer = wxBoxSizer(wxVERTICAL)
-- self.sizer.Add(self.panel, 1, wxEXPAND | wxALL | wxADJUST_MINSIZE, 5)
-+ self.sizer = wx.BoxSizer(wx.VERTICAL)
-+ self.sizer.Add(self.panel, 1, wx.EXPAND | wx.ALL | wx.ADJUST_MINSIZE, 5)
- self.SetSizer(self.sizer)
- self.sizer.Fit(self)
- self.SetAutoLayout(1)
-
- self.dest1Box.SetFocus()
-
-- EVT_BUTTON(self, wxID_CANCEL, self.OnCancel)
-- EVT_BUTTON(self, wxID_OK, self.OnOK)
-- EVT_CHOICE(self, self.dest1Box.GetId(), self.updateTrans1)
-+ wx.EVT_BUTTON(self, wx.ID_CANCEL, self.OnCancel)
-+ wx.EVT_BUTTON(self, wx.ID_OK, self.OnOK)
-+ wx.EVT_CHOICE(self, self.dest1Box.GetId(), self.updateTrans1)
- if self.playerIdx == 0:
-- EVT_CHOICE(self, self.dest2Box.GetId(), self.updateTrans2Evt)
-- EVT_RADIOBOX(self, self.moveType.GetId(), self.updateDouble)
-+ wx.EVT_CHOICE(self, self.dest2Box.GetId(), self.updateTrans2Evt)
-+ wx.EVT_RADIOBOX(self, self.moveType.GetId(), self.updateDouble)
-
-
- def drawMoveErrorDialog(self):
-@@ -211,13 +211,13 @@ class MoveDialog(wxDialog):
- prefix = "The Blue Detective"
- elif self.playerIdx == 5:
- prefix = "The Black Detective"
-- alert = wxMessageDialog(self.parent, prefix + " can't move to that location.", "Illegal Move", wxOK|wxICON_ERROR)
-+ alert = wx.MessageDialog(self.parent, prefix + " can't move to that location.", "Illegal Move", wx.OK|wx.ICON_ERROR)
- alert.ShowModal()
-
-
- def setDest1(self, destPos):
- if destPos in self.moves:
-- self.Show(TRUE)
-+ self.Show(True)
- for i in range(len(self.moves)):
- if self.moves[i] == destPos:
- self.dest1Box.SetSelection(i)
-@@ -229,17 +229,17 @@ class MoveDialog(wxDialog):
-
- def updateDouble(self, event):
- if self.moveType.GetSelection() == 0:
-- self.move2Label.Enable(false)
-- self.pos2Label.Enable(false)
-- self.trans2Label.Enable(false)
-- self.dest2Box.Enable(false)
-- self.trans2Box.Enable(false)
-+ self.move2Label.Enable(False)
-+ self.pos2Label.Enable(False)
-+ self.trans2Label.Enable(False)
-+ self.dest2Box.Enable(False)
-+ self.trans2Box.Enable(False)
- else:
-- self.move2Label.Enable(true)
-- self.pos2Label.Enable(true)
-- self.trans2Label.Enable(true)
-- self.dest2Box.Enable(true)
-- self.trans2Box.Enable(true)
-+ self.move2Label.Enable(True)
-+ self.pos2Label.Enable(True)
-+ self.trans2Label.Enable(True)
-+ self.dest2Box.Enable(True)
-+ self.trans2Box.Enable(True)
-
-
-
-@@ -250,9 +250,9 @@ class MoveDialog(wxDialog):
- self.playerList[self.playerIdx][2], self.playerIdx)
- self.move1Sizer.Remove(self.trans1Box)
- self.trans1Box.Destroy()
-- self.trans1Box = wxChoice(self.panel, self.trans1ID, wxDefaultPosition, wxDefaultSize, self.transStr)
-+ self.trans1Box = wx.Choice(self.panel, self.trans1ID, wx.DefaultPosition, wx.DefaultSize, self.transStr)
- self.trans1Box.SetSelection(0)
-- self.move1Sizer.Add(self.trans1Box, 0, wxALIGN_CENTRE | wxALL, 5)
-+ self.move1Sizer.Add(self.trans1Box, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
- self.move1Sizer.Layout()
- self.updateDest2()
-
-@@ -280,15 +280,13 @@ class MoveDialog(wxDialog):
- pl2.append(self.playerList[i])
-
- self.moves2, self.moves2Str = self.getAvailMoves(self.moves[self.dest1Box.GetSelection()], pl2, 0)
-- self.move2Sizer.Remove(self.pos2Label)
-- self.move2Sizer.Remove(self.dest2Box)
-+ self.move2Sizer.Detach(self.dest2Box)
- self.dest2Box.Destroy()
-- self.dest2Box = wxChoice(self.panel, self.dest2ID, wxDefaultPosition, wxDefaultSize, self.moves2Str)
-+ self.dest2Box = wx.Choice(self.panel, self.dest2ID, wx.DefaultPosition, wx.DefaultSize, self.moves2Str)
- self.dest2Box.SetSelection(0)
- if self.moveType.GetSelection() == 0:
-- self.dest2Box.Enable(false)
-- self.move2Sizer.Prepend(self.dest2Box, 0, wxALIGN_CENTRE | wxALL, 5)
-- self.move2Sizer.Prepend(self.pos2Label, 0, wxALIGN_CENTRE | wxALL | wxADJUST_MINSIZE, 5)
-+ self.dest2Box.Enable(False)
-+ self.move2Sizer.Insert(2, self.dest2Box, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
- self.updateTrans2()
- else:
- self.sizer.Layout()
-@@ -307,11 +305,11 @@ class MoveDialog(wxDialog):
- self.moves2[self.dest2Box.GetSelection()], xtokens, 0)
- self.move2Sizer.Remove(self.trans2Box)
- self.trans2Box.Destroy()
-- self.trans2Box = wxChoice(self.panel, self.trans2ID, wxDefaultPosition, wxDefaultSize, self.trans2Str)
-+ self.trans2Box = wx.Choice(self.panel, self.trans2ID, wx.DefaultPosition, wx.DefaultSize, self.trans2Str)
- self.trans2Box.SetSelection(0)
- if self.moveType.GetSelection() == 0:
-- self.trans2Box.Enable(false)
-- self.move2Sizer.Add(self.trans2Box, 0, wxALIGN_CENTRE | wxALL, 5)
-+ self.trans2Box.Enable(False)
-+ self.move2Sizer.Add(self.trans2Box, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
- self.move2Sizer.Layout()
- self.sizer.Layout()
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/PlayerIcon.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/PlayerIcon.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/PlayerIcon.py
-@@ -23,7 +23,7 @@
- # There are captions for names and readouts of the available tokens.
- # Status icons can be overlaid on the player icons to show whose turn it is, etc.
-
--from wxPython.wx import *
-+import wx
- from TextPanel import *
- from StaticBitmap import *
- from londonlaw.common.config import *
-@@ -34,82 +34,82 @@ import os
- # readout of the available tokens.
- # expects a list of three tokens (taxi, bus, undergnd) or a list of five
- # tokens (taxi, bus, undergnd, black, double)
--class PlayerIcon(wxPanel):
-+class PlayerIcon(wx.Panel):
- def __init__(self, parent, imagefile, thinkingimagefile, stuckimagefile,
- name, tokenList, isMrX = False):
-- wxPanel.__init__(self, parent, -1) #wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER)
-+ wx.Panel.__init__(self, parent, -1) #wx.DefaultPosition, wx.DefaultSize, wx.SIMPLE_BORDER)
-
-- self.iconPanel = wxPanel(self, -1)
-+ self.iconPanel = wx.Panel(self, -1)
- self.isStuck = False
- self.isMrX = isMrX
-
- # load the image
-- iconImage = wxImage(imagefile, wxBITMAP_TYPE_ANY)
-+ iconImage = wx.Image(imagefile, wx.BITMAP_TYPE_ANY)
- # we need an extra copy of the player icon, so we can blit to one of them in memory
-- self.playerBitmap = wxBitmapFromImage(iconImage)
-- self.iconBitmap = wxBitmapFromImage(iconImage)
-- self.iconBitmap2 = wxBitmapFromImage(iconImage)
-+ self.playerBitmap = wx.BitmapFromImage(iconImage)
-+ self.iconBitmap = wx.BitmapFromImage(iconImage)
-+ self.iconBitmap2 = wx.BitmapFromImage(iconImage)
- self.icon = StaticBitmap(self.iconPanel, -1, self.iconBitmap)
-
- # load the overlay image for the "I'm thinking" question mark
-- thinkingImage = wxImage(thinkingimagefile, wxBITMAP_TYPE_ANY)
-+ thinkingImage = wx.Image(thinkingimagefile, wx.BITMAP_TYPE_ANY)
- thinkingImage.SetMaskColour(255, 0, 242) # the purplish colour is not to be drawn
-- self.thinkingBitmap = wxBitmapFromImage(thinkingImage)
-+ self.thinkingBitmap = wx.BitmapFromImage(thinkingImage)
-
- # load the overlay image for the "I'm stuck" stop sign
-- stuckImage = wxImage(stuckimagefile, wxBITMAP_TYPE_ANY)
-+ stuckImage = wx.Image(stuckimagefile, wx.BITMAP_TYPE_ANY)
- stuckImage.SetMaskColour(255, 0, 242) # the purplish colour is not to be drawn
-- self.stuckBitmap = wxBitmapFromImage(stuckImage)
-+ self.stuckBitmap = wx.BitmapFromImage(stuckImage)
-
-- iconSizer = wxBoxSizer(wxVERTICAL)
-- iconSizer.Add(self.icon, 0, wxADJUST_MINSIZE)
-+ iconSizer = wx.BoxSizer(wx.VERTICAL)
-+ iconSizer.Add(self.icon, 0, wx.ADJUST_MINSIZE)
- self.iconPanel.SetSizer(iconSizer)
- iconSizer.Fit(self.iconPanel)
-
-
- # create the caption
-- self.caption = TextPanel(self, " "+name[:20]+" ", 10, wxSIMPLE_BORDER)#|wxALIGN_CENTRE
-+ self.caption = TextPanel(self, " "+name[:20]+" ", 10, wx.SIMPLE_BORDER)#|wx.ALIGN_CENTRE
-
- # create the inventory labels
- if self.isMrX:
-- self.blackLabel = TextPanel(self, " "+`tokenList[3]`+" ", 10, wxEXPAND)
-- self.blackLabel.SetBackgroundColour(wxColour(0,0,0))
-- self.blackLabel.SetForegroundColour(wxColour(255,255,255))
-- self.doubleLabel = TextPanel(self, " "+`tokenList[4]`+" ", 10, wxEXPAND)
-- self.doubleLabel.SetBackgroundColour(wxColour(255,84,166))
-+ self.blackLabel = TextPanel(self, " "+`tokenList[3]`+" ", 10, wx.EXPAND)
-+ self.blackLabel.SetBackgroundColour(wx.Colour(0,0,0))
-+ self.blackLabel.SetForegroundColour(wx.Colour(255,255,255))
-+ self.doubleLabel = TextPanel(self, " "+`tokenList[4]`+" ", 10, wx.EXPAND)
-+ self.doubleLabel.SetBackgroundColour(wx.Colour(255,84,166))
- else:
-- self.taxiLabel = TextPanel(self, " "+`tokenList[0]`+" ", 10, wxEXPAND)
-- self.taxiLabel.SetBackgroundColour(wxColour(255, 191, 0))
-- self.busLabel = TextPanel(self, " "+`tokenList[1]`+" ", 10, wxEXPAND)
-- self.busLabel.SetBackgroundColour(wxColour(7, 155, 0))
-- self.ugndLabel = TextPanel(self, " "+`tokenList[2]`+" ", 10, wxEXPAND)
-- self.ugndLabel.SetBackgroundColour(wxColour(160, 36, 96))
-- self.ugndLabel.SetForegroundColour(wxColour(255, 255, 255))
-+ self.taxiLabel = TextPanel(self, " "+`tokenList[0]`+" ", 10, wx.EXPAND)
-+ self.taxiLabel.SetBackgroundColour(wx.Colour(255, 191, 0))
-+ self.busLabel = TextPanel(self, " "+`tokenList[1]`+" ", 10, wx.EXPAND)
-+ self.busLabel.SetBackgroundColour(wx.Colour(7, 155, 0))
-+ self.ugndLabel = TextPanel(self, " "+`tokenList[2]`+" ", 10, wx.EXPAND)
-+ self.ugndLabel.SetBackgroundColour(wx.Colour(160, 36, 96))
-+ self.ugndLabel.SetForegroundColour(wx.Colour(255, 255, 255))
-
- # stack the inventory labels vertically
-- self.invSizer = wxBoxSizer(wxVERTICAL)
-+ self.invSizer = wx.BoxSizer(wx.VERTICAL)
- if self.isMrX:
-- self.invSizer.Add(self.blackLabel, 1, wxEXPAND|wxADJUST_MINSIZE)
-- self.invSizer.Add(self.doubleLabel, 1, wxEXPAND|wxADJUST_MINSIZE)
-+ self.invSizer.Add(self.blackLabel, 1, wx.EXPAND|wx.ADJUST_MINSIZE)
-+ self.invSizer.Add(self.doubleLabel, 1, wx.EXPAND|wx.ADJUST_MINSIZE)
- else:
-- self.invSizer.Add(self.taxiLabel, 1, wxEXPAND|wxADJUST_MINSIZE)
-- self.invSizer.Add(self.busLabel, 1, wxEXPAND|wxADJUST_MINSIZE)
-- self.invSizer.Add(self.ugndLabel, 1, wxEXPAND|wxADJUST_MINSIZE)
-+ self.invSizer.Add(self.taxiLabel, 1, wx.EXPAND|wx.ADJUST_MINSIZE)
-+ self.invSizer.Add(self.busLabel, 1, wx.EXPAND|wx.ADJUST_MINSIZE)
-+ self.invSizer.Add(self.ugndLabel, 1, wx.EXPAND|wx.ADJUST_MINSIZE)
-
- # group the icon with the inventory
-- iconInvSizer = wxBoxSizer(wxHORIZONTAL)
-- iconInvSizer.Add(self.iconPanel, 0, wxALIGN_TOP|wxADJUST_MINSIZE)
-- iconInvSizer.Add(self.invSizer, 0, wxALIGN_TOP|wxADJUST_MINSIZE)
-+ iconInvSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ iconInvSizer.Add(self.iconPanel, 0, wx.ALIGN_TOP|wx.ADJUST_MINSIZE)
-+ iconInvSizer.Add(self.invSizer, 0, wx.ALIGN_TOP|wx.ADJUST_MINSIZE)
-
- # put the caption under the bitmap and inventory lists
-- self.topSizer = wxBoxSizer(wxVERTICAL)
-- self.topSizer.Add(iconInvSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 20)
-- self.topSizer.Add(self.caption, 0, wxEXPAND|wxALIGN_CENTRE|wxALL, 2)
-+ self.topSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.topSizer.Add(iconInvSizer, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 20)
-+ self.topSizer.Add(self.caption, 0, wx.EXPAND|wx.ALIGN_CENTRE|wx.ALL, 2)
- self.SetSizer(self.topSizer)
- self.topSizer.SetSizeHints(self)
-
-- self.iconDC = wxMemoryDC()
-- self.srcDC = wxMemoryDC()
-+ self.iconDC = wx.MemoryDC()
-+ self.srcDC = wx.MemoryDC()
-
-
- def updateTokens(self, tokenList):
-@@ -131,14 +131,14 @@ class PlayerIcon(wxPanel):
- self.srcDC, 0, 0)
- self.srcDC.SelectObject(self.thinkingBitmap)
- self.iconDC.Blit(0, 0, self.iconBitmap.GetWidth(), self.iconBitmap.GetHeight(),
-- self.srcDC, 0, 0, wxCOPY, TRUE)
-+ self.srcDC, 0, 0, wx.COPY, True)
- self.iconDC.EndDrawing()
-- self.iconDC.SelectObject(wxNullBitmap)
-+ self.iconDC.SelectObject(wx.NullBitmap)
- temp = self.iconBitmap
- self.iconBitmap = self.iconBitmap2
- self.iconBitmap2 = temp
- self.icon.SetBitmap(self.iconBitmap)
-- self.icon.Refresh(FALSE)
-+ self.icon.Refresh(False)
- self.isStuck = False
-
-
-@@ -150,14 +150,14 @@ class PlayerIcon(wxPanel):
- self.srcDC, 0, 0)
- self.srcDC.SelectObject(self.stuckBitmap)
- self.iconDC.Blit(0, 0, self.iconBitmap.GetWidth(), self.iconBitmap.GetHeight(),
-- self.srcDC, 0, 0, wxCOPY, TRUE)
-+ self.srcDC, 0, 0, wx.COPY, True)
- self.iconDC.EndDrawing()
-- self.iconDC.SelectObject(wxNullBitmap)
-+ self.iconDC.SelectObject(wx.NullBitmap)
- temp = self.iconBitmap
- self.iconBitmap = self.iconBitmap2
- self.iconBitmap2 = temp
- self.icon.SetBitmap(self.iconBitmap)
-- self.icon.Refresh(FALSE)
-+ self.icon.Refresh(False)
- self.isStuck = True
-
-
-@@ -168,19 +168,19 @@ class PlayerIcon(wxPanel):
- self.iconDC.Blit(0, 0, self.iconBitmap.GetWidth(), self.iconBitmap.GetHeight(),
- self.srcDC, 0, 0)
- self.iconDC.EndDrawing()
-- self.iconDC.SelectObject(wxNullBitmap)
-+ self.iconDC.SelectObject(wx.NullBitmap)
- temp = self.iconBitmap
- self.iconBitmap = self.iconBitmap2
- self.iconBitmap2 = temp
- self.icon.SetBitmap(self.iconBitmap)
-- self.icon.Refresh(FALSE)
-+ self.icon.Refresh(False)
-
-
-
- # Manage a group of icons to represent all six players.
--class PlayerIconGroup(wxPanel):
-+class PlayerIconGroup(wx.Panel):
- def __init__(self, parent, nameList, tokenList):
-- wxPanel.__init__(self, parent, -1)
-+ wx.Panel.__init__(self, parent, -1)
-
- # Get icons for all the players
- if len(nameList) != 6:
-@@ -200,9 +200,9 @@ class PlayerIconGroup(wxPanel):
- nameList[i], tokenList[i]))
-
-
-- self.topSizer = wxBoxSizer(wxHORIZONTAL)
-+ self.topSizer = wx.BoxSizer(wx.HORIZONTAL)
- for p in self.players:
-- self.topSizer.Add(p, 0, wxALIGN_CENTRE)
-+ self.topSizer.Add(p, 0, wx.ALIGN_CENTRE)
- self.SetSizer(self.topSizer)
- self.topSizer.SetSizeHints(self)
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/RegistrationWindow.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/RegistrationWindow.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/RegistrationWindow.py
-@@ -24,7 +24,7 @@
-
-
- from twisted.python import log
--from wxPython.wx import *
-+import wx
- from londonlaw.common.protocol import *
- from londonlaw.common.config import *
- from AutoListCtrl import *
-@@ -34,35 +34,35 @@ import os.path
-
-
- # Create a small dialog for choosing a team.
--class TeamDialog(wxDialog):
-+class TeamDialog(wx.Dialog):
- def __init__(self, parent):
-- wxDialog.__init__(self, parent, -1, "Choose a Team", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxSUNKEN_BORDER)
-- panel = wxPanel(self, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
-+ wx.Dialog.__init__(self, parent, -1, "Choose a Team", wx.DefaultPosition, wx.DefaultSize, wx.DEFAULT_DIALOG_STYLE|wx.SUNKEN_BORDER)
-+ panel = wx.Panel(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL)
-
-- self.choice = wxRadioBox(panel, -1, "team: ", wxDefaultPosition, wxDefaultSize,
-- ["Detectives", "Mr. X"], 1, wxRA_SPECIFY_COLS)
-- self.submitButton = wxButton(panel, wxID_OK, "OK")
-- self.cancelButton = wxButton(panel, wxID_CANCEL, "Cancel")
--
-- buttonSizer = wxBoxSizer(wxHORIZONTAL)
-- buttonSizer.Add(self.cancelButton, 0, wxALIGN_CENTRE|wxALL, 5)
-- buttonSizer.Add(self.submitButton, 0, wxALIGN_CENTRE|wxALL, 5)
--
-- vSizer = wxBoxSizer(wxVERTICAL)
-- vSizer.Add(self.choice, 0, wxALIGN_CENTRE|wxALL, 5)
-- vSizer.Add((1, 1), 1, wxEXPAND)
-- vSizer.Add(buttonSizer, 0, wxALIGN_RIGHT|wxALL, 5)
-+ self.choice = wx.RadioBox(panel, -1, "team: ", wx.DefaultPosition, wx.DefaultSize,
-+ ["Detectives", "Mr. X"], 1, wx.RA_SPECIFY_COLS)
-+ self.submitButton = wx.Button(panel, wx.ID_OK, "OK")
-+ self.cancelButton = wx.Button(panel, wx.ID_CANCEL, "Cancel")
-+
-+ buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ buttonSizer.Add(self.cancelButton, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-+ buttonSizer.Add(self.submitButton, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-+
-+ vSizer = wx.BoxSizer(wx.VERTICAL)
-+ vSizer.Add(self.choice, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-+ vSizer.Add((1, 1), 1, wx.EXPAND)
-+ vSizer.Add(buttonSizer, 0, wx.ALIGN_RIGHT|wx.ALL, 5)
-
- panel.SetSizer(vSizer)
- vSizer.Fit(panel)
-- sizer = wxBoxSizer(wxVERTICAL)
-- sizer.Add(panel, 1, wxEXPAND | wxALL, 5)
-+ sizer = wx.BoxSizer(wx.VERTICAL)
-+ sizer.Add(panel, 1, wx.EXPAND | wx.ALL, 5)
- self.SetSizer(sizer)
- sizer.Fit(self)
- self.SetAutoLayout(1)
-
-- EVT_BUTTON(self, wxID_OK, self.submit)
-- EVT_BUTTON(self, wxID_CANCEL, self.cancel)
-+ wx.EVT_BUTTON(self, wx.ID_OK, self.submit)
-+ wx.EVT_BUTTON(self, wx.ID_CANCEL, self.cancel)
-
-
- def submit(self, event):
-@@ -76,9 +76,9 @@ class TeamDialog(wxDialog):
-
-
- # Generate the main registration window.
--class RegistrationWindow(wxFrame):
-+class RegistrationWindow(wx.Frame):
- def __init__(self, parent, ID, title, messenger):
-- wxFrame.__init__(self, parent, ID, title)
-+ wx.Frame.__init__(self, parent, ID, title)
-
- self._messenger = messenger
-
-@@ -86,17 +86,17 @@ class RegistrationWindow(wxFrame):
- EXIT = 101
-
- # Create a menu bar
-- fileMenu = wxMenu("File")
-+ fileMenu = wx.Menu("File")
- fileMenu.Append(DISCONNECT, "Disconnect", "Disconnect from server")
- fileMenu.Append(EXIT, "Exit\tCTRL+Q", "Exit London Law")
-- menuBar = wxMenuBar()
-+ menuBar = wx.MenuBar()
- menuBar.Append(fileMenu, "File")
- self.SetMenuBar(menuBar)
-
- self.status = self.CreateStatusBar()
-
- # stick everything in a panel
-- mainPanel = wxPanel(self, -1)
-+ mainPanel = wx.Panel(self, -1)
-
- self.list = AutoListCtrl(mainPanel, -1,
- ("Player", "Team", "Votes to Start?", "Pawns"),
-@@ -104,31 +104,31 @@ class RegistrationWindow(wxFrame):
-
- self.list.SetColumnWidth(1, 140)
-
-- mainSizer = wxBoxSizer(wxVERTICAL)
-- mainSizer.Add(self.list, 3, wxALIGN_CENTRE|wxEXPAND|wxALL, 5)
-+ mainSizer = wx.BoxSizer(wx.VERTICAL)
-+ mainSizer.Add(self.list, 3, wx.ALIGN_CENTRE|wx.EXPAND|wx.ALL, 5)
-
- self.chatWindow = ChatPanel(mainPanel, "", False)
-- mainSizer.Add(self.chatWindow, 2, wxEXPAND|wxALL, 5)
-+ mainSizer.Add(self.chatWindow, 2, wx.EXPAND|wx.ALL, 5)
-
-- self.leaveButton = wxButton(mainPanel, -1, "Leave Game")
-- self.teamButton = wxButton(mainPanel, -1, "Choose Team")
-- self.voteButton = wxButton(mainPanel, -1, "Vote to Start")
-- buttonSizer = wxBoxSizer(wxHORIZONTAL)
-- buttonSizer.Add(self.leaveButton, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT | wxBOTTOM | wxALL, 5)
-- buttonSizer.Add((1, 1), 1, wxEXPAND)
-- buttonSizer.Add(self.teamButton, 0, wxALIGN_CENTRE | wxRIGHT | wxBOTTOM | wxALL, 5)
-- buttonSizer.Add(self.voteButton, 0, wxALIGN_CENTRE | wxRIGHT | wxBOTTOM | wxALL, 5)
-- mainSizer.Add(buttonSizer, 0, wxEXPAND, 0)
-+ self.leaveButton = wx.Button(mainPanel, -1, "Leave Game")
-+ self.teamButton = wx.Button(mainPanel, -1, "Choose Team")
-+ self.voteButton = wx.Button(mainPanel, -1, "Vote to Start")
-+ buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
-+ buttonSizer.Add(self.leaveButton, 0, wx.ALIGN_CENTRE | wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.ALL, 5)
-+ buttonSizer.Add((1, 1), 1, wx.EXPAND)
-+ buttonSizer.Add(self.teamButton, 0, wx.ALIGN_CENTRE | wx.RIGHT | wx.BOTTOM | wx.ALL, 5)
-+ buttonSizer.Add(self.voteButton, 0, wx.ALIGN_CENTRE | wx.RIGHT | wx.BOTTOM | wx.ALL, 5)
-+ mainSizer.Add(buttonSizer, 0, wx.EXPAND, 0)
-
- mainPanel.SetSizer(mainSizer)
- mainSizer.Fit(mainPanel)
-
-- EVT_MENU(self, EXIT, self.menuExit)
-- EVT_MENU(self, DISCONNECT, self.menuDisconnect)
-- EVT_BUTTON(self, self.leaveButton.GetId(), self.leaveGame)
-- EVT_BUTTON(self, self.teamButton.GetId(), self.chooseTeam)
-- EVT_BUTTON(self, self.voteButton.GetId(), self.voteStart)
-- EVT_TEXT_ENTER(self, self.chatWindow.chatEntry.GetId(), self.chatSend)
-+ wx.EVT_MENU(self, EXIT, self.menuExit)
-+ wx.EVT_MENU(self, DISCONNECT, self.menuDisconnect)
-+ wx.EVT_BUTTON(self, self.leaveButton.GetId(), self.leaveGame)
-+ wx.EVT_BUTTON(self, self.teamButton.GetId(), self.chooseTeam)
-+ wx.EVT_BUTTON(self, self.voteButton.GetId(), self.voteStart)
-+ wx.EVT_TEXT_ENTER(self, self.chatWindow.chatEntry.GetId(), self.chatSend)
-
-
- def addPlayer(self, data):
-@@ -154,7 +154,7 @@ class RegistrationWindow(wxFrame):
-
-
- def enableSelectButton(self, event):
-- self.selectButton.Enable(TRUE)
-+ self.selectButton.Enable(True)
-
-
- def disableSelectButton(self, event):
-@@ -180,8 +180,8 @@ class RegistrationWindow(wxFrame):
-
- def showInfoAlert(self, info):
- self.PushStatusText("")
-- alert = wxMessageDialog(self, info,
-- "Server Message", wxOK|wxICON_INFORMATION)
-+ alert = wx.MessageDialog(self, info,
-+ "Server Message", wx.OK|wx.ICON_INFORMATION)
- alert.ShowModal()
-
-
-@@ -190,17 +190,17 @@ class RegistrationWindow(wxFrame):
-
-
- def menuExit(self, event):
-- alert = wxMessageDialog(self, "Disconnect from the server and exit London Law?",
-- "Disconnect and Quit", wxYES_NO|wxICON_EXCLAMATION)
-- if alert.ShowModal() == wxID_YES:
-+ alert = wx.MessageDialog(self, "Disconnect from the server and exit London Law?",
-+ "Disconnect and Quit", wx.YES_NO|wx.ICON_EXCLAMATION)
-+ if alert.ShowModal() == wx.ID_YES:
- self._messenger.netDisconnect()
- self.Close()
-
-
- def menuDisconnect(self, event):
-- alert = wxMessageDialog(self, "Disconnect from the server?",
-- "Disconnect", wxYES_NO|wxICON_EXCLAMATION)
-- if alert.ShowModal() == wxID_YES:
-+ alert = wx.MessageDialog(self, "Disconnect from the server?",
-+ "Disconnect", wx.YES_NO|wx.ICON_EXCLAMATION)
-+ if alert.ShowModal() == wx.ID_YES:
- self._messenger.netDisconnect()
- self._messenger.guiLaunchConnectionWindow()
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/ScrolledLabel.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/ScrolledLabel.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/ScrolledLabel.py
-@@ -19,26 +19,26 @@
-
- # ScrolledLabel.py
- #
--# This class handles a wxStaticText that is managed by a scrolled window.
-+# This class handles a wx.StaticText that is managed by a scrolled window.
-
-
--from wxPython.wx import *
-+import wx
-
--class ScrolledLabel(wxScrolledWindow):
-+class ScrolledLabel(wx.ScrolledWindow):
- def __init__(self, parent, label):
-- wxScrolledWindow.__init__(self, parent, -1, wxDefaultPosition, wxDefaultSize,
-- wxVSCROLL | wxSIMPLE_BORDER)
-- self.SetBackgroundColour(wxColour(200, 200, 200))
-+ wx.ScrolledWindow.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize,
-+ wx.VSCROLL | wx.SIMPLE_BORDER)
-+ self.SetBackgroundColour(wx.Colour(200, 200, 200))
- self.SetScrollRate(0, 5)
-
- # create the text that will be scrolled
-- self.text = wxStaticText(self, -1, label, wxPoint(0,0))
-+ self.text = wx.StaticText(self, -1, label, wx.Point(0,0))
-
- # use a Sizer to handle geometry
-- self.topSizer = wxBoxSizer(wxVERTICAL)
-- self.topSizer.Add(self.text, 1, wxEXPAND)
-+ self.topSizer = wx.BoxSizer(wx.VERTICAL)
-+ self.topSizer.Add(self.text, 1, wx.EXPAND)
- self.SetSizer(self.topSizer)
-- self.topSizer.SetVirtualSizeHints(self)
-+ self.topSizer.FitInside(self)
-
- self.ScrollToEnd()
-
-@@ -62,7 +62,7 @@ class ScrolledLabel(wxScrolledWindow):
-
- # scroll to the bottom of the text
- def ScrollToEnd(self):
-- self.topSizer.SetVirtualSizeHints(self)
-+ self.topSizer.FitInside(self)
- self.Scroll(0, self.GetVirtualSize()[1]/5)
-
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/TextPanel.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/TextPanel.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/TextPanel.py
-@@ -19,25 +19,25 @@
-
- # TextPanel.py
- #
--# This class handles a wxStaticText drawn on a wxPanel. The combination
-+# This class handles a wx.StaticText drawn on a wx.Panel. The combination
- # allows one to set both foreground and background colors, as well as
- # borders around the window.
-
--from wxPython.wx import *
-+import wx
-
--# Generate a text label drawn on a wxPanel.
--class TextPanel(wxPanel):
-+# Generate a text label drawn on a wx.Panel.
-+class TextPanel(wx.Panel):
- def __init__(self, parent, text, points = 10, style = 0):
-- wxPanel.__init__(self, parent, -1, wxDefaultPosition, wxDefaultSize, style)
-+ wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize, style)
-
-- font = wxFont(points, wxDEFAULT, wxNORMAL, wxNORMAL)
-- self.text = wxStaticText(self, -1, text, wxPoint(0,0))
-+ font = wx.Font(points, wx.DEFAULT, wx.NORMAL, wx.NORMAL)
-+ self.text = wx.StaticText(self, -1, text, wx.Point(0,0))
- self.text.SetFont(font)
-
-- self.sizer = wxBoxSizer(wxVERTICAL)
-- self.sizer.Add((0, 0), 1, wxEXPAND)
-- self.sizer.Add(self.text, 0, wxALIGN_CENTRE|wxADJUST_MINSIZE)
-- self.sizer.Add((0, 0), 1, wxEXPAND)
-+ self.sizer = wx.BoxSizer(wx.VERTICAL)
-+ self.sizer.Add((0, 0), 1, wx.EXPAND)
-+ self.sizer.Add(self.text, 0, wx.ALIGN_CENTRE|wx.ADJUST_MINSIZE)
-+ self.sizer.Add((0, 0), 1, wx.EXPAND)
- self.SetSizer(self.sizer)
- self.sizer.SetSizeHints(self)
-
-@@ -48,13 +48,13 @@ class TextPanel(wxPanel):
-
- def SetForegroundColour(self, color):
- self.text.SetForegroundColour(color)
-- wxPanel.SetForegroundColour(self, color)
-+ wx.Panel.SetForegroundColour(self, color)
-
- # def SetBackgroundColour(self, color)
-- # (this function falls through to call SetBackgroundColour on the wxPanel)
-+ # (this function falls through to call SetBackgroundColour on the wx.Panel)
- def SetBackgroundColour(self, color):
- self.text.SetBackgroundColour(color)
-- wxPanel.SetBackgroundColour(self, color)
-+ wx.Panel.SetBackgroundColour(self, color)
-
-
-
-Index: londonlaw-0.2.1/londonlaw/guiclient/graphicalmap.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/graphicalmap.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/graphicalmap.py
-@@ -16,7 +16,7 @@
-
-
-
--from wxPython.wx import *
-+import wx
- from utility import *
- from SetHash import *
- from londonlaw.common.config import *
-@@ -241,9 +241,9 @@ def locToPixel(loc, zoom):
- GRIDSIZE = (100, 100)
- MASKSIZE = (39, 42) # size of a rect that contains a map number graphic
- gridHash = SetHash()
--wxInitAllImageHandlers()
-+# no-op in wxPython2.8 and later: wx.InitAllImageHandlers()
- maskImageFile = os.path.join(MEDIAROOT, "images/map-number-mask.png")
--maskImage = wxImage(maskImageFile, wxBITMAP_TYPE_ANY)
-+maskImage = wx.Image(maskImageFile, wx.BITMAP_TYPE_ANY)
-
-
- # Create a hash table that assists in mapping pixel locations to map numbers.
-Index: londonlaw-0.2.1/londonlaw/guiclient/Protocol.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/Protocol.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/Protocol.py
-@@ -21,7 +21,7 @@ from twisted.python import log
- import shlex, sys
- from londonlaw.common import util
- from londonlaw.common.protocol import *
--from wxPython.wx import *
-+import wx
-
-
- class ProtocolError(Exception):
-Index: londonlaw-0.2.1/londonlaw/guiclient/StaticBitmap.py
-===================================================================
---- londonlaw-0.2.1.orig/londonlaw/guiclient/StaticBitmap.py
-+++ londonlaw-0.2.1/londonlaw/guiclient/StaticBitmap.py
-@@ -20,27 +20,27 @@
- # StaticBitmap.py
- #
- # This class is an attempt at a more robust cross-platform version of a
--# wxStaticBitmap.
-+# wx.StaticBitmap.
-
--from wxPython.wx import *
-+import wx
-
--class StaticBitmap(wxWindow):
-- def __init__(self, parent, id, bitmap, position = wxDefaultPosition, size = wxDefaultSize):
-- wxWindow.__init__(self, parent, id, position, size)
-+class StaticBitmap(wx.Window):
-+ def __init__(self, parent, id, bitmap, position = wx.DefaultPosition, size = wx.DefaultSize):
-+ wx.Window.__init__(self, parent, id, position, size)
- self.bitmap = bitmap
-- self.SetSize(wxSize(self.bitmap.GetWidth(), self.bitmap.GetHeight()))
-+ self.SetSize(wx.Size(self.bitmap.GetWidth(), self.bitmap.GetHeight()))
-
-- EVT_PAINT(self, self.OnPaint)
-+ wx.EVT_PAINT(self, self.OnPaint)
-
-
- def OnPaint(self, event):
-- self.srcDC = wxMemoryDC()
-+ self.srcDC = wx.MemoryDC()
- self.srcDC.SelectObject(self.bitmap)
-- destDC = wxPaintDC(self)
-+ destDC = wx.PaintDC(self)
- destDC.BeginDrawing()
- destDC.Blit(0, 0, self.bitmap.GetWidth(), self.bitmap.GetHeight(), self.srcDC, 0, 0)
- destDC.EndDrawing()
-- self.srcDC.SelectObject(wxNullBitmap)
-+ self.srcDC.SelectObject(wx.NullBitmap)
-
-
- def GetBitmap(self):
-@@ -53,11 +53,11 @@ class StaticBitmap(wxWindow):
-
- def DoGetBestSize(self):
- print "called DoGetBestSize()"
-- return wxSize(self.bitmap.GetWidth(), self.bitmap.GetHeight())
-+ return wx.Size(self.bitmap.GetWidth(), self.bitmap.GetHeight())
-
- # def GetBestSize(self):
- # print "called GetBestSize()"
--# return wxSize(self.bitmap.GetWidth(), self.bitmap.GetHeight())
-+# return wx.Size(self.bitmap.GetWidth(), self.bitmap.GetHeight())
-
-
- # arch-tag: DO_NOT_CHANGE_a21ebe5e-e749-45fb-81fb-fa430d46cf0e
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/londonlaw.git/commit/?h=master&id=b9e4a248506ec312b3d6b46005335c31d6b4eeb0
More information about the scm-commits
mailing list