Index: src/mlx/acars.py
===================================================================
--- src/mlx/acars.py	(revision 919)
+++ src/mlx/acars.py	(revision 743)
@@ -1,4 +1,4 @@
 
-from . import const
+import const
 
 #------------------------------------------------------------------------------
Index: src/mlx/acft.py
===================================================================
--- src/mlx/acft.py	(revision 919)
+++ src/mlx/acft.py	(revision 905)
@@ -1,9 +1,9 @@
 
-from . import const
-from . import gates
-from . import checks
-from . import fs
-from .i18n import xstr
-from . import util
+import const
+import gates
+import checks
+import fs
+from i18n import xstr
+import util
 
 import sys
@@ -308,5 +308,5 @@
               ("-" if value is None else "enabled" if value else "disabled",)
         elif dt!=DERATE_NONE:
-            print("mlx.acft.getDerateLine: invalid derate type: " + dt)
+            print "mlx.acft.getDerateLine: invalid derate type: " + dt
 
         return None
@@ -343,5 +343,5 @@
                                   self._aircraftState, aircraftState)
                 except:
-                    print("Checker", checker, "failed", file=sys.stderr)
+                    print >> sys.stderr, "Checker", checker, "failed"
                     traceback.print_exc()
 
@@ -351,5 +351,5 @@
             self._minVS = min(self._minVS, aircraftState.vs)
         except:
-            print("Failed to handle the state", file=sys.stderr)
+            print >> sys.stderr, "Failed to handle the state"
             traceback.print_exc()
         finally:
@@ -403,5 +403,5 @@
                     self._logQNH(aircraftState)
             elif newStage==const.STAGE_GOAROUND:
-                from .logger import Logger
+                from logger import Logger
                 self._flight.handleFault("goaround",
                                          aircraftState.timestamp,
@@ -1284,47 +1284,47 @@
     value = SmoothedValue()
 
-    print("Adding 1, 12.0")
+    print "Adding 1, 12.0"
     value.add(1, 12.0)
-    print(value.get())
-
-    print("Adding 1, 15.0")
+    print value.get()
+
+    print "Adding 1, 15.0"
     value.add(1, 15.0)
-    print(value.get())
-
-    print("Adding 2, 18.0")
+    print value.get()
+
+    print "Adding 2, 18.0"
     value.add(2, 18.0)
-    print(value.get())
-
-    print("Adding 2, 20.0")
+    print value.get()
+
+    print "Adding 2, 20.0"
     value.add(2, 20.0)
-    print(value.get())
-
-    print("Adding 5, 22.0")
+    print value.get()
+
+    print "Adding 5, 22.0"
     value.add(5, 22.0)
-    print(value.get())
-
-    print("Adding 5, 25.0")
+    print value.get()
+
+    print "Adding 5, 25.0"
     value.add(5, 25.0)
-    print(value.get())
-
-    print("Adding 5, 29.0")
+    print value.get()
+
+    print "Adding 5, 29.0"
     value.add(5, 29.0)
-    print(value.get())
-
-    print("Adding 5, 21.0")
+    print value.get()
+
+    print "Adding 5, 21.0"
     value.add(5, 21.0)
-    print(value.get())
-
-    print("Adding 5, 26.0")
+    print value.get()
+
+    print "Adding 5, 26.0"
     value.add(5, 26.0)
-    print(value.get())
-
-    print("Adding 2, 30.0")
+    print value.get()
+
+    print "Adding 2, 30.0"
     value.add(2, 30.0)
-    print(value.get())
-
-    print("Adding 2, 55.0")
+    print value.get()
+
+    print "Adding 2, 55.0"
     value.add(2, 55.0)
-    print(value.get())
-
-#---------------------------------------------------------------------------------------
+    print value.get()
+
+#---------------------------------------------------------------------------------------
Index: src/mlx/airports.py
===================================================================
--- src/mlx/airports.py	(revision 919)
+++ src/mlx/airports.py	(revision 325)
@@ -88,11 +88,11 @@
 
 if __name__ == "__main__":
-    for (town, airport) in airportNames.values():
-        print(town, airport)
-    print(getWelcomeMessage("LIRF"))
-    print(getWelcomeMessage("LHDC"))
-    print(getWelcomeMessage("LIRN"))
-    print(getWelcomeMessage("LHBP"))
-    print(getWelcomeMessage("EDDF"))
+    for (town, airport) in airportNames.itervalues():
+        print town, airport
+    print getWelcomeMessage("LIRF")
+    print getWelcomeMessage("LHDC")
+    print getWelcomeMessage("LIRN")
+    print getWelcomeMessage("LHBP")
+    print getWelcomeMessage("EDDF")
 
 #-----------------------------------------------------------------------------
Index: src/mlx/checks.py
===================================================================
--- src/mlx/checks.py	(revision 919)
+++ src/mlx/checks.py	(revision 912)
@@ -1,8 +1,8 @@
 
-from . import fs
-from . import const
-from . import util
-from .acars import ACARS
-from .sound import startSound
+import fs
+import const
+import util
+from acars import ACARS
+from sound import startSound
 
 import time
@@ -129,9 +129,9 @@
         """Callback for ACARS sending."""
         if returned:
-            print("Sent online ACARS")
+            print "Sent online ACARS"
             self._lastSent = time.time() if self._lastSent is None \
                              else self._lastSent + ACARSSender.INTERVAL
         else:
-            print("Failed to send the ACARS")
+            print "Failed to send the ACARS"
         self._sending = False
 
@@ -517,6 +517,6 @@
     def getMessage(logName, frequency, obs):
         """Get the message for the given NAV radio setting."""
-        message = "%-5s %s" % (logName + ":", frequency)
-        if obs is not None: message += " (%03d\u00b0)" % (obs,)
+        message = u"%-5s %s" % (logName + ":", frequency)
+        if obs is not None: message += u" (%03d\u00b0)" % (obs,)
         return message
 
@@ -747,7 +747,7 @@
         message = what
         if value is None:
-            message += " cannot be detected, will not log"
+            message += u" cannot be detected, will not log"
         else:
-            message += ": " + format % (value,)
+            message += u": " + format % (value,)
         logger.message(timestamp, message)
 
@@ -767,6 +767,6 @@
     def _logAPHeading(logger, timestamp, state):
         """Log the AP heading."""
-        APLogger._logNumeric(logger, timestamp, "AP heading",
-                             "%03.0f\u00b0", state.apHeading)
+        APLogger._logNumeric(logger, timestamp, u"AP heading",
+                             u"%03.0f\u00b0", state.apHeading)
 
     @staticmethod
@@ -779,6 +779,6 @@
     def _logAPAltitude(logger, timestamp, state):
         """Log the AP heading."""
-        APLogger._logNumeric(logger, timestamp, "AP altitude",
-                             "%.0f ft", state.apAltitude)
+        APLogger._logNumeric(logger, timestamp, u"AP altitude",
+                             u"%.0f ft", state.apAltitude)
 
     def __init__(self):
Index: src/mlx/common.py
===================================================================
--- src/mlx/common.py	(revision 942)
+++ src/mlx/common.py	(revision 800)
@@ -22,10 +22,11 @@
 #-------------------------------------------------------------------------------
 
-if "FORCE_PYGTK" in os.environ:
-    print("Using PyGTK")
+# Due to CEF, PyGTK is the default
+if "FORCE_PYGOBJECT" not in os.environ:
+    print "Using PyGTK"
     pygobject = False
     import gobject
 else:
-    print("Using PyGObject")
+    print "Using PyGObject"
     pygobject = True
 
Index: src/mlx/config.py
===================================================================
--- src/mlx/config.py	(revision 919)
+++ src/mlx/config.py	(revision 738)
@@ -1,11 +1,11 @@
 # -*- encoding: utf-8 -*-
 
-from . import const
-from .util import secondaryInstallation, utf2unicode
+import const
+from util import secondaryInstallation, utf2unicode
 
 import os
 import sys
 import traceback
-import configparser
+import ConfigParser
 
 ## @package mlx.config
@@ -163,5 +163,5 @@
         baseName = "callouts." + const.icaoCodes[aircraftType] + "."
         index = 0
-        for (altitude, path) in self._mapping.items():
+        for (altitude, path) in self._mapping.iteritems():
             option = baseName + str(index)
             config.set(ApproachCallouts.SECTION, option,
@@ -171,9 +171,9 @@
     def getAltitudes(self, descending = True):
         """Get the altitudes in decreasing order by default."""
-        altitudes = list(self._mapping.keys())
+        altitudes = self._mapping.keys()
         altitudes.sort(reverse = descending)
         return altitudes
 
-    def __bool__(self):
+    def __nonzero__(self):
         """Return if there is anything in the mapping."""
         return not not self._mapping
@@ -704,5 +704,5 @@
         """Load the configuration from its default location."""
         try:
-            config = configparser.RawConfigParser()
+            config = ConfigParser.RawConfigParser()
             config.read(configPath)
         except:
@@ -806,5 +806,5 @@
             return
 
-        config = configparser.RawConfigParser()
+        config = ConfigParser.RawConfigParser()
 
         config.add_section("login")
@@ -892,15 +892,15 @@
         try:
             fd = os.open(configPath, os.O_CREAT|os.O_TRUNC|os.O_WRONLY,
-                         0o600)
+                         0600)
             with os.fdopen(fd, "wt") as f:
                 config.write(f)
             self._modified = False
 
-            print("Configuration saved:")
+            print "Configuration saved:"
             self.log()
 
-        except Exception as e:
-            print("Failed to update config: " + \
-                                 utf2unicode(str(e)), file=sys.stderr)
+        except Exception, e:
+            print >> sys.stderr, "Failed to update config: " + \
+                                 utf2unicode(str(e))
 
     def _getBoolean(self, config, section, option, default):
@@ -945,5 +945,5 @@
         import locale
         if self._language:
-            print("Setting up locale for", self._language)
+            print "Setting up locale for", self._language
             os.environ["LANGUAGE"] = self._language
             langAndEncoding = self._language + "." + locale.getpreferredencoding()
@@ -978,62 +978,62 @@
     def log(self):
         """Log the configuration by printing the values"""
-        print("  pilot ID:", self._pilotID)
-        print("  rememberPassword:", self._rememberPassword)
-
-        print("  language:", self._language)
-
-        print("  hideMinimizedWindow:", self._hideMinimizedWindow)
-        print("  quitOnClose:", self._quitOnClose)
-
-        print("  onlineGateSystem:", self._onlineGateSystem)
-        print("  onlineACARS:", self._onlineACARS)
-
-        print("  flareTimeFromFS:", self._flareTimeFromFS)
-        print("  syncFSTime:", self._syncFSTime)
-        print("  usingFS2Crew:", self._usingFS2Crew)
-
-        print("  iasSmoothingLength:", self._iasSmoothingLength)
-        print("  vsSmoothingLength:", self._vsSmoothingLength)
-
-        print("  useSimBrief:", self._useSimBrief)
-        print("  simBriefUserName:", self._simBriefUserName)
-        print("  rememberSimBriefPassword:", self._rememberSimBriefPassword)
-
-        print("  pirepDirectory:", self._pirepDirectory)
-        print("  pirepAutoSave:", self._pirepAutoSave)
-
-        print("  defaultMSFS:", self._defaultMSFS)
-
-        print("  enableSounds:", self._enableSounds)
-
-        print("  pilotControlsSounds:", self._pilotControlsSounds)
-        print("  pilotHotkey:", str(self._pilotHotkey))
-
-        print("  enableApproachCallouts:", self._enableApproachCallouts)
-        print("  speedbrakeAtTD:", self._speedbrakeAtTD)
-
-        print("  enableChecklists:", self._enableChecklists)
-        print("  checklistHotkey:", str(self._checklistHotkey))
-
-        print("  autoUpdate:", self._autoUpdate)
-        print("  updateURL:", self._updateURL)
-        print("  useRPC:", self._useRPC)
-
-        print("  messageTypeLevels:")
-        for (type, level) in self._messageTypeLevels.items():
-            print("    %s: %s" % (const.messageType2string(type),
-                                  const.messageLevel2string(level)))
-
-        print("  checklists:")
-        for (type, checklist) in self._checklists.items():
-            print("    %s:" % (const.icaoCodes[type],))
+        print "  pilot ID:", self._pilotID
+        print "  rememberPassword:", self._rememberPassword
+
+        print "  language:", self._language
+
+        print "  hideMinimizedWindow:", self._hideMinimizedWindow
+        print "  quitOnClose:", self._quitOnClose
+
+        print "  onlineGateSystem:", self._onlineGateSystem
+        print "  onlineACARS:", self._onlineACARS
+
+        print "  flareTimeFromFS:", self._flareTimeFromFS
+        print "  syncFSTime:", self._syncFSTime
+        print "  usingFS2Crew:", self._usingFS2Crew
+
+        print "  iasSmoothingLength:", self._iasSmoothingLength
+        print "  vsSmoothingLength:", self._vsSmoothingLength
+
+        print "  useSimBrief:", self._useSimBrief
+        print "  simBriefUserName:", self._simBriefUserName
+        print "  rememberSimBriefPassword:", self._rememberSimBriefPassword
+
+        print "  pirepDirectory:", self._pirepDirectory
+        print "  pirepAutoSave:", self._pirepAutoSave
+
+        print "  defaultMSFS:", self._defaultMSFS
+
+        print "  enableSounds:", self._enableSounds
+
+        print "  pilotControlsSounds:", self._pilotControlsSounds
+        print "  pilotHotkey:", str(self._pilotHotkey)
+
+        print "  enableApproachCallouts:", self._enableApproachCallouts
+        print "  speedbrakeAtTD:", self._speedbrakeAtTD
+
+        print "  enableChecklists:", self._enableChecklists
+        print "  checklistHotkey:", str(self._checklistHotkey)
+
+        print "  autoUpdate:", self._autoUpdate
+        print "  updateURL:", self._updateURL
+        print "  useRPC:", self._useRPC
+
+        print "  messageTypeLevels:"
+        for (type, level) in self._messageTypeLevels.iteritems():
+            print "    %s: %s" % (const.messageType2string(type),
+                                  const.messageLevel2string(level))
+
+        print "  checklists:"
+        for (type, checklist) in self._checklists.iteritems():
+            print "    %s:" % (const.icaoCodes[type],)
             for path in checklist:
-                print("      " + path)
-
-        print("  approachCallouts:")
-        for (type, approachCallouts) in self._approachCallouts.items():
-            print("    %s:" % (const.icaoCodes[type],))
+                print "      " + path
+
+        print "  approachCallouts:"
+        for (type, approachCallouts) in self._approachCallouts.iteritems():
+            print "    %s:" % (const.icaoCodes[type],)
             for (altitude, path) in approachCallouts:
-                print("      %d: %s" % (altitude, path))
+                print "      %d: %s" % (altitude, path)
 
 #-------------------------------------------------------------------------------
Index: src/mlx/const.py
===================================================================
--- src/mlx/const.py	(revision 941)
+++ src/mlx/const.py	(revision 911)
@@ -12,5 +12,5 @@
 
 ## The version of the program
-VERSION="0.39.6-py3"
+VERSION="0.39.6"
 
 #-------------------------------------------------------------------------------
@@ -193,5 +193,5 @@
 def aircraftType2Family(aircraftType):
     """Get the family for the given aircraft type."""
-    for (family, types) in aircraftFamily2Types.items():
+    for (family, types) in aircraftFamily2Types.iteritems():
         if aircraftType in types:
             return family
@@ -424,5 +424,5 @@
 def string2messageLevel(str):
     """Get the message level for the given string."""
-    for (value, s) in _messageLevelStrings.items():
+    for (value, s) in _messageLevelStrings.iteritems():
         if str==s:
             return value
Index: src/mlx/flight.py
===================================================================
--- src/mlx/flight.py	(revision 919)
+++ src/mlx/flight.py	(revision 846)
@@ -1,8 +1,8 @@
 
-from .soundsched import SoundScheduler, ChecklistScheduler
-from .checks import SpeedChecker
-
-from . import const
-from . import util
+from soundsched import SoundScheduler, ChecklistScheduler
+from checks import SpeedChecker
+
+import const
+import util
 import time
 
Index: src/mlx/fs.py
===================================================================
--- src/mlx/fs.py	(revision 919)
+++ src/mlx/fs.py	(revision 909)
@@ -1,10 +1,10 @@
 
-from . import const
-from .sound import startSound
+import const
+from sound import startSound
 
 import os
 
-from . import fsuipc
-from . import xplane
+import fsuipc
+import xplane
 
 import threading
@@ -36,13 +36,13 @@
         """Called when a connection has been established to the flight
         simulator of the given type."""
-        print("fs.ConnectionListener.connected, fsType:", fsType, ", descriptor:", descriptor)
+        print "fs.ConnectionListener.connected, fsType:", fsType, ", descriptor:", descriptor
 
     def connectionFailed(self):
         """Called when the connection could not be established."""
-        print("fs.ConnectionListener.connectionFailed")
+        print "fs.ConnectionListener.connectionFailed"
 
     def disconnected(self):
         """Called when a connection to the flight simulator has been broken."""
-        print("fs.ConnectionListener.disconnected")
+        print "fs.ConnectionListener.disconnected"
 
 #-------------------------------------------------------------------------------
Index: src/mlx/fsuipc.py
===================================================================
--- src/mlx/fsuipc.py	(revision 922)
+++ src/mlx/fsuipc.py	(revision 877)
@@ -1,8 +1,8 @@
 
-from . import fs
-from . import const
-from . import util
-from . import acft
-from .watchdog import Watchdog
+import fs
+import const
+import util
+import acft
+from watchdog import Watchdog
 
 import threading
@@ -13,10 +13,9 @@
 import codecs
 import math
-from functools import total_ordering
 
 if os.name == "nt" and "FORCE_PYUIPC_SIM" not in os.environ:
     import pyuipc
 else:
-    from . import pyuipc_sim as pyuipc
+    import pyuipc_sim as pyuipc
 
 #------------------------------------------------------------------------------
@@ -105,6 +104,6 @@
         try:
             return fun()
-        except Exception as e:
-            print(util.utf2unicode(str(e)), file=sys.stderr)
+        except Exception, e:
+            print >> sys.stderr, util.utf2unicode(str(e))
             return None
 
@@ -134,5 +133,5 @@
             try:
                 values = pyuipc.read(data)
-            except TypeError as e:
+            except TypeError, e:
                 exception = e
 
@@ -175,5 +174,5 @@
                 try:
                     pyuipc.write(self._data)
-                except TypeError as e:
+                except TypeError, e:
                     exception = e
 
@@ -198,5 +197,4 @@
                 Handler._callSafe(lambda: self._callback(None, self._extra))
 
-    @total_ordering
     class PeriodicRequest(object):
         """A periodic request."""
@@ -252,15 +250,8 @@
             pass
 
-        def __eq__(self, other):
-            """Equality comparison by the firing times"""
-            return self._nextFire == other._nextFire
-
-        def __ne__(self, other):
-            """Non-equality comparison by the firing times"""
-            return self._nextFire != other._nextFire
-
-        def __lt__(self, other):
-            """Less-than comparison by the firing times"""
-            return self._nextFire < other._nextFire
+        def __cmp__(self, other):
+            """Compare two periodic requests. They are ordered by their next
+            firing times."""
+            return cmp(self._nextFire, other._nextFire)
 
     def __init__(self, connectionListener,
@@ -429,8 +420,8 @@
                 self._connected = True
                 return attempts
-            except Exception as e:
-                print("fsuipc.Handler._connect: connection failed: " + \
+            except Exception, e:
+                print "fsuipc.Handler._connect: connection failed: " + \
                       util.utf2unicode(str(e)) + \
-                      " (attempts: %d)" % (attempts,))
+                      " (attempts: %d)" % (attempts,)
                 if attempts<self.NUM_CONNECTATTEMPTS:
                     time.sleep(self.CONNECT_INTERVAL)
@@ -463,5 +454,5 @@
     def _disconnect(self):
         """Disconnect from the flight simulator."""
-        print("fsuipc.Handler._disconnect")
+        print "fsuipc.Handler._disconnect"
         if self._connected:
             pyuipc.close()
@@ -488,16 +479,16 @@
             try:
                 if not request.process(time):
-                    print("fsuipc.Handler._processRequest: FSUIPC returned invalid data too many times, reconnecting")
+                    print "fsuipc.Handler._processRequest: FSUIPC returned invalid data too many times, reconnecting"
                     needReconnect = True
             except TypeError as e:
-                print("fsuipc.Handler._processRequest: type error: " + \
+                print "fsuipc.Handler._processRequest: type error: " + \
                       util.utf2unicode(str(e)) + \
                       ("." if request.unimportant else
-                       (", reconnecting (attempts=%d)." % (attempts,))))
+                       (", reconnecting (attempts=%d)." % (attempts,)))
                 needReconnect = not request.unimportant
             except Exception as e:
-                print("fsuipc.Handler._processRequest: FSUIPC connection failed (" + \
+                print "fsuipc.Handler._processRequest: FSUIPC connection failed (" + \
                       util.utf2unicode(str(e)) + \
-                      "), reconnecting (attempts=%d)." % (attempts,))
+                      "), reconnecting (attempts=%d)." % (attempts,)
                 needReconnect = True
 
@@ -732,5 +723,5 @@
         duration is the number of seconds to keep the message displayed."""
 
-        print("fsuipc.Simulator.sendMessage:", message)
+        print "fsuipc.Simulator.sendMessage:", message
 
         if self._scroll:
@@ -741,6 +732,6 @@
         try:
             message = str(message)
-        except Exception as e:
-            print("fsuipc.Simulator.sendMessage: failed to convert the message to a string:", e)
+        except Exception, e:
+            print "fsuipc.Simulator.sendMessage: failed to convert the message to a string:", e
 
         data = [(0x3380, -1 - len(message), message),
@@ -831,5 +822,5 @@
         assert not self._monitoringRequested
 
-        print("fsuipc.Simulator.disconnect", closingMessage, duration)
+        print "fsuipc.Simulator.disconnect", closingMessage, duration
 
         self._stopNormal()
@@ -962,6 +953,6 @@
             return False
 
-        print("fsuipc.Simulator: new aircraft name and air file path: %s, %s" % \
-              (name, airPath))
+        print "fsuipc.Simulator: new aircraft name and air file path: %s, %s" % \
+              (name, airPath)
 
         self._aircraftName = aircraftName
@@ -1097,11 +1088,10 @@
             self._handler.disconnect()
 
-    def _handleNumHotkeys(self, data, xxx_todo_changeme5):
+    def _handleNumHotkeys(self, data, (id, generation)):
         """Handle the result of the query of the number of hotkeys"""
-        (id, generation) = xxx_todo_changeme5
         with self._hotkeyLock:
             if id==self._hotkeySetID and generation==self._hotkeySetGeneration:
                 numHotkeys = data[0]
-                print("fsuipc.Simulator._handleNumHotkeys: numHotkeys:", numHotkeys)
+                print "fsuipc.Simulator._handleNumHotkeys: numHotkeys:", numHotkeys
                 data = [(0x3210 + i*4, "d") for i in range(0, numHotkeys)]
                 self._handler.requestRead(data, self._handleHotkeyTable,
@@ -1145,11 +1135,10 @@
 
         for offset in oldHotkeyOffsets:
-            writeData.append((offset, "u", int(0)))
+            writeData.append((offset, "u", long(0)))
 
         return writeData
 
-    def _handleHotkeyTable(self, data, xxx_todo_changeme6):
+    def _handleHotkeyTable(self, data, (id, generation)):
         """Handle the result of the query of the hotkey table."""
-        (id, generation) = xxx_todo_changeme6
         with self._hotkeyLock:
             if id==self._hotkeySetID and generation==self._hotkeySetGeneration:
@@ -1159,7 +1148,6 @@
                                            (id, generation))
 
-    def _handleHotkeysWritten(self, success, xxx_todo_changeme7):
+    def _handleHotkeysWritten(self, success, (id, generation)):
         """Handle the result of the hotkeys having been written."""
-        (id, generation) = xxx_todo_changeme7
         with self._hotkeyLock:
             if success and id==self._hotkeySetID and \
@@ -1172,7 +1160,6 @@
                                                       (id, generation))
 
-    def _handleHotkeys(self, data, xxx_todo_changeme8):
+    def _handleHotkeys(self, data, (id, generation)):
         """Handle the hotkeys."""
-        (id, generation) = xxx_todo_changeme8
         with self._hotkeyLock:
             if id!=self._hotkeySetID or generation!=self._hotkeySetGeneration:
@@ -1410,7 +1397,7 @@
 
         numNotchesM1 = len(self._flapsNotches) - 1
-        flapsIncrement = 16383 // numNotchesM1
+        flapsIncrement = 16383 / numNotchesM1
         flapsControl = data[self._monidx_flapsControl]
-        flapsIndex = flapsControl // flapsIncrement
+        flapsIndex = flapsControl / flapsIncrement
         if flapsIndex < numNotchesM1:
             if (flapsControl - (flapsIndex*flapsIncrement) >
@@ -1419,8 +1406,8 @@
         state.flapsSet = self._flapsNotches[flapsIndex]
         if state.flapsSet != self._flapsSet:
-            print("flapsControl: %d, flapsLeft: %d, flapsRight: %d, flapsAxis: %d, flapsIncrement: %d, flapsSet: %d, numNotchesM1: %d" % \
+            print "flapsControl: %d, flapsLeft: %d, flapsRight: %d, flapsAxis: %d, flapsIncrement: %d, flapsSet: %d, numNotchesM1: %d" % \
                   (flapsControl, data[self._monidx_flapsLeft],
                    data[self._monidx_flapsRight], data[self._monidx_flapsAxis],
-                   data[self._monidx_flapsIncrement], state.flapsSet, numNotchesM1))
+                   data[self._monidx_flapsIncrement], state.flapsSet, numNotchesM1)
             self._flapsSet = state.flapsSet
 
@@ -1601,5 +1588,5 @@
         for (tank, level) in levels:
             offset = _tank2offset[tank]
-            value = int(level * 128.0 * 65536.0)
+            value = long(level * 128.0 * 65536.0)
             data.append( (offset, "u", value) )
 
@@ -1711,8 +1698,7 @@
     """A model handler for the PMDG Boeing 737NG model."""
     @staticmethod
-    def doesHandle(aircraft, xxx_todo_changeme):
+    def doesHandle(aircraft, (name, airPath)):
         """Determine if this model handler handles the aircraft with the given
         name."""
-        (name, airPath) = xxx_todo_changeme
         return aircraft.type in [const.AIRCRAFT_B736,
                                  const.AIRCRAFT_B737,
@@ -1744,6 +1730,6 @@
 
         if fsType==const.SIM_MSFSX or fsType==const.SIM_P3D:
-            print("%s detected, adding PMDG 737 NGX-specific offsets" % \
-                  ("FSX" if fsType==const.SIM_MSFSX else "P3D",))
+            print "%s detected, adding PMDG 737 NGX-specific offsets" % \
+                  ("FSX" if fsType==const.SIM_MSFSX else "P3D",)
             self._addOffsetWithIndexMember(data, 0x6500, "b",
                                            "_pmdgidx_lts_positionsw")
@@ -1755,5 +1741,5 @@
             self._addOffsetWithIndexMember(data, 0x65cd, "b", "_pmdgidx_xpdr")
         else:
-            print("FS9 detected, adding PMDG 737 NG-specific offsets")
+            print "FS9 detected, adding PMDG 737 NG-specific offsets"
             self._addOffsetWithIndexMember(data, 0x6202, "b", "_pmdgidx_switches")
             self._addOffsetWithIndexMember(data, 0x6216, "b", "_pmdgidx_xpdr")
@@ -1800,5 +1786,5 @@
 
         if gearControl!=self._lastGearControl or noseGear!=self._lastNoseGear:
-            print("gearControl:", gearControl, " noseGear:", noseGear)
+            print "gearControl:", gearControl, " noseGear:", noseGear
             self._lastGearControl = gearControl
             self._lastNoseGear = noseGear
@@ -1847,8 +1833,7 @@
     """Model handler for the Dreamwings Dash 8-Q400."""
     @staticmethod
-    def doesHandle(aircraft, xxx_todo_changeme1):
+    def doesHandle(aircraft, (name, airPath)):
         """Determine if this model handler handles the aircraft with the given
         name."""
-        (name, airPath) = xxx_todo_changeme1
         return aircraft.type==const.AIRCRAFT_DH8D and \
             (name.find("Dreamwings")!=-1 or airPath.find("Dreamwings")!=-1) and \
@@ -1885,8 +1870,7 @@
     """Model handler for the Majestic Dash 8-Q400."""
     @staticmethod
-    def doesHandle(aircraft, xxx_todo_changeme2):
+    def doesHandle(aircraft, (name, airPath)):
         """Determine if this model handler handles the aircraft with the given
         name."""
-        (name, airPath) = xxx_todo_changeme2
         return aircraft.type==const.AIRCRAFT_DH8D and \
             (name.find("MJC8Q400")!=-1 or \
@@ -1964,8 +1948,7 @@
     """Model for the Digital Aviation F70 implementation on FS9."""
     @staticmethod
-    def doesHandle(aircraft, xxx_todo_changeme3):
+    def doesHandle(aircraft, (name, airPath)):
         """Determine if this model handler handles the aircraft with the given
         name."""
-        (name, airPath) = xxx_todo_changeme3
         return aircraft.type == const.AIRCRAFT_F70 and \
                (airPath.endswith("fokker70_2k4_v4.1.air") or
@@ -2154,9 +2137,8 @@
     """Project Tupolev Tu-154."""
     @staticmethod
-    def doesHandle(aircraft, xxx_todo_changeme4):
+    def doesHandle(aircraft, (name, airPath)):
         """Determine if this model handler handles the aircraft with the given
         name."""
-        (name, airPath) = xxx_todo_changeme4
-        print("PTT154Model.doesHandle", aircraft.type, name, airPath)
+        print "PTT154Model.doesHandle", aircraft.type, name, airPath
         return aircraft.type==const.AIRCRAFT_T154 and \
                (name.find("Tu-154")!=-1 or name.find("Tu154B")!=-1) and \
Index: src/mlx/gui/acars.py
===================================================================
--- src/mlx/gui/acars.py	(revision 919)
+++ src/mlx/gui/acars.py	(revision 747)
@@ -1,9 +1,9 @@
 
-from .common import *
+from common import *
 
 from mlx.i18n import xstr
 import mlx.const as const
 
-from . import cef
+import cef
 
 #------------------------------------------------------------------------------
Index: src/mlx/gui/bugreport.py
===================================================================
--- src/mlx/gui/bugreport.py	(revision 919)
+++ src/mlx/gui/bugreport.py	(revision 492)
@@ -1,4 +1,4 @@
 
-from .common import *
+from common import *
 
 from mlx.i18n import xstr
@@ -105,5 +105,5 @@
         response = super(BugReportDialog, self).run()
 
-        print("response", response, RESPONSETYPE_ACCEPT)
+        print "response", response, RESPONSETYPE_ACCEPT
         if response==RESPONSETYPE_ACCEPT:
             self._send()
Index: src/mlx/gui/callouts.py
===================================================================
--- src/mlx/gui/callouts.py	(revision 919)
+++ src/mlx/gui/callouts.py	(revision 300)
@@ -1,4 +1,4 @@
 
-from .common import *
+from common import *
 
 from mlx.i18n import xstr
@@ -208,5 +208,5 @@
             config = self._gui.config
             for (aircraftType, approachCallouts) in \
-                    self._approachCallouts.items():
+                    self._approachCallouts.iteritems():
                 config.setApproachCallouts(aircraftType, approachCallouts)
             config.save()
Index: src/mlx/gui/cef.py
===================================================================
--- src/mlx/gui/cef.py	(revision 945)
+++ src/mlx/gui/cef.py	(revision 915)
@@ -1,3 +1,3 @@
-from .common import *
+from common import *
 
 from mlx.util import secondaryInstallation
@@ -10,12 +10,11 @@
 import os
 import re
-import _thread
+import thread
 import threading
 import tempfile
 import traceback
-import ctypes
-import urllib.request, urllib.error, urllib.parse
+import urllib2
 from lxml import etree
-from io import StringIO
+from StringIO import StringIO
 import lxml.html
 
@@ -113,9 +112,9 @@
                              SIMBRIEF_RESULT_NONE, None)
 
-    def _onLoadEnd(self, browser, frame, http_code):
+    def _onLoadEnd(self, browser, frame, httpCode):
         """Called when a page has been loaded in the SimBrief browser."""
         url = frame.GetUrl()
-        print("gui.cef.SimBriefHandler._onLoadEnd", http_code, url)
-        if http_code>=300:
+        print "gui.cef.SimBriefHandler._onLoadEnd", httpCode, url
+        if httpCode>=300:
             self._updateProgress(self._lastProgress,
                                  SIMBRIEF_RESULT_ERROR_OTHER, None)
@@ -128,7 +127,7 @@
 
             js = "form=document.getElementById(\"sbapiform\");"
-            for (name, value) in self._plan.items():
+            for (name, value) in self._plan.iteritems():
                 js += "form." + name + ".value=\"" + value + "\";"
-            for (name, value) in SimBriefHandler._querySettings.items():
+            for (name, value) in SimBriefHandler._querySettings.iteritems():
                 if isinstance(value, bool):
                     js += "form." + name + ".checked=" + \
@@ -176,6 +175,6 @@
 
             thread = threading.Thread(target = self._getResults, args = (link,))
-            _thread.daemon = True
-            _thread.start()
+            thread.daemon = True
+            thread.start()
         else:
             self._updateProgress(SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING,
@@ -195,10 +194,8 @@
         self._lastProgress = progress
         if results!=SIMBRIEF_RESULT_NONE:
-            if self._timeoutID is not None:
-                gobject.source_remove(self._timeoutID)
+            gobject.source_remove(self._timeoutID)
             self._plan = None
 
-        if self._updateProgressFn is not None:
-            self._updateProgressFn(progress, results, flightInfo)
+        self._updateProgressFn(progress, results, flightInfo)
 
     def _timedOut(self):
@@ -222,5 +219,5 @@
 
         # Obtaining the xml
-        response = urllib.request.urlopen(link)
+        response = urllib2.urlopen(link)
         xmlContent = response.read()
         # Processing xml
@@ -245,5 +242,5 @@
                     imageLinks.append(imageLink[2])
         flightInfo["image_links"] = imageLinks
-        print((sorted(availableInfo.keys())))
+        print(sorted(availableInfo.keys()))
         htmlFilePath = "simbrief_plan.html" if self._htmlFilePath is None \
           else self._htmlFilePath
@@ -269,5 +266,5 @@
 def _initializeCEF(args, initializedCallback):
     """Perform the actual initialization of CEF using the given arguments."""
-    print("Initializing CEF with args:", args)
+    print "Initializing CEF with args:", args
 
     settings = {
@@ -293,5 +290,5 @@
                     switches[arg[2:assignIndex]] = arg[assignIndex+1:]
         else:
-            print("Unhandled switch", arg)
+            print "Unhandled switch", arg
 
     cefpython.Initialize(settings, switches)
@@ -299,5 +296,5 @@
     gobject.timeout_add(10, _handleTimeout)
 
-    print("Initialized, executing callback...")
+    print "Initialized, executing callback..."
     initializedCallback()
 
@@ -323,17 +320,12 @@
     """Start a browser instance in the given container with the given URL."""
     if os.name=="nt":
-        gdk.threads_enter()
-        ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p
-        ctypes.pythonapi.PyCapsule_GetPointer.argtypes = \
-            [ctypes.py_object]
-        gpointer = ctypes.pythonapi.PyCapsule_GetPointer(
-            container.get_property("window").__gpointer__, None)
-        libgdk = ctypes.CDLL("libgdk-3-0.dll")
-        windowID = libgdk.gdk_win32_window_get_handle(gpointer)
-        container.windowID = windowID
-        gdk.threads_leave()
+        window = container.get_window()
+        if window is None:
+            print "mlx.gui.cef.startInContainer: no window found!"
+            windowID = None
+        else:
+            windowID = window.handle
     else:
-        container.set_visual(container.get_screen().lookup_visual(0x21))
-        windowID = container.get_window().get_xid()
+        windowID = container.window.xid
 
     windowInfo = cefpython.WindowInfo()
@@ -348,12 +340,12 @@
 
 class OffscreenRenderHandler(object):
-    def GetRootScreenRect(self, browser, rect_out):
+    def GetRootScreenRect(self, browser, rect):
         #print "GetRootScreenRect"
-        rect_out += [0, 0, 800, 600]
+        rect += [0, 0, 800, 600]
         return True
 
-    def GetViewRect(self, browser, rect_out):
+    def GetViewRect(self, browser, rect):
         #print "GetViewRect"
-        rect_out += [0, 0, 800, 600]
+        rect += [0, 0, 800, 600]
         return True
 
@@ -375,5 +367,5 @@
         pass
 
-    def OnPaint(self, browser, element_type, dirty_rects, paint_buffer, width, height):
+    def OnPaint(self, browser, paintElementType, dirtyRects, buffer, width, height):
         #print "OnPaint", paintElementType, dirtyRects, buffer, width, height
         pass
@@ -432,5 +424,6 @@
 
 def _handleSizeAllocate(widget, sizeAlloc):
-    """Handle the size-allocate event on Windows."""
+    """Handle the size-allocate event."""
+    window = widget.get_window()
     if widget is not None:
-        cefpython.WindowUtils.OnSize(widget.windowID, 0, 0, 0)
+        cefpython.WindowUtils.OnSize(window.handle, 0, 0, 0)
Index: src/mlx/gui/checklist.py
===================================================================
--- src/mlx/gui/checklist.py	(revision 919)
+++ src/mlx/gui/checklist.py	(revision 300)
@@ -1,4 +1,4 @@
 
-from .common import *
+from common import *
 
 from mlx.i18n import xstr
@@ -190,5 +190,5 @@
             self._saveChecklist()
             config = self._gui.config
-            for (aircraftType, checklist) in self._checklists.items():
+            for (aircraftType, checklist) in self._checklists.iteritems():
                 config.setChecklist(aircraftType, checklist)
             config.save()
Index: src/mlx/gui/common.py
===================================================================
--- src/mlx/gui/common.py	(revision 926)
+++ src/mlx/gui/common.py	(revision 863)
@@ -31,5 +31,5 @@
 
 if not pygobject:
-    print("Using PyGTK")
+    print "Using PyGTK"
     pygobject = False
     import pygtk
@@ -42,5 +42,5 @@
         import appindicator
         appIndicator = True
-    except Exception as e:
+    except Exception, e:
         pass
 
@@ -113,5 +113,5 @@
     def text2unicode(text):
         """Convert the given text, returned by a Gtk widget, to Unicode."""
-        return str(text)
+        return unicode(text)
 
     def text2str(text):
@@ -120,18 +120,11 @@
 
 else: # pygobject
-    import gi
-    gi.require_version("Gdk", "3.0")
     from gi.repository import Gdk as gdk
     from gi.repository import GdkPixbuf as gdkPixbuf
-    gi.require_version("Gtk", "3.0")
     from gi.repository import Gtk as gtk
-    try:
-        gi.require_version("AppIndicator3", "0.1")
-        from gi.repository import AppIndicator3 as appindicator
-        appIndicator = True
-    except:
-        pass
+    from gi.repository import AppIndicator3 as appindicator
     from gi.repository import Pango as pango
 
+    appIndicator = True
 
 
@@ -303,6 +296,5 @@
     def __init__(self):
         """Construct the entry"""
-        super(TimeEntry, self).__init__()
-        self.set_max_width_chars(5)
+        super(TimeEntry, self).__init__(max = 5)
 
         self.connect("insert-text", self._insertText)
Index: src/mlx/gui/delaycodes.py
===================================================================
--- src/mlx/gui/delaycodes.py	(revision 919)
+++ src/mlx/gui/delaycodes.py	(revision 840)
@@ -3,5 +3,5 @@
 #------------------------------------------------------------------------------
 
-from .dcdata import CAPTION, DELAYCODE, getTable
+from dcdata import CAPTION, DELAYCODE, getTable
 
 from mlx.gui.common import *
Index: src/mlx/gui/faultexplain.py
===================================================================
--- src/mlx/gui/faultexplain.py	(revision 919)
+++ src/mlx/gui/faultexplain.py	(revision 842)
@@ -247,5 +247,5 @@
     def reset(self):
         """Reset the widget by removing all faults."""
-        for (alignment, faultFrame) in self._faultWidgets.values():
+        for (alignment, faultFrame) in self._faultWidgets.itervalues():
             self._faults.remove(alignment)
         self._faults.show_all()
Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 919)
+++ src/mlx/gui/flight.py	(revision 872)
@@ -405,10 +405,10 @@
     def _offlineClicked(self, button):
         """Called when the offline button was clicked."""
-        print("mlx.flight.LoginPage: offline flight selected")
+        print "mlx.flight.LoginPage: offline flight selected"
         self._wizard.nextPage()
 
     def _loginClicked(self, button):
         """Called when the login button was clicked."""
-        print("mlx.flight.LoginPage: logging in")
+        print "mlx.flight.LoginPage: logging in"
         self._wizard.login(self._handleLoginResult,
                            self._pilotID.get_text(),
@@ -649,10 +649,10 @@
         if response==RESPONSETYPE_OK:
             fileName = text2unicode(dialog.get_filename())
-            print("Saving", fileName)
+            print "Saving", fileName
             try:
                 with open(fileName, "wt") as f:
                     flight.writeIntoFile(f)
-            except Exception as e:
-                print("Failed to save flight:", util.utf2unicode(str(e)))
+            except Exception, e:
+                print "Failed to save flight:", util.utf2unicode(str(e))
                 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
                                            type = MESSAGETYPE_ERROR,
@@ -706,5 +706,5 @@
         flight=self._getSelectedFlight()
 
-        print("DPI", context.get_dpi_x(), context.get_dpi_y())
+        print "DPI", context.get_dpi_x(), context.get_dpi_y()
 
         scale = context.get_dpi_x() / 72.0
@@ -719,5 +719,5 @@
 
         layout = cr.create_layout()
-        layout.set_text("Malév VA official briefing")
+        layout.set_text(u"Malév VA official briefing")
         font = pango.FontDescription("sans")
         font.set_size(int(32 * scale * pango.SCALE))
@@ -740,5 +740,5 @@
 
         layout = cr.create_layout()
-        layout.set_text("%s (%s) részére" %
+        layout.set_text(u"%s (%s) részére" %
                         (loginResult.pilotName, loginResult.pilotID))
         font = pango.FontDescription("sans")
@@ -940,5 +940,5 @@
         if response==RESPONSETYPE_OK:
             fileName = text2unicode(dialog.get_filename())
-            print("Loading", fileName)
+            print "Loading", fileName
             bookedFlight = web.BookedFlight()
             try:
@@ -946,6 +946,6 @@
                     bookedFlight.readFromFile(f)
                 self.addFlight(bookedFlight)
-            except Exception as e:
-                print("Failed to load flight:", util.utf2unicode(str(e)))
+            except Exception, e:
+                print "Failed to load flight:", util.utf2unicode(str(e))
                 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
                                            type = MESSAGETYPE_ERROR,
@@ -1629,13 +1629,13 @@
                                             self.phoneNumber, self.nationality,
                                             self.password)
-        print("Registering with data:")
-        print("  name:", self.name1, self.name2, registrationData.firstName, registrationData.surName, requestedNameOrder)
-        print("  yearOfBirth:", self.yearOfBirth, registrationData.yearOfBirth)
-        print("  emailAddress:", self.emailAddress, registrationData.emailAddress)
-        print("  emailAddressPublic:", self.emailAddressPublic, registrationData.emailAddressPublic)
-        print("  vatsimID:", self.vatsimID, registrationData.vatsimID)
-        print("  ivaoID:", self.ivaoID, registrationData.ivaoID)
-        print("  phoneNumber:", self.phoneNumber, registrationData.phoneNumber)
-        print("  nationality:", self.nationality, registrationData.nationality)
+        print "Registering with data:"
+        print "  name:", self.name1, self.name2, registrationData.firstName, registrationData.surName, requestedNameOrder
+        print "  yearOfBirth:", self.yearOfBirth, registrationData.yearOfBirth
+        print "  emailAddress:", self.emailAddress, registrationData.emailAddress
+        print "  emailAddressPublic:", self.emailAddressPublic, registrationData.emailAddressPublic
+        print "  vatsimID:", self.vatsimID, registrationData.vatsimID
+        print "  ivaoID:", self.ivaoID, registrationData.ivaoID
+        print "  phoneNumber:", self.phoneNumber, registrationData.phoneNumber
+        print "  nationality:", self.nationality, registrationData.nationality
 
         gui = self._wizard.gui
@@ -1653,13 +1653,13 @@
         gui.endBusy()
 
-        print("Registration result:")
-        print("  returned:", returned)
+        print "Registration result:"
+        print "  returned:", returned
         if returned:
-            print("  registered:", result.registered)
+            print "  registered:", result.registered
             if result.registered:
-                print("  pilotID", result.pilotID)
-                print("  loggedIn", result.loggedIn)
-            print("  emailAlreadyRegistered:", result.emailAlreadyRegistered)
-            print("  invalidData:", result.invalidData)
+                print "  pilotID", result.pilotID
+                print "  loggedIn", result.loggedIn
+            print "  emailAlreadyRegistered:", result.emailAlreadyRegistered
+            print "  invalidData:", result.invalidData
 
         registrationOK = returned and result.registered
@@ -1830,5 +1830,5 @@
     def activate(self):
         """Activate the student page."""
-        print("StudentPage.activate")
+        print "StudentPage.activate"
         self._getEntryExamStatusCancelled = False
 
@@ -1844,5 +1844,5 @@
     def finalize(self):
         """Finalize the page."""
-        print("StudentPage.finalize")
+        print "StudentPage.finalize"
         self._getEntryExamStatusCancelled = True
 
@@ -1864,5 +1864,5 @@
     def _handleEntryExamStatus(self, returned, result):
         """Called when the entry exam status is availabe."""
-        print("_handleEntryExamStatus", returned, result)
+        print "_handleEntryExamStatus", returned, result
         if returned and not self._getEntryExamStatusCancelled:
             self._entryExamLink = result.entryExamLink
@@ -2991,5 +2991,5 @@
 
             plan = self._getPlan()
-            print("plan:", plan)
+            print "plan:", plan
 
             takeoffRunway = self._takeoffRunway.get_text()
@@ -3027,5 +3027,5 @@
         are returned. Otherwise a dialog box is displayed informing the user of
         invalid credentials and requesting another set of them."""
-        print("_getCredentials", count)
+        print "_getCredentials", count
         if count==0:
             return (self._userName.get_text(), self._password.get_text())
@@ -3061,5 +3061,5 @@
     def _simBriefProgress(self, progress, result, flightInfo):
         """The real SimBrief progress handler."""
-        print("_simBriefProgress", progress, result, flightInfo)
+        print "_simBriefProgress", progress, result, flightInfo
         if result==cef.SIMBRIEF_RESULT_NONE:
             message = SimBriefSetupPage.progress2Message.get(progress,
@@ -3758,5 +3758,5 @@
     def _metarChanged(self, buffer):
         """Called when the METAR has changed."""
-        print("BriefingPage.metarChanged", self._updatingMETAR)
+        print "BriefingPage.metarChanged", self._updatingMETAR
         if not self._updatingMETAR:
             self.metarEdited = True
@@ -3770,5 +3770,5 @@
 
         It uppercases all characters."""
-        print("BriefingPage.metarInserted", self._updatingMETAR)
+        print "BriefingPage.metarInserted", self._updatingMETAR
         if not self._updatingMETAR:
             self._updatingMETAR = True
@@ -4025,5 +4025,5 @@
     def activate(self):
         """Activate the page."""
-        print("TakeoffPage.activate")
+        print "TakeoffPage.activate"
 
         self._updatingMETAR = True
@@ -4069,5 +4069,5 @@
     def allowForward(self):
         """Allow going to the next page."""
-        print("TakeoffPage.allowForward")
+        print "TakeoffPage.allowForward"
         self._forwardAllowed = True
         self._updateForwardButton()
@@ -4075,5 +4075,5 @@
     def reset(self):
         """Reset the page if the wizard is reset."""
-        print("TakeoffPage.reset")
+        print "TakeoffPage.reset"
 
         super(TakeoffPage, self).reset()
@@ -4095,5 +4095,5 @@
         pages."""
         if self._active:
-            print("TakeoffPage.changeMETAR")
+            print "TakeoffPage.changeMETAR"
             self._updatingMETAR = True
             self._metar.get_buffer().set_text(metar, -1)
@@ -4116,14 +4116,14 @@
                      self.derate is not None)
 
-        print("TakeoffPage._updateForwardButton: forwardAllowed:", self._forwardAllowed, ", sensitive:", sensitive)
+        print "TakeoffPage._updateForwardButton: forwardAllowed:", self._forwardAllowed, ", sensitive:", sensitive
         if self._forwardAllowed:
-            print("  METAR: ", self._metar.get_text())
-            print("  runway: ", self._runway.get_text())
-            print("  SID:", self.sid)
-            print("  V1:", self.v1)
-            print("  VR:", self.vr)
-            print("  V2:", self.v2)
-            print("  derateType:", self._derateType)
-            print("  derate:", self.derate)
+            print "  METAR: ", self._metar.get_text()
+            print "  runway: ", self._runway.get_text()
+            print "  SID:", self.sid
+            print "  V1:", self.v1
+            print "  VR:", self.vr
+            print "  V2:", self.v2
+            print "  derateType:", self._derateType
+            print "  derate:", self.derate
 
         self._button.set_sensitive(sensitive)
@@ -4131,5 +4131,5 @@
     def _valueChanged(self, widget, arg = None):
         """Called when the value of some widget has changed."""
-        print("TakeoffPage._valueChanged")
+        print "TakeoffPage._valueChanged"
 
         self._updateForwardButton()
@@ -4138,5 +4138,5 @@
         """Called when the value of some entry widget has changed and the value
         should be converted to uppercase."""
-        print("TakeoffPage._upperChanged")
+        print "TakeoffPage._upperChanged"
         entry.set_text(entry.get_text().upper())
         self._valueChanged(entry, arg)
@@ -4151,5 +4151,5 @@
     def _derateChanged(self, entry):
         """Called when the value of the derate is changed."""
-        print("TakeoffPage._derateChanged")
+        print "TakeoffPage._derateChanged"
         self._updateForwardButton()
 
@@ -4262,5 +4262,5 @@
     def _metarChanged(self, entry):
         """Called when the METAR has changed."""
-        print("TakeoffPage.metarChanged", self._updatingMETAR)
+        print "TakeoffPage.metarChanged", self._updatingMETAR
         if not self._updatingMETAR:
             self._updateForwardButton()
@@ -4271,5 +4271,5 @@
 
         It uppercases all characters."""
-        print("TakeoffPage.metarInserted", self._updatingMETAR)
+        print "TakeoffPage.metarInserted", self._updatingMETAR
         if not self._updatingMETAR:
             self._updatingMETAR = True
@@ -4628,5 +4628,5 @@
         pages."""
         if self._active:
-            print("LandingPage.changeMETAR")
+            print "LandingPage.changeMETAR"
             self._updatingMETAR = True
             self._metar.get_buffer().set_text(metar, -1)
@@ -4689,5 +4689,5 @@
     def _metarChanged(self, entry):
         """Called when the METAR has changed."""
-        print("LandingPage.metarChanged", self._updatingMETAR)
+        print "LandingPage.metarChanged", self._updatingMETAR
         if not self._updatingMETAR:
             self._updateForwardButton()
@@ -4698,5 +4698,5 @@
 
         It uppercases all characters."""
-        print("LandingPage.metarInserted", self._updatingMETAR)
+        print "LandingPage.metarInserted", self._updatingMETAR
         if not self._updatingMETAR:
             self._updatingMETAR = True
@@ -5217,8 +5217,7 @@
         pass
 
-    def _formatTime(self, scheduledTime, realTimestamp, xxx_todo_changeme):
+    def _formatTime(self, scheduledTime, realTimestamp, (warning, error)):
         """Format the departure or arrival time based on the given data as a
         markup for a label."""
-        (warning, error) = xxx_todo_changeme
         realTime = time.gmtime(realTimestamp)
 
@@ -5753,5 +5752,5 @@
         elif stage==const.STAGE_LANDING:
             if not self._arrivalBriefingPage.metarEdited:
-                print("Downloading arrival METAR again")
+                print "Downloading arrival METAR again"
                 self.gui.webHandler.getMETARs(self._arrivalMETARCallback,
                                               [self._bookedFlight.arrivalICAO])
Index: src/mlx/gui/flightlist.py
===================================================================
--- src/mlx/gui/flightlist.py	(revision 927)
+++ src/mlx/gui/flightlist.py	(revision 868)
@@ -61,5 +61,5 @@
 
         if self._extraColumnAttributes is not None:
-            for (key, value) in self._extraColumnAttributes.items():
+            for (key, value) in self._extraColumnAttributes.iteritems():
                 if key=="alignment":
                     self._renderer.set_alignment(value, 0.5)
@@ -171,5 +171,5 @@
     def hasFlights(self):
         """Determine if there are any flights in the list."""
-        return self._model.get_iter_first() is not None
+        return self._model.get_iter_root() is not None
 
     def clear(self):
@@ -271,6 +271,5 @@
     def __init__(self, which, wizard, window, pirepEditable = False):
         """Construct the frame with the given title."""
-        super(PendingFlightsFrame, self).__init__()
-        self.set_label(xstr("pendflt_title_" + which))
+        super(PendingFlightsFrame, self).__init__(xstr("pendflt_title_" + which))
 
         self._which = which
@@ -402,5 +401,5 @@
         gui.endBusy()
 
-        print("PendingFlightsFrame._handleReflyResult", returned, result)
+        print "PendingFlightsFrame._handleReflyResult", returned, result
 
         if returned:
@@ -445,5 +444,5 @@
         gui.endBusy()
 
-        print("PendingFlightsFrame._handleDeleteResult", returned, result)
+        print "PendingFlightsFrame._handleDeleteResult", returned, result
 
         if returned:
Index: src/mlx/gui/gates.py
===================================================================
--- src/mlx/gui/gates.py	(revision 919)
+++ src/mlx/gui/gates.py	(revision 619)
@@ -143,5 +143,5 @@
         self._fleetStore.clear()
         if fleet is None:
-            for (gateNumber, label) in self._gateLabels.items():
+            for (gateNumber, label) in self._gateLabels.iteritems():
                 label.set_markup("<b>" + gateNumber + "</b>")
         else:        
Index: src/mlx/gui/gui.py
===================================================================
--- src/mlx/gui/gui.py	(revision 946)
+++ src/mlx/gui/gui.py	(revision 951)
@@ -1,8 +1,8 @@
 # -*- coding: utf-8 -*-
 
-from .statusicon import StatusIcon
-from .statusbar import Statusbar
-from .info import FlightInfo
-from .update import Updater
+from statusicon import StatusIcon
+from statusbar import Statusbar
+from info import FlightInfo
+from update import Updater
 from mlx.gui.common import *
 from mlx.gui.flight import Wizard
@@ -18,5 +18,5 @@
 from mlx.gui.acars import ACARS
 from mlx.gui.timetable import TimetableWindow
-from . import cef
+import cef
 
 import mlx.const as const
@@ -51,13 +51,13 @@
 class GUI(fs.ConnectionListener):
     """The main GUI class."""
-    _authors = [ ("Váradi", "István", "prog_test"),
-                 ("Galyassy", "Tamás", "negotiation"),
-                 ("Kurják", "Ákos", "test"),
-                 ("Nagy", "Dániel", "test"),
-                 ("Radó", "Iván", "test"),
-                 ("Petrovszki", "Gábor", "test"),
-                 ("Serfőző", "Tamás", "test"),
-                 ("Szebenyi", "Bálint", "test"),
-                 ("Zsebényi-Loksa", "Gergely", "test") ]
+    _authors = [ (u"Váradi", u"István", "prog_test"),
+                 (u"Galyassy", u"Tamás", "negotiation"),
+                 (u"Kurják", u"Ákos", "test"),
+                 (u"Nagy", u"Dániel", "test"),
+                 (u"Radó", u"Iván", "test"),
+                 (u"Petrovszki", u"Gábor", "test"),
+                 (u"Serfőző", u"Tamás", "test"),
+                 (u"Szebenyi", u"Bálint", "test"),
+                 (u"Zsebényi-Loksa", u"Gergely", "test") ]
 
     def __init__(self, programDirectory, config):
@@ -109,6 +109,4 @@
 
         self._mainWindow = window = gtk.Window()
-        if os.name!="nt":
-            window.set_visual(window.get_screen().lookup_visual(0x21))
         window.set_title(WINDOW_TITLE_BASE)
         window.set_icon_from_file(os.path.join(iconDirectory, "logo.ico"))
@@ -199,4 +197,6 @@
 
         window.show_all()
+        if os.name=="nt":
+            window.get_window().focus()
 
         self._wizard.grabDefault()
@@ -763,5 +763,5 @@
         Here we reset the focus to the main window as CEF might have acquired
         it earlier."""
-        self._mainWindow.get_window().focus(0)
+        self._mainWindow.get_window().focus()
 
     def raiseCallback(self):
@@ -1460,5 +1460,5 @@
                 secondaryMarkup = xstr("sendPIREP_unknown_sec")
         else:
-            print("PIREP sending failed", result)
+            print "PIREP sending failed", result
             messageFormat = xstr("sendPIREP_failed")
             secondaryMarkup = xstr("sendPIREP_failed_sec")
@@ -1684,5 +1684,5 @@
                 secondaryMarkup = xstr("sendPIREP_unknown_sec")
         else:
-            print("PIREP sending failed", result)
+            print "PIREP sending failed", result
             messageFormat = xstr("sendPIREP_failed")
             secondaryMarkup = xstr("sendPIREP_failed_sec")
@@ -1709,5 +1709,5 @@
 
         for (timestampString, text) in self._logger.lines:
-            description += str(formatFlightLogLine(timestampString, text))
+            description += unicode(formatFlightLogLine(timestampString, text))
 
         description += "\n\n" + ("=" * 40)
@@ -1796,11 +1796,11 @@
             for index in hotkeys:
                 if index==self._pilotHotkeyIndex:
-                    print("gui.GUI._handleHotkeys: pilot hotkey pressed")
+                    print "gui.GUI._handleHotkeys: pilot hotkey pressed"
                     self._flight.pilotHotkeyPressed()
                 elif index==self._checklistHotkeyIndex:
-                    print("gui.GUI._handleHotkeys: checklist hotkey pressed")
+                    print "gui.GUI._handleHotkeys: checklist hotkey pressed"
                     self._flight.checklistHotkeyPressed()
                 else:
-                    print("gui.GUI._handleHotkeys: unhandled hotkey index:", index)
+                    print "gui.GUI._handleHotkeys: unhandled hotkey index:", index
 
     def _showManual(self, menuitem):
Index: src/mlx/gui/info.py
===================================================================
--- src/mlx/gui/info.py	(revision 919)
+++ src/mlx/gui/info.py	(revision 846)
@@ -1,4 +1,4 @@
 
-from .common import *
+from common import *
 
 from mlx.gui.delaycodes import DelayCodeTable
Index: src/mlx/gui/pirep.py
===================================================================
--- src/mlx/gui/pirep.py	(revision 919)
+++ src/mlx/gui/pirep.py	(revision 855)
@@ -1,7 +1,7 @@
 
-from .common import *
-from .dcdata import getTable
-from .info import FlightInfo
-from .flight import comboModel
+from common import *
+from dcdata import getTable
+from info import FlightInfo
+from flight import comboModel
 
 from mlx.pirep import PIREP
Index: src/mlx/gui/prefs.py
===================================================================
--- src/mlx/gui/prefs.py	(revision 919)
+++ src/mlx/gui/prefs.py	(revision 738)
@@ -1,4 +1,4 @@
 
-from .common import *
+from common import *
 
 from mlx.i18n import xstr
@@ -6,5 +6,5 @@
 import mlx.config as config
 
-import urllib.parse
+import urlparse
 
 #------------------------------------------------------------------------------
@@ -63,5 +63,5 @@
 
         self._hotkeyModel = gtk.ListStore(str)
-        for keyCode in list(range(ord("0"), ord("9")+1)) + list(range(ord("A"), ord("Z")+1)):
+        for keyCode in range(ord("0"), ord("9")+1) + range(ord("A"), ord("Z")+1):
             self._hotkeyModel.append([chr(keyCode)])
 
@@ -829,5 +829,5 @@
         sensitive = False
         try:
-            result = urllib.parse.urlparse(self._updateURL.get_text())
+            result = urlparse.urlparse(self._updateURL.get_text())
             sensitive = result.scheme!="" and (result.netloc + result.path)!=""
         except:
Index: src/mlx/gui/statusbar.py
===================================================================
--- src/mlx/gui/statusbar.py	(revision 919)
+++ src/mlx/gui/statusbar.py	(revision 679)
@@ -1,4 +1,4 @@
 
-from .common import *
+from common import *
 
 import mlx.const as const
Index: src/mlx/gui/statusicon.py
===================================================================
--- src/mlx/gui/statusicon.py	(revision 919)
+++ src/mlx/gui/statusicon.py	(revision 544)
@@ -1,4 +1,4 @@
 
-from .common import *
+from common import *
 
 import mlx.const as const
@@ -154,5 +154,5 @@
     def _updateFlightStatus(self):
         """Update the flight status."""
-        stage = "-" if self._stage is None \
+        stage = u"-" if self._stage is None \
                 else xstr("flight_stage_" + const.stage2string(self._stage))
 
@@ -172,5 +172,5 @@
             if self._noGoReason is not None:
                 rating = '<span foreground="red">' + rating + '</span>'
-            markup = "MAVA Logger X %s\n\n%s: %s\n%s: %s" %\
+            markup = u"MAVA Logger X %s\n\n%s: %s\n%s: %s" %\
                      (const.VERSION, xstr("statusicon_stage"), stage,
                       xstr("statusicon_rating"), rating)
Index: src/mlx/gui/timetable.py
===================================================================
--- src/mlx/gui/timetable.py	(revision 927)
+++ src/mlx/gui/timetable.py	(revision 879)
@@ -4,5 +4,5 @@
 
 from mlx.gui.common import *
-from .flightlist import ColumnDescriptor
+from flightlist import ColumnDescriptor
 from mlx.rpc import ScheduledFlight
 
@@ -82,4 +82,6 @@
         self._view = gtk.TreeView(self._model)
 
+        self._tooltips = gtk.Tooltips()
+        self._tooltips.disable()
         self._view.connect("motion-notify-event", self._updateTooltip)
 
@@ -223,5 +225,6 @@
             result = widget.get_path_at_pos( int(event.x), int(event.y))
             if result is None:
-                widget.set_tooltip_text("")
+                self._tooltips.set_tip(widget, "")
+                self._tooltips.disable()
             else:
                 (path, col, x, y) = result
@@ -241,18 +244,13 @@
                         text += date.strftime("%Y-%m-%d")
 
-                    widget.set_tooltip_text(text)
+                    self._tooltips.set_tip(widget, text)
+                    self._tooltips.enable()
                 else:
-                    widget.set_tooltip_text("")
-        except Exception as e:
-            print(e)
-            widget.set_tooltip_text("")
-
-#-----------------------------------------------------------------------------
-
-gobject.signal_new("row-activated", Timetable, gobject.SIGNAL_RUN_FIRST,
-                   None, (int,))
-
-gobject.signal_new("selection-changed", Timetable, gobject.SIGNAL_RUN_FIRST,
-                   None, (object,))
+                    self._tooltips.set_tip(widget, "")
+                    self._tooltips.disable()
+        except Exception, e:
+            print e
+            self._tooltips.set_tip(widget, "")
+            self._tooltips.disable()
 
 #-----------------------------------------------------------------------------
@@ -522,6 +520,5 @@
                                         xscale = 1.0, yscale = 1.0)
 
-        filterFrame = gtk.Frame()
-        filterFrame.set_label(xstr("timetable_filter"))
+        filterFrame = gtk.Frame(xstr("timetable_filter"))
 
         filterVBox = gtk.VBox()
@@ -659,5 +656,5 @@
             typeFamilies.add(const.aircraftType2Family(aircraftType))
 
-        for (typeFamily, checkButton) in self._typeFamilyButtons.items():
+        for (typeFamily, checkButton) in self._typeFamilyButtons.iteritems():
             checkButton.set_sensitive(typeFamily in typeFamilies)
 
@@ -715,5 +712,5 @@
         """Update the timetable list."""
         aircraftTypes = []
-        for (aircraftFamily, button) in self._typeFamilyButtons.items():
+        for (aircraftFamily, button) in self._typeFamilyButtons.iteritems():
             if button.get_active():
                 aircraftTypes += const.aircraftFamily2Types[aircraftFamily]
@@ -755,5 +752,5 @@
         planes = [plane for plane in fleet
                   if plane.aircraftType == aircraftType]
-        planes.sort(key = lambda p: p.tailNumber)
+        planes.sort(cmp = lambda p1, p2: cmp(p1.tailNumber, p2.tailNumber))
 
         dialog = BookDialog(self, flightPair, planes)
Index: src/mlx/i18n.py
===================================================================
--- src/mlx/i18n.py	(revision 928)
+++ src/mlx/i18n.py	(revision 298)
@@ -24,5 +24,5 @@
 def setLanguage(programDirectory, language):
     """Setup the internationalization support for the given language."""
-    print("i18n.setLanguage", language)
+    print "i18n.setLanguage", language
     translation = _getTranslation(programDirectory, language)
     fallback = _getFallbackFor(programDirectory, language)
@@ -51,5 +51,5 @@
     If not found, the fallback language is searched. If that is not found
     either, the key itself is returned within curly braces."""
-    return _translation.gettext(key)
+    return _translation.ugettext(key)
     
 #------------------------------------------------------------------------------
Index: src/mlx/logger.py
===================================================================
--- src/mlx/logger.py	(revision 921)
+++ src/mlx/logger.py	(revision 634)
@@ -1,11 +1,10 @@
 
-from .fs import sendMessage
-from . import const
-from . import util
+from fs import sendMessage
+import const
+import util
 
 import sys
 import time
 import bisect
-from functools import total_ordering
 
 #--------------------------------------------------------------------------------------
@@ -35,5 +34,4 @@
     increasing IDs."""
 
-    @total_ordering
     class Entry(object):
         """An entry in the log."""
@@ -121,19 +119,13 @@
                                 id = self._id)
 
-        def __eq__(self, other):
-            """Equality comparison"""
-            return self._timestamp == other.timestamp and \
-                self._id == other._id
-
-        def __ne__(self, other):
-            """Non-equality comparison"""
-            return self._timestamp != other.timestamp or \
-                self._id != other._id
-
-        def __lt__(self, other):
-            """Less-than comparison"""
-            return self._timestamp < other.timestamp or \
-                (self._timestamp == other.timestamp and
-                 self._id < other._id)
+        def __cmp__(self, other):
+            """Compare two entries
+
+            First their timestamps are compared, and if those are equal, then
+            their IDs."""
+            result = cmp(self._timestamp, other.timestamp)
+            if result==0:
+                result = cmp(self._id, other._id)
+            return result
 
     class Fault(object):
@@ -243,5 +235,5 @@
     def debug(self, msg):
         """Log a debug message."""
-        print("[DEBUG]", msg)
+        print "[DEBUG]", msg
 
     def stage(self, timestamp, stage):
@@ -334,5 +326,5 @@
         """Get the rating of the flight so far."""
         totalScore = 100
-        for fault in self._faults.values():
+        for fault in self._faults.itervalues():
             score = fault.score
             if score==Logger.NO_GO_SCORE:
Index: src/mlx/mlx.py
===================================================================
--- src/mlx/mlx.py	(revision 919)
+++ src/mlx/mlx.py	(revision 800)
@@ -1,9 +1,9 @@
 
-from .config import Config
-from .i18n import setLanguage
-from .sound import preInitializeSound, initializeSound, finalizeSound
-from .util import secondaryInstallation
-from .const import VERSION
-from .watchdog import Watchdog
+from config import Config
+from i18n import setLanguage
+from sound import preInitializeSound, initializeSound, finalizeSound
+from util import secondaryInstallation
+from const import VERSION
+from watchdog import Watchdog
 
 import os
@@ -60,5 +60,5 @@
 def main():
     """The main operation of the program."""
-    from .singleton import SingleInstance, raiseCallbackWrapper
+    from singleton import SingleInstance, raiseCallbackWrapper
 
     global instance
@@ -86,6 +86,6 @@
     sys.stderr = StdIOHandler(gui)
 
-    print("MAVA Logger X " + VERSION + " debug log")
-    print("The initial configuration:")
+    print "MAVA Logger X " + VERSION + " debug log"
+    print "The initial configuration:"
     config.log()
 
Index: src/mlx/pirep.py
===================================================================
--- src/mlx/pirep.py	(revision 919)
+++ src/mlx/pirep.py	(revision 856)
@@ -1,8 +1,8 @@
 
-from .util import utf2unicode
-from .flight import Flight
-
-from . import const
-import pickle as pickle
+from util import utf2unicode
+from flight import Flight
+
+import const
+import cPickle as pickle
 import calendar
 import datetime
@@ -65,5 +65,5 @@
     def decodeFlightTypeText(s):
         """Decode the given flight type text."""
-        for (flighType, text) in PIREP._flightTypes.items():
+        for (flighType, text) in PIREP._flightTypes.iteritems():
             if s==text:
                 return flighType
@@ -124,7 +124,7 @@
                     pirep.mailWeight = pirep.bookedFlight.mailWeight
                 return pirep
-        except Exception as e:
-            print("Failed loading PIREP from %s: %s" % (path,
-                                                        utf2unicode(str(e))))
+        except Exception, e:
+            print "Failed loading PIREP from %s: %s" % (path,
+                                                        utf2unicode(str(e)))
             return None
 
@@ -367,7 +367,7 @@
                 pickle.dump(self, f)
             return None
-        except Exception as e:
+        except Exception, e:
             error = utf2unicode(str(e))
-            print("Failed saving PIREP to %s: %s" % (path, error))
+            print u"Failed saving PIREP to %s: %s" % (path, error)
             return error
 
Index: src/mlx/pyuipc_emu.py
===================================================================
--- src/mlx/pyuipc_emu.py	(revision 919)
+++ src/mlx/pyuipc_emu.py	(revision 298)
@@ -217,9 +217,9 @@
             results.append(int(vs / 60.0 * 0.3048 * 256))
         elif offset==0x0560:  # Latitude
-            results.append(int(latitude*10001750.0*65536.0*65536.0/90.0))
+            results.append(long(latitude*10001750.0*65536.0*65536.0/90.0))
         elif offset==0x0568:  # Longitude
-            results.append(int(longitude*65536.9*65536.0*65536.0*65536.0/360.0))
+            results.append(long(longitude*65536.9*65536.0*65536.0*65536.0/360.0))
         elif offset==0x0570:  # Aircraft altitude in metres (fractional part)
-            results.append(int( (altitude*0.3048*65536*65536)%(65536*65536)))
+            results.append(long( (altitude*0.3048*65536*65536)%(65536*65536)))
         elif offset==0x0574:  # Aircraft altitude in metres (whole part)
             results.append(int(altitude*.3048))
@@ -237,15 +237,15 @@
             centre_fuel = fuel_remaining - 2*side_tank_capacity
             if centre_fuel<0: centre_fuel = 0.0
-            results.append(int(round(centre_fuel/centre_tank_capacity*128.0*65536.0)))
+            results.append(long(round(centre_fuel/centre_tank_capacity*128.0*65536.0)))
         elif offset==0x0b78:  # Centre tank capacity (gallons)
-            results.append(int(round(centre_tank_capacity*KGTOLBS/fuel_weight)))
+            results.append(long(round(centre_tank_capacity*KGTOLBS/fuel_weight)))
         elif offset==0x0b7c or \
              offset==0x0b94:  # Left and right main tank level (%*128*65536)
             fuel = fuel_remaining/2
             if fuel>side_tank_capacity: fuel = side_tank_capacity
-            results.append(int(round(fuel/side_tank_capacity*128.0*65536.0)))
+            results.append(long(round(fuel/side_tank_capacity*128.0*65536.0)))
         elif offset==0x0b80 or \
              offset==0x0b98:  # Left and right main tank capacity (gallons)
-            results.append(int(round(side_tank_capacity*KGTOLBS/fuel_weight)))
+            results.append(long(round(side_tank_capacity*KGTOLBS/fuel_weight)))
         elif offset in [0x0b84, 0x0b88, 0x0b8c, 0x0b90,
                         0x0b9c, 0x0ba0, 0x0ba4, 0x0ba8,
@@ -253,5 +253,5 @@
                         0x1254, 0x1258, 0x125c, 0x1260]:
                               # Other tank capacities and levels
-            results.append(int(0))
+            results.append(long(0))
         elif offset==0x023a:  # Second of time
             results.append(int(tm[5]))
Index: src/mlx/pyuipc_sim.py
===================================================================
--- src/mlx/pyuipc_sim.py	(revision 928)
+++ src/mlx/pyuipc_sim.py	(revision 877)
@@ -1,4 +1,4 @@
 
-from . import const
+import const
 
 import cmd
@@ -9,5 +9,5 @@
 import sys
 import struct
-import pickle
+import cPickle
 import math
 
@@ -184,9 +184,9 @@
     def _readBCD(value):
         """Convert the given value into BCD format."""
-        bcd = (value//1000) % 10
+        bcd = (value/1000) % 10
         bcd <<= 4
-        bcd |= (value//100) % 10
+        bcd |= (value/100) % 10
         bcd <<= 4
-        bcd |= (value//10) % 10
+        bcd |= (value/10) % 10
         bcd <<= 4
         bcd |= value % 10
@@ -342,6 +342,6 @@
         try:
             return self._read(offset, type)
-        except Exception as e:
-            print("failed to read offset %04x: %s" % (offset, str(e)))
+        except Exception, e:
+            print "failed to read offset %04x: %s" % (offset, str(e))
             raise FSUIPCException(ERR_DATA)
 
@@ -360,5 +360,5 @@
             return int(index * flapsIncrement +
                        (self.flapsControl-self.flapsNotches[index]) *
-                       flapsIncrement //
+                       flapsIncrement /
                        (self.flapsNotches[index+1] - self.flapsNotches[index]))
 
@@ -414,9 +414,9 @@
             return 1 if self.overspeed else 0
         elif offset==0x0560:       # Latitude
-            return int(self.latitude * 10001750.0 * 65536.0 * 65536.0 / 90.0)
+            return long(self.latitude * 10001750.0 * 65536.0 * 65536.0 / 90.0)
         elif offset==0x0568:       # Longitude
-            return int(self.longitude * 65536.0 * 65536.0 * 65536.0 * 65536.0 / 360.0)
+            return long(self.longitude * 65536.0 * 65536.0 * 65536.0 * 65536.0 / 360.0)
         elif offset==0x0570:       # Altitude
-            return int(self.altitude * const.FEETTOMETRES * 65536.0 * 65536.0)
+            return long(self.altitude * const.FEETTOMETRES * 65536.0 * 65536.0)
         elif offset==0x0578:       # Pitch
             return int(self.pitch * 65536.0 * 65536.0 / 360.0)
@@ -542,5 +542,5 @@
         elif offset>=0x1400 and offset<=0x1f40 and \
              ((offset-0x1400)%48)==0: # Payload
-            return self.payload[ (offset - 0x1400) // 48 ]
+            return self.payload[ (offset - 0x1400) / 48 ]
         elif offset==0x2000:       # Engine #1 N1
             return self.n1[self.ENGINE_1]
@@ -568,5 +568,5 @@
         elif offset>=0x3210 and offset<0x3210+Values.HOTKEY_SIZE*4:
             tableOffset = offset - 0x3210
-            hotkeyIndex = tableOffset // 4
+            hotkeyIndex = tableOffset / 4
             index = tableOffset % 4
             if type=="b" or type=="c":
@@ -584,8 +584,8 @@
                     return value
                 else:
-                    print("Unhandled offset: %04x" % (offset,))
+                    print "Unhandled offset: %04x" % (offset,)
                     raise FSUIPCException(ERR_DATA)
             else:
-                print("Unhandled offset: %04x" % (offset,))
+                print "Unhandled offset: %04x" % (offset,)
                 raise FSUIPCException(ERR_DATA)
         elif offset==0x32fa:       # Message duration
@@ -602,11 +602,11 @@
             return self._getFlapsControl()
         elif offset==0x3bfa:       # Flaps increment
-            return 16383 // (len(self.flapsNotches)-1)
+            return 16383 / (len(self.flapsNotches)-1)
         elif offset==0x3bfc:       # ZFW
             return int(self.zfw * 256.0 * const.KGSTOLB)
         elif offset==0x3c00:       # Path of the current AIR file
-            return bytes(self.airPath, "iso-8859-1")
+            return self.airPath
         elif offset==0x3d00:       # Name of the current aircraft
-            return bytes(self.aircraftName, "iso-8859-1")
+            return self.aircraftName
         elif offset==0x6202:       # PMDG 737NG switches
             return self.pmdg_737ng_switches
@@ -616,5 +616,5 @@
             return 0 if self.xpdrC else 1
         else:
-            print("Unhandled offset: %04x" % (offset,))
+            print "Unhandled offset: %04x" % (offset,)
             raise FSUIPCException(ERR_DATA)
 
@@ -623,8 +623,8 @@
         try:
             return self._write(offset, value, type)
-        except TypeError as e:
+        except TypeError, e:
             raise e
-        except Exception as e:
-            print("failed to write offset %04x: %s" % (offset, str(e)))
+        except Exception, e:
+            print "failed to write offset %04x: %s" % (offset, str(e))
             raise FSUIPCException(ERR_DATA)
 
@@ -758,5 +758,5 @@
         elif offset==0x0bd0:       # Spoilers
             self.spoilters = 0 if value==0 \
-                             else (value - 4800) // (16383 - 4800)
+                             else (value - 4800) / (16383 - 4800)
         elif offset==0x0bdc:       # Flaps control
             numNotchesM1 = len(self.flapsNotches) - 1
@@ -768,5 +768,5 @@
                 self.flapsControl = self.flapsNotches[index]
                 self.flapsControl += (value - index * flapsIncrement) * \
-                    (self.flapsNotches[index+1] - self.flapsNotches[index]) // \
+                    (self.flapsNotches[index+1] - self.flapsNotches[index]) / \
                     flapsIncrement
         elif offset==0x0be0 or offset==0x0be4:    # Flaps left and  right
@@ -816,5 +816,5 @@
         elif offset>=0x1400 and offset<=0x1f40 and \
              ((offset-0x1400)%48)==0: # Payload
-            self.payload[ (offset - 0x1400) // 48 ] = value
+            self.payload[ (offset - 0x1400) / 48 ] = value
         elif offset==0x2000:       # Engine #1 N1
             self.n1[self.ENGINE_1] = value
@@ -840,5 +840,5 @@
         elif offset>=0x3210 and offset<0x3210+Values.HOTKEY_SIZE*4:
             tableOffset = offset - 0x3210
-            hotkeyIndex = tableOffset // 4
+            hotkeyIndex = tableOffset / 4
             index = tableOffset % 4
             if type=="b" or type=="c":
@@ -852,8 +852,8 @@
                     hotkey[3] = (value>>24) & 0xff
                 else:
-                    print("Unhandled offset: %04x for type '%s'" % (offset, type))
+                    print "Unhandled offset: %04x for type '%s'" % (offset, type)
                     raise FSUIPCException(ERR_DATA)
             else:
-                print("Unhandled offset: %04x for type '%s'" % (offset, type))
+                print "Unhandled offset: %04x for type '%s'" % (offset, type)
                 raise FSUIPCException(ERR_DATA)
         elif offset==0x32fa:       # Message duration
@@ -882,5 +882,5 @@
             self.xpdrC = value==0
         else:
-            print("Unhandled offset: %04x" % (offset,))
+            print "Unhandled offset: %04x" % (offset,)
             raise FSUIPCException(ERR_DATA)
 
@@ -1039,5 +1039,5 @@
                 (length,) = struct.unpack("I", clientSocket.recv(4))
                 data = clientSocket.recv(length)
-                (call, args) = pickle.loads(data)
+                (call, args) = cPickle.loads(data)
                 exception = None
 
@@ -1061,14 +1061,14 @@
                     else:
                         break
-                except Exception as e:
+                except Exception, e:
                     exception = e
 
                 if exception is None:
-                    data = pickle.dumps((RESULT_RETURNED, result))
+                    data = cPickle.dumps((RESULT_RETURNED, result))
                 else:
-                    data = pickle.dumps((RESULT_EXCEPTION, str(exception)))
+                    data = cPickle.dumps((RESULT_EXCEPTION, str(exception)))
                 clientSocket.send(struct.pack("I", len(data)) + data)
-        except Exception as e:
-            print("pyuipc_sim.Server._process: failed with exception:", str(e), file=sys.stderr)
+        except Exception, e:
+            print >> sys.stderr, "pyuipc_sim.Server._process: failed with exception:", str(e)
         finally:
             try:
@@ -1112,14 +1112,14 @@
     def quit(self):
         """Quit from the simulator."""
-        data = pickle.dumps((CALL_QUIT, None))
+        data = cPickle.dumps((CALL_QUIT, None))
         self._socket.send(struct.pack("I", len(data)) + data)
 
     def _call(self, command, data):
         """Perform a call with the given command and data."""
-        data = pickle.dumps((command, [data]))
+        data = cPickle.dumps((command, [data]))
         self._socket.send(struct.pack("I", len(data)) + data)
         (length,) = struct.unpack("I", self._socket.recv(4))
         data = self._socket.recv(length)
-        (resultCode, result) = pickle.loads(data)
+        (resultCode, result) = cPickle.loads(data)
         if resultCode==RESULT_RETURNED:
             return result
@@ -1234,5 +1234,5 @@
                                            lambda value: value * 90.0 /
                                            10001750.0 / 65536.0 / 65536.0,
-                                           lambda word: int(float(word) *
+                                           lambda word: long(float(word) *
                                                              10001750.0 *
                                                              65536.0 * 65536.0 / 90.0))
@@ -1240,5 +1240,5 @@
                                             lambda value: value * 360.0 /
                                             65536.0 / 65536.0 / 65536.0 / 65536.0,
-                                            lambda word: int(float(word) *
+                                            lambda word: long(float(word) *
                                                               65536.0 * 65536.0 *
                                                               65536.0 * 65536.0 /
@@ -1300,5 +1300,5 @@
                                            const.FEETTOMETRES / 65536.0 /
                                            65536.0,
-                                           lambda word: int(float(word) *
+                                           lambda word: long(float(word) *
                                                              const.FEETTOMETRES *
                                                              65536.0 * 65536.0))
@@ -1487,5 +1487,5 @@
             self._valueHandlers["hotkey%d" % (i,)] = ([(0x3210 + i*4, "u")],
                                                       lambda value: "0x%08x" % (value,),
-                                                      lambda word: int(word, 16))
+                                                      lambda word: long(word, 16))
 
         self._valueHandlers["cog"] = ([(0x2ef8, "f")], lambda value: value,
@@ -1537,5 +1537,5 @@
         """Handle unhandle commands."""
         if line=="EOF":
-            print()
+            print
             return self.do_quit("")
         else:
@@ -1548,5 +1548,5 @@
         for name in names:
             if name not in self._valueHandlers:
-                print("Unknown variable: " + name, file=sys.stderr)
+                print >> sys.stderr, "Unknown variable: " + name
                 return False
             valueHandler = self._valueHandlers[name]
@@ -1565,10 +1565,10 @@
                                         else thisResults)
 
-                print(name + "=" + str(value))
+                print name + "=" + str(value)
 
                 index += numResults
                 i+=1
-        except Exception as e:
-            print("Failed to read data: " + str(e), file=sys.stderr)
+        except Exception, e:
+            print >> sys.stderr, "Failed to read data: " + str(e)
 
         return False
@@ -1576,5 +1576,5 @@
     def help_get(self):
         """Print help for the get command."""
-        print("get <variable> [<variable>...]")
+        print "get <variable> [<variable>...]"
 
     def complete_get(self, text, line, begidx, endidx):
@@ -1608,10 +1608,10 @@
             words = argument.split("=")
             if len(words)!=2:
-                print("Invalid argument: " + argument, file=sys.stderr)
+                print >> sys.stderr, "Invalid argument: " + argument
                 return False
 
             (name, value) = words
             if name not in self._valueHandlers:
-                print("Unknown variable: " + name, file=sys.stderr)
+                print >> sys.stderr, "Unknown variable: " + name
                 return False
 
@@ -1625,14 +1625,14 @@
                     data.append((offset, type, values[index]))
                     index += 1
-            except Exception as e:
-                print("Invalid value '%s' for variable %s: %s" % \
-                      (value, name, str(e)), file=sys.stderr)
+            except Exception, e:
+                print >> sys.stderr, "Invalid value '%s' for variable %s: %s" % \
+                      (value, name, str(e))
                 return False
 
         try:
             self._client.write(data)
-            print("Data written")
-        except Exception as e:
-            print("Failed to write data: " + str(e), file=sys.stderr)
+            print "Data written"
+        except Exception, e:
+            print >> sys.stderr, "Failed to write data: " + str(e)
 
         return False
@@ -1640,5 +1640,5 @@
     def help_set(self):
         """Print help for the set command."""
-        print("set <variable>=<value> [<variable>=<value>...]")
+        print "set <variable>=<value> [<variable>=<value>...]"
 
     def complete_set(self, text, line, begidx, endidx):
@@ -1654,12 +1654,12 @@
             value = int(args)
             self._client.setVersion(value)
-            print("Emulating version %d" % (value,))
-        except Exception as e:
-            print("Failed to set the version: " + str(e), file=sys.stderr)
+            print "Emulating version %d" % (value,)
+        except Exception, e:
+            print >> sys.stderr, "Failed to set the version: " + str(e)
 
     def help_setversion(self, usage = False):
         """Help for the setversion command"""
-        if usage: print("Usage:", end=' ')
-        print("setversion <number>")
+        if usage: print "Usage:",
+        print "setversion <number>"
 
     def do_close(self, args):
@@ -1667,7 +1667,7 @@
         try:
             self._client.close()
-            print("Connection closed")
-        except Exception as e:
-            print("Failed to close the connection: " + str(e), file=sys.stderr)
+            print "Connection closed"
+        except Exception, e:
+            print >> sys.stderr, "Failed to close the connection: " + str(e)
 
     def do_failopen(self, args):
@@ -1676,12 +1676,12 @@
             value = self.str2bool(args)
             self._client.failOpen(value)
-            print("Opening will%s fail" % ("" if value else " not",))
-        except Exception as e:
-            print("Failed to set open failure: " + str(e), file=sys.stderr)
+            print "Opening will%s fail" % ("" if value else " not",)
+        except Exception, e:
+            print >> sys.stderr, "Failed to set open failure: " + str(e)
 
     def help_failopen(self, usage = False):
         """Help for the failopen command"""
-        if usage: print("Usage:", end=' ')
-        print("failopen yes|no")
+        if usage: print "Usage:",
+        print "failopen yes|no"
 
     def complete_failopen(self, text, line, begidx, endidx):
Index: src/mlx/rpc.py
===================================================================
--- src/mlx/rpc.py	(revision 928)
+++ src/mlx/rpc.py	(revision 889)
@@ -1,6 +1,6 @@
-from . import const
-from . import rpccommon
-
-from .common import MAVA_BASE_URL
+import const
+import rpccommon
+
+from common import MAVA_BASE_URL
 
 import jsonrpclib
@@ -28,5 +28,5 @@
         For all other names, the value will be stored as the same-named
         attribute."""
-        for (key, value) in value.items():
+        for (key, value) in value.iteritems():
             if key in instructions:
                 instruction = instructions[key]
@@ -37,6 +37,6 @@
                     value = instruction(value)
                 except:
-                    print("Failed to convert value '%s' of attribute '%s':" % \
-                        (value, key), file=sys.stderr)
+                    print >> sys.stderr, "Failed to convert value '%s' of attribute '%s':" % \
+                        (value, key)
                     import traceback
                     traceback.print_exc()
@@ -111,12 +111,9 @@
                 cs1 = int(self.callsign[2:])
                 cs2 = int(other.callsign[2:])
-                return 0 if cs1==cs2 else -1 if cs1<cs2 else 1
+                return cmp(cs1, cs2)
             except:
-                return 0 if self.callsign==other.callsign \
-                    else -1 if self.callsign<other.callsign else 1
+                return cmp(self.callsign, other.callsign)
         else:
-            v1 = getattr(self, name)
-            v2 = getattr(other, name)
-            return 0 if v1==v2 else -1 if v1<v2 else 1
+            return cmp(getattr(self, name), getattr(other, name))
 
     def __repr__(self):
@@ -169,5 +166,6 @@
                 flightPairs.append(ScheduledFlightPair(flight))
 
-        flightPairs.sort(key = lambda pair: pair.flight0.date)
+        flightPairs.sort(cmp = lambda pair1, pair2:
+                         cmp(pair1.flight0.date, pair2.flight0.date))
 
         return flightPairs
@@ -299,26 +297,26 @@
     def writeIntoFile(self, f):
         """Write the flight into a file."""
-        print("callsign=%s" % (self.callsign,), file=f)
+        print >> f, "callsign=%s" % (self.callsign,)
         date = self.departureTime.date()
-        print("date=%04d-%02d-%0d" % (date.year, date.month, date.day), file=f)
-        print("dep_airport=%s" % (self.departureICAO,), file=f)
-        print("dest_airport=%s" % (self.arrivalICAO,), file=f)
-        print("planecode=%s" % \
-              (BookedFlight.TYPE2TYPECODE[self.aircraftType],), file=f)
-        print("planetype=%s" % (self.aircraftTypeName,), file=f)
-        print("tail_nr=%s" % (self.tailNumber,), file=f)
-        print("passenger=%d" % (self.numPassengers,), file=f)
-        print("crew=%d" % (self.numCrew,), file=f)
-        print("bag=%d" % (self.bagWeight,), file=f)
-        print("cargo=%d" % (self.cargoWeight,), file=f)
-        print("mail=%d" % (self.mailWeight,), file=f)
-        print("flight_route=%s" % (self.route,), file=f)
+        print >> f, "date=%04d-%02d-%0d" % (date.year, date.month, date.day)
+        print >> f, "dep_airport=%s" % (self.departureICAO,)
+        print >> f, "dest_airport=%s" % (self.arrivalICAO,)
+        print >> f, "planecode=%s" % \
+              (BookedFlight.TYPE2TYPECODE[self.aircraftType],)
+        print >> f, "planetype=%s" % (self.aircraftTypeName,)
+        print >> f, "tail_nr=%s" % (self.tailNumber,)
+        print >> f, "passenger=%d" % (self.numPassengers,)
+        print >> f, "crew=%d" % (self.numCrew,)
+        print >> f, "bag=%d" % (self.bagWeight,)
+        print >> f, "cargo=%d" % (self.cargoWeight,)
+        print >> f, "mail=%d" % (self.mailWeight,)
+        print >> f, "flight_route=%s" % (self.route,)
         departureTime = self.departureTime
-        print("departure_time=%02d\\:%02d\\:%02d" % \
-              (departureTime.hour, departureTime.minute, departureTime.second), file=f)
+        print >> f, "departure_time=%02d\\:%02d\\:%02d" % \
+              (departureTime.hour, departureTime.minute, departureTime.second)
         arrivalTime = self.arrivalTime
-        print("arrival_time=%02d\\:%02d\\:%02d" % \
-              (arrivalTime.hour, arrivalTime.minute, arrivalTime.second), file=f)
-        print("foglalas_id=%s" % ("0" if self.id is None else self.id,), file=f)
+        print >> f, "arrival_time=%02d\\:%02d\\:%02d" % \
+              (arrivalTime.hour, arrivalTime.minute, arrivalTime.second)
+        print >> f, "foglalas_id=%s" % ("0" if self.id is None else self.id,)
 
 #---------------------------------------------------------------------------------------
@@ -470,5 +468,5 @@
 
         md5 = hashlib.md5()
-        md5.update(password.encode("utf-8"))
+        md5.update(password)
         self._passwordHash = md5.hexdigest()
 
@@ -525,5 +523,6 @@
 
         for flights in [bookedFlights, reportedFlights, rejectedFlights]:
-            flights.sort(key = lambda flight: flight.departureTime)
+            flights.sort(cmp = lambda flight1, flight2:
+                         cmp(flight1.departureTime, flight2.departureTime))
 
         return (bookedFlights, reportedFlights, rejectedFlights)
Index: src/mlx/rpccommon.py
===================================================================
--- src/mlx/rpccommon.py	(revision 919)
+++ src/mlx/rpccommon.py	(revision 742)
@@ -3,5 +3,5 @@
 #------------------------------------------------------------------------------
 
-from . import const
+import const
 
 #------------------------------------------------------------------------------
@@ -51,5 +51,5 @@
         """Check if the gate of the given plane conflicts with another plane's
         position."""
-        for p in self._planes.values():
+        for p in self._planes.itervalues():
             if p.tailNumber!=plane.tailNumber and \
                p.status==const.PLANE_HOME and \
@@ -62,5 +62,5 @@
         """Get a set containing the numbers of the gates occupied by planes."""
         gateNumbers = set()
-        for p in self._planes.values():
+        for p in self._planes.itervalues():
             if p.status==const.PLANE_HOME and p.gateNumber:
                 gateNumbers.add(p.gateNumber)
@@ -80,5 +80,5 @@
     def __iter__(self):
         """Get an iterator over the planes."""
-        for plane in self._planes.values():
+        for plane in self._planes.itervalues():
             yield plane
 
Index: src/mlx/singleton.py
===================================================================
--- src/mlx/singleton.py	(revision 919)
+++ src/mlx/singleton.py	(revision 401)
@@ -1,4 +1,4 @@
 
-from .util import utf2unicode
+from util import utf2unicode
 
 import os
@@ -59,8 +59,8 @@
                         break
 
-                    print("singleton._PipeServer.run: created the pipe")
+                    print "singleton._PipeServer.run: created the pipe"
                     try:
                         if win32pipe.ConnectNamedPipe(handle)==0:
-                            print("singleton._PipeServer.run: client connection received")
+                            print "singleton._PipeServer.run: client connection received"
                             (code, message) = \
                                 win32file.ReadFile(handle,
@@ -69,17 +69,17 @@
 
                             if code==0:
-                                print("singleton._PipeServer.run: message received from client")
+                                print "singleton._PipeServer.run: message received from client"
                                 self._raiseCallback()
                             else:
-                                print("singleton._PipeServer.run: failed to read from the pipe")
-                    except Exception as e:
-                        print("singleton._PipeServer.run: exception:", end=' ')
-                        print(utf2unicode(str(e)))
+                                print "singleton._PipeServer.run: failed to read from the pipe"
+                    except Exception, e:
+                        print "singleton._PipeServer.run: exception:",
+                        print utf2unicode(str(e))
                     finally:
                         win32pipe.DisconnectNamedPipe(handle)
                         win32file.CloseHandle(handle)
-            except Exception as e:
-                print("singleton._PipeServer.run: fatal exception:", end=' ')
-                print(utf2unicode(str(e)))
+            except Exception, e:
+                print "singleton._PipeServer.run: fatal exception:",
+                print utf2unicode(str(e))
                             
         def _createPipe(self):
@@ -96,5 +96,5 @@
                                                None)
             if handle==win32file.INVALID_HANDLE_VALUE:
-                print("singleton._PipeServer.run: could not create the handle")
+                print "singleton._PipeServer.run: could not create the handle"
                 return None
             else:
@@ -144,10 +144,10 @@
                     f.close()
                     return
-                except Exception as e:
-                    print("SingleInstance._notifySingleton: failed:", end=' ')
-                    print(utf2unicode(str(e)))
+                except Exception, e:
+                    print "SingleInstance._notifySingleton: failed:",
+                    print utf2unicode(str(e))
                     time.sleep(0.5)
         
-        def __bool__(self):
+        def __nonzero__(self):
             """Return a boolean representation of the object.
 
@@ -194,7 +194,7 @@
                     s.recv(64)
                     self._raiseCallback()
-            except Exception as e:
-                print("singleton._SocketServer.run: fatal exception:", end=' ')
-                print(utf2unicode(str(e)))
+            except Exception, e:
+                print "singleton._SocketServer.run: fatal exception:",
+                print utf2unicode(str(e))
     
     class SingleInstance(object):
@@ -218,5 +218,5 @@
                 fcntl.lockf(self._lockFile, fcntl.LOCK_EX | fcntl.LOCK_NB)
                 self._isSingle = True
-            except Exception as e:
+            except Exception, e:
                 self._lockFile.close()
                 self._lockFile = None
@@ -259,10 +259,10 @@
                     s.close()
                     return
-                except Exception as e:
-                    print("singleton.SingleInstance._notifySingleton: failed:", end=' ')
-                    print(utf2unicode(str(e)))
+                except Exception, e:
+                    print "singleton.SingleInstance._notifySingleton: failed:",
+                    print utf2unicode(str(e))
                     time.sleep(0.5)
 
-        def __bool__(self):
+        def __nonzero__(self):
             """Return a boolean representation of the object.
 
@@ -299,11 +299,11 @@
 if __name__=="__main__":
     def raiseCallback():
-        print("Raise the window!")
+        print "Raise the window!"
 
     instance = SingleInstance("mlx", raiseCallback)
     if instance:
-        print("The first instance")
+        print "The first instance"
         time.sleep(10)
     else:
-        print("The program is already running.")
-
+        print "The program is already running."
+
Index: src/mlx/sound.py
===================================================================
--- src/mlx/sound.py	(revision 919)
+++ src/mlx/sound.py	(revision 800)
@@ -1,4 +1,4 @@
 
-from .util import utf2unicode
+from util import utf2unicode
 
 import os
@@ -113,10 +113,10 @@
                     success = True
                     try:
-                        print("Closing", alias)
+                        print "Closing", alias
                         self._mci.send("close " + alias)
-                        print("Closed", alias)
-                    except Exception as e:
-                        print("Failed closing " + alias + ":", end=' ')
-                        print(utf2unicode(str(e)))
+                        print "Closed", alias
+                    except Exception, e:
+                        print "Failed closing " + alias + ":",
+                        print utf2unicode(str(e))
                         success = False
 
@@ -130,5 +130,5 @@
                     try:
                         alias = "mlxsound%d" % (counter,)
-                        print("Starting to play", path, "as", alias)
+                        print "Starting to play", path, "as", alias
                         self._mci.send("open \"%s\" alias %s" % \
                                        (path, alias))
@@ -144,8 +144,8 @@
                             self._pending.append((timeout, (alias, finishData)))
                             self._pending.sort()
-                        print("Started to play", path)
-                    except Exception as e:
-                        print("Failed to start playing " + path + ":", end=' ')
-                        print(utf2unicode(str(e)))
+                        print "Started to play", path
+                    except Exception, e:
+                        print "Failed to start playing " + path + ":",
+                        print utf2unicode(str(e))
                         (finishCallback, extra) = finishData
                         if finishCallback is not None:
@@ -220,5 +220,5 @@
 
             Gst.init(None)
-        except Exception as e:
+        except Exception, e:
             outQueue.put(False)
             outQueue.put(e)
@@ -351,6 +351,6 @@
         else:
             exception = _inQueue.get()
-            print("The Gst library is missing from your system. It is needed for sound playback on Linux:")
-            print(exception)
+            print "The Gst library is missing from your system. It is needed for sound playback on Linux:"
+            print exception
 
     def startSound(name, finishCallback = None, extra = None):
@@ -387,5 +387,5 @@
 
     def callback(result, extra):
-        print("callback", result, extra)
+        print "callback", result, extra
 
     preInitializeSound()
@@ -393,5 +393,5 @@
     soundsPath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                               "..", "..", "sounds"))
-    print("soundsPath:", soundsPath)
+    print "soundsPath:", soundsPath
     initializeSound(soundsPath)
     startSound("notam.mp3", finishCallback = callback, extra= "notam.mp3")
Index: src/mlx/soundsched.py
===================================================================
--- src/mlx/soundsched.py	(revision 919)
+++ src/mlx/soundsched.py	(revision 352)
@@ -1,6 +1,6 @@
 
-from .sound import startSound
-from . import const
-from . import fs
+from sound import startSound
+import const
+import fs
 
 import threading
@@ -64,7 +64,7 @@
         """Called when the playback of thee sound has finished (or failed)."""
         if success is None:
-            print("Failed to start sound", self._name)
+            print "Failed to start sound", self._name
         elif not success:
-            print("Failed to finish sound", self._name)
+            print "Failed to finish sound", self._name
         with Sound._lock:            
             self._playing -= 1
Index: src/mlx/test.py
===================================================================
--- src/mlx/test.py	(revision 919)
+++ src/mlx/test.py	(revision 27)
@@ -1,9 +1,9 @@
 # Test module
 
-from . import fs
-from . import flight
-from . import logger
-from . import acft
-from . import const
+import fs
+import flight
+import logger
+import acft
+import const
 
 import time
@@ -11,5 +11,5 @@
 
 def callback(data, extra):
-    print(data)
+    print data
 
 def main():
Index: src/mlx/update.py
===================================================================
--- src/mlx/update.py	(revision 950)
+++ src/mlx/update.py	(revision 788)
@@ -1,9 +1,9 @@
 
-from .config import Config
-from .util import utf2unicode
+from config import Config
+from util import utf2unicode
 
 import os
 import sys
-import urllib.request, urllib.error, urllib.parse
+import urllib2
 import tempfile
 import socket
@@ -11,5 +11,4 @@
 import hashlib
 import traceback
-import io
 
 if os.name=="nt":
@@ -58,5 +57,5 @@
 
         Each file is returned as a 3-tuple with items as in the file."""
-        for (path, (size, sum)) in self._files.items():
+        for (path, (size, sum)) in self._files.iteritems():
             yield (path, size, sum)
 
@@ -100,5 +99,5 @@
     def writeInto(self, file):
         """Write the manifest into the file at the given path."""
-        for (path, (size, sum)) in self._files.items():
+        for (path, (size, sum)) in self._files.iteritems():
             file.write("%s\t%d\t%s\n" % (path, size, sum))
 
@@ -120,11 +119,5 @@
                 modifiedAndNew.append((path, otherSize, otherSum))
 
-        if os.name=="nt":
-            otherFiles = [path.lower() for path in other._files]
-        else:
-            otherFiles = other._files
-
-        removed = [path for path in self._files if
-                   (path.lower() if os.name=="nt" else path) not in otherFiles]
+        removed = [path for path in self._files if path not in other._files]
         
         return (modifiedAndNew, removed)
@@ -202,5 +195,5 @@
     def _send(self, words):
         """Send the given words via the socket."""
-        self._sock.send(bytes("\t".join(words) + "\n", "utf-8"))
+        self._sock.send("\t".join(words) + "\n")
 
 #------------------------------------------------------------------------------
@@ -214,6 +207,6 @@
         with open(manifestPath, "rt") as f:
             manifest.readFrom(f)
-    except Exception as e:
-        print("Error reading the manifest, ignoring:", utf2unicode(str(e)))
+    except Exception, e:
+        print "Error reading the manifest, ignoring:", utf2unicode(str(e))
         manifest = Manifest()
 
@@ -233,12 +226,10 @@
     try:
         updateManifest = Manifest()
-        reply = urllib.request.urlopen(updateURL + "/" + manifestName)
-        charset = reply.headers.get_content_charset()
-        content = reply.read().decode("utf-8" if charset is None else charset)
-        updateManifest.readFrom(io.StringIO(content))
-
-    except Exception as e:
+        f= urllib2.urlopen(updateURL + "/" + manifestName)
+        updateManifest.readFrom(f)
+
+    except Exception, e:
         error = utf2unicode(str(e))
-        print("Error downloading manifest:", error, file=sys.stderr)
+        print >> sys.stderr, "Error downloading manifest:", error
         listener.failed(error)
         return None
@@ -299,5 +290,5 @@
         try:
             sum = hashlib.md5()
-            sum.update(bytes(path, "utf-8"))
+            sum.update(path)
             toremoveDir = getToremoveDir(toremoveDir, directory)
             targetPath = os.path.join(toremoveDir, sum.hexdigest())
@@ -307,6 +298,6 @@
                 pass
             os.rename(path, targetPath)
-        except Exception as e:
-            print("Cannot remove file " + path + ": " + utf2unicode(str(e)))
+        except Exception, e:
+            print "Cannot remove file " + path + ": " + utf2unicode(str(e))
 
 #------------------------------------------------------------------------------
@@ -364,9 +355,9 @@
 
             targetDirectory = os.path.dirname(targetFile)
-            if targetDirectory and not os.path.isdir(targetDirectory):
+            if not os.path.isdir(targetDirectory):
                 os.makedirs(targetDirectory)
                 
             with open(targetFile, "wb") as fout:
-                fin = urllib.request.urlopen(updateURL + "/" + path)
+                fin = urllib2.urlopen(updateURL + "/" + path)
                 while True:
                     data = fin.read(4096)
@@ -400,10 +391,10 @@
         
         listener.done()
-    except Exception as e:
+    except Exception, e:
         exc = traceback.format_exc()
-        print(utf2unicode(exc), file=sys.stderr)
+        print >> sys.stderr, utf2unicode(exc)
         
         error = utf2unicode(str(e))
-        print("Error:", error, file=sys.stderr)
+        print >> sys.stderr, "Error:", error
 
         listener.failed(error)
@@ -418,5 +409,5 @@
         f.close()
         return True
-    except Exception as e:
+    except Exception, e:
         return False
     finally:
@@ -448,8 +439,8 @@
                 listener.downloadedManifest()
             elif command=="setTotalSize":
-                listener.setTotalSize(int(words[1]), int(words[2]),
+                listener.setTotalSize(int(words[1]), long(words[2]),
                                       int(words[3]), int(words[4]))
             elif command=="setDownloaded":
-                listener.setDownloaded(int(words[1]))
+                listener.setDownloaded(long(words[1]))
             elif command=="startRenaming":
                 listener.startRenaming()
@@ -466,7 +457,7 @@
             elif command=="failed":
                 listener.failed(words[1])
-        except Exception as e:
-            print("Failed to parse line '%s': %s" % \
-                  (line, utf2unicode(str(e))), file=sys.stderr)
+        except Exception, e:
+            print >> sys.stderr, "Failed to parse line '%s': %s" % \
+                  (line, utf2unicode(str(e)))
 
     return buffer
@@ -514,5 +505,5 @@
                 break;
 
-            buffer += str(data, "utf-8")
+            buffer += data
             buffer = processMLXUpdate(buffer, listener)
 
@@ -523,7 +514,7 @@
             process.wait()
         
-    except Exception as e:
+    except Exception, e:
         error = utf2unicode(str(e))
-        print("Failed updating:", error, file=sys.stderr)
+        print >> sys.stderr, "Failed updating:", error
         listener.failed(error)
     finally:
@@ -572,10 +563,10 @@
             updateFiles(directory, updateURL, listener, updateManifest,
                         modifiedAndNew, removed, localRemoved)
-    except Exception as e:
+    except Exception, e:
         exc = traceback.format_exc()
-        print(utf2unicode(exc), file=sys.stderr)
+        print >> sys.stderr, utf2unicode(exc)
         
         error = utf2unicode(str(e))
-        print("Update error:", error, file=sys.stderr)
+        print >> sys.stderr, "Update error:", error
         
         listener.failed(error)
@@ -605,5 +596,5 @@
     except:
         exc = traceback.format_exc()
-        print(utf2unicode(exc), file=sys.stderr)
+        print >> sys.stderr, utf2unicode(exc)
 
 #------------------------------------------------------------------------------
Index: src/mlx/util.py
===================================================================
--- src/mlx/util.py	(revision 929)
+++ src/mlx/util.py	(revision 784)
@@ -43,7 +43,7 @@
 #------------------------------------------------------------------------------
 
-def getCoordinateString(xxx_todo_changeme):
+def getCoordinateString((latitude, longitude)):
     """Get the string representation of the given coordinate pair."""
-    (latitude, longitude) = xxx_todo_changeme
+
     latitude_str = getLatitudeString(latitude)
     longitude_str = getLongitudeString(longitude)
@@ -79,5 +79,5 @@
     (deg, min, sec, _sign) = getDegMinSec(degree)
 
-    return "%s%d\u00b0%02d\u2032%02d\u2033" % (prefix, deg, min, sec)
+    return u"%s%d\u00b0%02d\u2032%02d\u2033" % (prefix, deg, min, sec)
 
 #------------------------------------------------------------------------------
@@ -174,18 +174,9 @@
 def utf2unicode(text):
     """Convert the given text from UTF-8 encoding to unicode."""
-    if isinstance(text, str):
-        if text.startswith("list indices must be"):
-            import traceback
-            traceback.print_exc()
-
-        return text
-
     try:
-        return str(_utf8decoder(text)[0])
+        return unicode(_utf8decoder(text)[0])
     except:
-        import traceback
-        traceback.print_exc()
         try:
-            return str(_latin2decoder(text)[0])
+            return unicode(_latin2decoder(text)[0])
         except:
-            return str(list(text))
+            return unicode(list(text))
Index: src/mlx/watchdog.py
===================================================================
--- src/mlx/watchdog.py	(revision 919)
+++ src/mlx/watchdog.py	(revision 535)
@@ -60,7 +60,7 @@
 
         if logTimeout:
-            print("Watchdog client %s has timed out!" % (self._name))
+            print "Watchdog client %s has timed out!" % (self._name)
         elif logCleared:
-            print("Watchdog client %s has been cleared." % (self._name))
+            print "Watchdog client %s has been cleared." % (self._name)
 
 #-----------------------------------------------------------------------------
@@ -115,5 +115,5 @@
 
             if t>=nextLogTime:
-                print("Watchdog.run: running")
+                print "Watchdog.run: running"
                 while t>=nextLogTime:
                     nextLogTime += self.LOG_INTERVAL
Index: src/mlx/web.py
===================================================================
--- src/mlx/web.py	(revision 930)
+++ src/mlx/web.py	(revision 859)
@@ -1,25 +1,24 @@
 
-from . import const
-from . import util
-from .rpc import Registration
-from . import rpc
-from . import rpccommon
-
-from .common import MAVA_BASE_URL
-from .pirep import PIREP
+import const
+import util
+from rpc import Registration
+import rpc
+import rpccommon
+
+from common import MAVA_BASE_URL
+from pirep import PIREP
 
 import threading
 import sys
-import urllib.request, urllib.parse, urllib.error
-import urllib.request, urllib.error, urllib.parse
+import urllib
+import urllib2
 import hashlib
 import time
-import re
 import datetime
 import codecs
 import traceback
 import xml.sax
-import xmlrpc.client
-import html.parser
+import xmlrpclib
+import HTMLParser
 
 #---------------------------------------------------------------------------------------
@@ -161,5 +160,5 @@
 
         date = readline(f)
-        print("web.BookedFlight.readFromWeb: date:", date)
+        print "web.BookedFlight.readFromWeb: date:", date
         if date=="0000-00-00": date = "0001-01-01"
 
@@ -234,6 +233,6 @@
 
                 if not lineOK:
-                    print("web.BookedFlight.readFromFile: line %d is invalid" % \
-                          (lineNumber,))
+                    print "web.BookedFlight.readFromFile: line %d is invalid" % \
+                          (lineNumber,)
 
             line = f.readline()
@@ -291,26 +290,26 @@
     def writeIntoFile(self, f):
         """Write the flight into a file."""
-        print("callsign=%s" % (self.callsign,), file=f)
+        print >> f, "callsign=%s" % (self.callsign,)
         date = self.departureTime.date()
-        print("date=%04d-%02d-%0d" % (date.year, date.month, date.day), file=f)
-        print("dep_airport=%s" % (self.departureICAO,), file=f)
-        print("dest_airport=%s" % (self.arrivalICAO,), file=f)
-        print("planecode=%s" % \
-              (BookedFlight.TYPE2TYPECODE[self.aircraftType],), file=f)
-        print("planetype=%s" % (self.aircraftTypeName,), file=f)
-        print("tail_nr=%s" % (self.tailNumber,), file=f)
-        print("passenger=%d" % (self.numPassengers,), file=f)
-        print("crew=%d" % (self.numCrew,), file=f)
-        print("bag=%d" % (self.bagWeight,), file=f)
-        print("cargo=%d" % (self.cargoWeight,), file=f)
-        print("mail=%d" % (self.mailWeight,), file=f)
-        print("flight_route=%s" % (self.route,), file=f)
+        print >> f, "date=%04d-%02d-%0d" % (date.year, date.month, date.day)
+        print >> f, "dep_airport=%s" % (self.departureICAO,)
+        print >> f, "dest_airport=%s" % (self.arrivalICAO,)
+        print >> f, "planecode=%s" % \
+              (BookedFlight.TYPE2TYPECODE[self.aircraftType],)
+        print >> f, "planetype=%s" % (self.aircraftTypeName,)
+        print >> f, "tail_nr=%s" % (self.tailNumber,)
+        print >> f, "passenger=%d" % (self.numPassengers,)
+        print >> f, "crew=%d" % (self.numCrew,)
+        print >> f, "bag=%d" % (self.bagWeight,)
+        print >> f, "cargo=%d" % (self.cargoWeight,)
+        print >> f, "mail=%d" % (self.mailWeight,)
+        print >> f, "flight_route=%s" % (self.route,)
         departureTime = self.departureTime
-        print("departure_time=%02d\\:%02d\\:%02d" % \
-              (departureTime.hour, departureTime.minute, departureTime.second), file=f)
+        print >> f, "departure_time=%02d\\:%02d\\:%02d" % \
+              (departureTime.hour, departureTime.minute, departureTime.second)
         arrivalTime = self.arrivalTime
-        print("arrival_time=%02d\\:%02d\\:%02d" % \
-              (arrivalTime.hour, arrivalTime.minute, arrivalTime.second), file=f)
-        print("foglalas_id=%s" % ("0" if self.id is None else self.id,), file=f)
+        print >> f, "arrival_time=%02d\\:%02d\\:%02d" % \
+              (arrivalTime.hour, arrivalTime.minute, arrivalTime.second)
+        print >> f, "foglalas_id=%s" % ("0" if self.id is None else self.id,)
 
     def _readAircraftType(self, f):
@@ -365,5 +364,5 @@
 
         except:
-            print("Plane string is invalid: '" + s + "'", file=sys.stderr)
+            print >> sys.stderr, "Plane string is invalid: '" + s + "'"
             self.tailNumber = None
 
@@ -471,9 +470,9 @@
 #------------------------------------------------------------------------------
 
-class PilotsWebNOTAMsParser(html.parser.HTMLParser):
+class PilotsWebNOTAMsParser(HTMLParser.HTMLParser):
     """XML handler for the NOTAM query results on the PilotsWeb website."""
     def __init__(self):
         """Construct the handler."""
-        html.parser.HTMLParser.__init__(self)
+        HTMLParser.HTMLParser.__init__(self)
 
         self._notams = []
@@ -514,9 +513,9 @@
         try:
             notam = self._parseCurrentNOTAM2()
-        except Exception as e:
-            print("Error parsing current NOTAM: " + str(e))
+        except Exception, e:
+            print "Error parsing current NOTAM: " + str(e)
 
         if notam is None:
-            print("Could not parse NOTAM: " + self._currentNOTAM)
+            print "Could not parse NOTAM: " + self._currentNOTAM
             if self._currentNOTAM:
                 self._notams.append(self._currentNOTAM + "\n")
@@ -527,5 +526,5 @@
         """Parse the current NOTAM, if possible, and return a NOTAM object."""
         lines = self._currentNOTAM.splitlines()
-        lines = [line.strip() for line in lines]
+        lines = map(lambda line: line.strip(), lines)
 
         if len(lines)<4:
@@ -579,9 +578,6 @@
     def _parseCurrentNOTAM2(self):
         """Parse the current NOTAM with a second, more flexible method."""
-        self._currentNOTAM = self._currentNOTAM.replace("\\n", "\n")
         lines = self._currentNOTAM.splitlines()
-        if len(lines)==1:
-            lines = lines[0].splitlines()
-        lines = [line.strip() for line in lines]
+        lines = map(lambda line: line.strip(), lines)
 
         if not lines:
@@ -596,5 +592,5 @@
                 lines = lines[:-1]
 
-        lines = [line.strip() for line in lines]
+        lines = map(lambda line: line.strip(), lines)
         contents = " ".join(lines).split()
 
@@ -618,5 +614,4 @@
 
         def parseTime(item):
-            item = re.sub("([0-9]+).*", "\\1", item)
             try:
                 return datetime.datetime.strptime(item, "%y%m%d%H%M")
@@ -658,6 +653,6 @@
         """Get a representation of the result."""
         s = "<Result:"
-        for (key, value) in self.__dict__.items():
-            s += " " + key + "=" + str(value)
+        for (key, value) in self.__dict__.iteritems():
+            s += " " + key + "=" + unicode(value)
         s += ">"
         return s
@@ -693,5 +688,5 @@
             result = self.run()
             returned = True
-        except Exception as e:
+        except Exception, e:
             traceback.print_exc()
             result = e
@@ -700,6 +695,6 @@
         try:
             self._callback(returned, result)
-        except Exception as e:
-            print("web.Handler.Request.perform: callback throwed an exception: " + util.utf2unicode(str(e)), file=sys.stderr)
+        except Exception, e:
+            print >> sys.stderr, "web.Handler.Request.perform: callback throwed an exception: " + util.utf2unicode(str(e))
             #traceback.print_exc()
 
@@ -774,5 +769,5 @@
         result = Result()
 
-        f = urllib.request.urlopen(url, timeout = 10.0)
+        f = urllib2.urlopen(url, timeout = 10.0)
 
         status = readline(f)
@@ -796,5 +791,7 @@
                 result.flights.append(flight)
 
-            result.flights.sort(key = lambda flight: flight.departureTime)
+            result.flights.sort(cmp = lambda flight1, flight2:
+                                cmp(flight1.departureTime,
+                                    flight2.departureTime))
 
         f.close()
@@ -883,5 +880,5 @@
         url = MAVA_BASE_URL + "/onlinegates_get.php"
 
-        f = urllib.request.urlopen(url, timeout = 10.0)
+        f = urllib2.urlopen(url, timeout = 10.0)
         result = Result()
         result.fleet = Fleet(f)
@@ -925,9 +922,9 @@
         gateNumber = self._gateNumber if self._gateNumber else ""
 
-        data = urllib.parse.urlencode([("lajstrom", self._tailNumber),
+        data = urllib.urlencode([("lajstrom", self._tailNumber),
                                  ("status", status),
                                  ("kapu", gateNumber)])
 
-        f = urllib.request.urlopen(url, data, timeout = 10.0)
+        f = urllib2.urlopen(url, data, timeout = 10.0)
         line = readline(f)
 
@@ -986,5 +983,5 @@
             url = "http://notams.euroutepro.com/notams.xml"
 
-            f = urllib.request.urlopen(url, timeout = 10.0)
+            f = urllib2.urlopen(url, timeout = 10.0)
             try:
                 xmlParser.parse(f)
@@ -1015,9 +1012,9 @@
               (icao.upper(),)
 
-            f = urllib.request.urlopen(url, timeout = 10.0)
+            f = urllib2.urlopen(url, timeout = 10.0)
             try:
                 data = f.read(16384)
                 while data:
-                    parser.feed(str(data))
+                    parser.feed(data)
                     data = f.read(16384)
             finally:
@@ -1026,8 +1023,8 @@
             return parser.getNOTAMs()
 
-        except Exception as e:
+        except Exception, e:
             traceback.print_exc()
-            print("mlx.web.GetNOTAMs.getPilotsWebNOTAMs: failed to get NOTAMs for '%s': %s" % \
-                  (icao, str(e)))
+            print "mlx.web.GetNOTAMs.getPilotsWebNOTAMs: failed to get NOTAMs for '%s': %s" % \
+                  (icao, str(e))
             return None
 
@@ -1045,5 +1042,5 @@
         """Perform the retrieval opf the METARs."""
         url = "http://www.aviationweather.gov/adds/dataserver_current/httpparam?"
-        data = urllib.parse.urlencode([ ("dataSource" , "metars"),
+        data = urllib.urlencode([ ("dataSource" , "metars"),
                                   ("requestType",  "retrieve"),
                                   ("format", "csv"),
@@ -1052,10 +1049,9 @@
                                   ("mostRecentForEachStation", "constraint")])
         url += data
-        f = urllib.request.urlopen(url, timeout = 10.0)
+        f = urllib2.urlopen(url, timeout = 10.0)
         try:
             result = Result()
             result.metars = {}
-            for line in f.readlines():
-                line = str(line, "iso-8859-1")
+            for line in iter(f.readline, ""):
                 if len(line)>5 and line[4]==' ':
                     icao = line[0:4]
@@ -1132,10 +1128,10 @@
         data["insdate"] = datetime.date.today().strftime("%Y-%m-%d")
 
-        postData = urllib.parse.urlencode(data)
-        f = urllib.request.urlopen(url, postData, timeout = 10.0)
+        postData = urllib.urlencode(data)
+        f = urllib2.urlopen(url, postData, timeout = 10.0)
         try:
             result = Result()
             line = f.readline().strip()
-            print("PIREP result from website:", line)
+            print "PIREP result from website:", line
             result.success = line=="OK"
             result.alreadyFlown = line=="MARVOLT"
@@ -1182,5 +1178,5 @@
     def run(self):
         """Perform the sending of the ACARS."""
-        print("Sending the online ACARS")
+        print "Sending the online ACARS"
 
         url = MAVA_BASE_URL  + "/acars2/acarsonline.php"
@@ -1208,5 +1204,5 @@
         data["event"] = acars.getEventText()
 
-        f = urllib.request.urlopen(url, urllib.parse.urlencode(data), timeout = 10.0)
+        f = urllib2.urlopen(url, urllib.urlencode(data), timeout = 10.0)
         try:
             result = Result()
@@ -1227,5 +1223,5 @@
     def run(self):
         """Perform the sending of the ACARS."""
-        print("Sending the online ACARS via JSON-RPC")
+        print "Sending the online ACARS via JSON-RPC"
 
         self._client.updateOnlineACARS(self._acars)
@@ -1247,5 +1243,5 @@
     def run(self):
         """Perform the sending of the bug report."""
-        serverProxy = xmlrpc.client.ServerProxy("http://mlx.varadiistvan.hu/rpc")
+        serverProxy = xmlrpclib.ServerProxy("http://mlx.varadiistvan.hu/rpc")
 
         result = Result()
@@ -1258,5 +1254,5 @@
         result.ticketID = serverProxy.ticket.create(self._summary, self._description,
                                                     attributes, True)
-        print("Created ticket with ID:", result.ticketID)
+        print "Created ticket with ID:", result.ticketID
         result.success = True
 
@@ -1292,5 +1288,5 @@
 
         pirepData = self._client.getPIREP(self._flightID)
-        print("pirepData:", pirepData)
+        print "pirepData:", pirepData
 
         bookedFlight = BookedFlight(self._flightID)
@@ -1516,5 +1512,5 @@
 
     def callback(returned, result):
-        print(returned, str(result))
+        print returned, unicode(result)
 
     handler = Handler()
Index: src/mlx/xplane.py
===================================================================
--- src/mlx/xplane.py	(revision 921)
+++ src/mlx/xplane.py	(revision 909)
@@ -1,7 +1,7 @@
 
-from . import fs
-from . import const
-from . import util
-from .watchdog import Watchdog
+import fs
+import const
+import util
+from watchdog import Watchdog
 
 import threading
@@ -12,5 +12,4 @@
 import codecs
 import math
-from functools import total_ordering
 
 from xplra import XPlane, MultiGetter, MultiSetter, ProtocolException
@@ -107,5 +106,5 @@
             else:
                 return False
-        except ProtocolException as e:
+        except ProtocolException, e:
             self._result = None
             return True
@@ -149,5 +148,4 @@
         return True
 
-@total_ordering
 class PeriodicRequest(object):
     """A periodic request."""
@@ -200,15 +198,8 @@
         pass
 
-    def __eq__(self, other):
-        """Equality comparison by the firing times"""
-        return self._nextFire == other._nextFire
-
-    def __ne__(self, other):
-        """Non-equality comparison by the firing times"""
-        return self._nextFire != other._nextFire
-
-    def __lt__(self, other):
-        """Less-than comparison by the firing times"""
-        return self._nextFire < other._nextFire
+    def __cmp__(self, other):
+        """Compare two periodic requests. They are ordered by their next
+        firing times."""
+        return cmp(self._nextFire, other._nextFire)
 
 class PeriodicDataRequest(PeriodicRequest):
@@ -250,6 +241,6 @@
         try:
             return fun()
-        except Exception as e:
-            print(util.utf2unicode(str(e)), file=sys.stderr)
+        except Exception, e:
+            print >> sys.stderr, util.utf2unicode(str(e))
             return None
 
@@ -321,6 +312,6 @@
             try:
                 multiGetter.execute()
-            except ProtocolException as e:
-                print("xplane.Handler._performRead: " + str(e))
+            except ProtocolException, e:
+                print "xplane.Handler._performRead: " + str(e)
                 raise
 
@@ -523,8 +514,8 @@
                 self._connected = True
                 return attempts
-            except Exception as e:
-                print("xplane.Handler._connect: connection failed: " + \
+            except Exception, e:
+                print "xplane.Handler._connect: connection failed: " + \
                       util.utf2unicode(str(e)) + \
-                      " (attempts: %d)" % (attempts,))
+                      " (attempts: %d)" % (attempts,)
                 if attempts<self.NUM_CONNECTATTEMPTS:
                     time.sleep(self.CONNECT_INTERVAL)
@@ -558,5 +549,5 @@
     def _disconnect(self):
         """Disconnect from the flight simulator."""
-        print("xplane.Handler._disconnect")
+        print "xplane.Handler._disconnect"
         if self._connected:
             try:
@@ -587,10 +578,10 @@
             try:
                 if not request.process(time):
-                    print("xplane.Handler._processRequest: X-Plane returned invalid data too many times, reconnecting")
+                    print "xplane.Handler._processRequest: X-Plane returned invalid data too many times, reconnecting"
                     needReconnect = True
             except Exception as e:
-                print("xplane.Handler._processRequest: X-Plane connection failed (" + \
+                print "xplane.Handler._processRequest: X-Plane connection failed (" + \
                       util.utf2unicode(str(e)) + \
-                      "), reconnecting (attempts=%d)." % (attempts,))
+                      "), reconnecting (attempts=%d)." % (attempts,)
                 needReconnect = True
 
@@ -813,5 +804,5 @@
 
         duration is the number of seconds to keep the message displayed."""
-        print("xplra.Simulator.sendMessage:", message)
+        print "xplra.Simulator.sendMessage:", message
         self._handler.requestShowMessage(message, duration,
                                          self._handleMessageSent,
@@ -896,5 +887,5 @@
         assert not self._monitoringRequested
 
-        print("xplra.Simulator.disconnect", closingMessage, duration)
+        print "xplra.Simulator.disconnect", closingMessage, duration
 
         self._stopNormal()
@@ -947,6 +938,6 @@
         if self._lastZuluSeconds is not None and \
            zuluSeconds<self._lastZuluSeconds:
-            print("xplane.Simulator._getTimestamp: Zulu seconds have gone backwards (%f -> %f), increasing day offset" % \
-              (self._lastZuluSeconds, zuluSeconds))
+            print "xplane.Simulator._getTimestamp: Zulu seconds have gone backwards (%f -> %f), increasing day offset" % \
+              (self._lastZuluSeconds, zuluSeconds)
             self._timestampDaysOffset += 1
 
@@ -1025,6 +1016,6 @@
             return False
 
-        print("xplane.Simulator: new data: %s, %s, %s, %s, %s, %s" % \
-              (tailnum, author, description, notes, icao, liveryPath))
+        print "xplane.Simulator: new data: %s, %s, %s, %s, %s, %s" % \
+              (tailnum, author, description, notes, icao, liveryPath)
 
         self._aircraftInfo = aircraftInfo
@@ -1149,7 +1140,6 @@
             self._handler.disconnect()
 
-    def _handleHotkeysRegistered(self, success, xxx_todo_changeme2):
+    def _handleHotkeysRegistered(self, success, (id, generation)):
         """Handle the result of the hotkeys having been written."""
-        (id, generation) = xxx_todo_changeme2
         with self._hotkeyLock:
             if success and id==self._hotkeySetID and \
@@ -1160,7 +1150,6 @@
                                                     (id, generation))
 
-    def _handleHotkeys(self, data, xxx_todo_changeme3):
+    def _handleHotkeys(self, data, (id, generation)):
         """Handle the hotkeys."""
-        (id, generation) = xxx_todo_changeme3
         with self._hotkeyLock:
             if id!=self._hotkeySetID or generation!=self._hotkeySetGeneration:
@@ -1628,6 +1617,6 @@
                               [level * self._fuelTankCapacities[index]]) )
             except:
-                print("xplane.Simulator.setFuelLevel: invalid tank constant: %d" % \
-                  (tank,))
+                print "xplane.Simulator.setFuelLevel: invalid tank constant: %d" % \
+                  (tank,)
 
         handler.requestWrite(data, self._handleFuelWritten)
@@ -1759,9 +1748,8 @@
     """Model handler for the FlyJSim Dash 8-Q400."""
     @staticmethod
-    def doesHandle(aircraft, xxx_todo_changeme):
+    def doesHandle(aircraft, (tailnum, author, description, notes,
+                              icao, liveryPath)):
         """Determine if this model handler handles the aircraft with the given
         name."""
-        (tailnum, author, description, notes,
-                              icao, liveryPath) = xxx_todo_changeme
         return aircraft.type==const.AIRCRAFT_DH8D and \
           description.find("Dash 8 Q400")!=-1 and \
@@ -1921,9 +1909,8 @@
     """Model for Felis' Tupolev Tu-154-M aircraft."""
     @staticmethod
-    def doesHandle(aircraft, xxx_todo_changeme1):
+    def doesHandle(aircraft, (tailnum, author, description, notes,
+                              icao, liveryPath)):
         """Determine if this model handler handles the aircraft with the given
         name."""
-        (tailnum, author, description, notes,
-                              icao, liveryPath) = xxx_todo_changeme1
         return aircraft.type==const.AIRCRAFT_T154 and \
           author.find("Felis")!=-1 and \
