Ignore:
Timestamp:
03/24/19 08:15:59 (6 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Ran 2to3

Location:
src/mlx/gui
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/acars.py

    r747 r919  
    11
    2 from common import *
     2from .common import *
    33
    44from mlx.i18n import xstr
    55import mlx.const as const
    66
    7 import cef
     7from . import cef
    88
    99#------------------------------------------------------------------------------
  • src/mlx/gui/bugreport.py

    r492 r919  
    11
    2 from common import *
     2from .common import *
    33
    44from mlx.i18n import xstr
     
    105105        response = super(BugReportDialog, self).run()
    106106
    107         print "response", response, RESPONSETYPE_ACCEPT
     107        print("response", response, RESPONSETYPE_ACCEPT)
    108108        if response==RESPONSETYPE_ACCEPT:
    109109            self._send()
  • src/mlx/gui/callouts.py

    r300 r919  
    11
    2 from common import *
     2from .common import *
    33
    44from mlx.i18n import xstr
     
    208208            config = self._gui.config
    209209            for (aircraftType, approachCallouts) in \
    210                     self._approachCallouts.iteritems():
     210                    self._approachCallouts.items():
    211211                config.setApproachCallouts(aircraftType, approachCallouts)
    212212            config.save()
  • src/mlx/gui/cef.py

    r915 r919  
    1 from common import *
     1from .common import *
    22
    33from mlx.util import secondaryInstallation
     
    1010import os
    1111import re
    12 import thread
     12import _thread
    1313import threading
    1414import tempfile
    1515import traceback
    16 import urllib2
     16import urllib.request, urllib.error, urllib.parse
    1717from lxml import etree
    18 from StringIO import StringIO
     18from io import StringIO
    1919import lxml.html
    2020
     
    115115        """Called when a page has been loaded in the SimBrief browser."""
    116116        url = frame.GetUrl()
    117         print "gui.cef.SimBriefHandler._onLoadEnd", httpCode, url
     117        print("gui.cef.SimBriefHandler._onLoadEnd", httpCode, url)
    118118        if httpCode>=300:
    119119            self._updateProgress(self._lastProgress,
     
    127127
    128128            js = "form=document.getElementById(\"sbapiform\");"
    129             for (name, value) in self._plan.iteritems():
     129            for (name, value) in self._plan.items():
    130130                js += "form." + name + ".value=\"" + value + "\";"
    131             for (name, value) in SimBriefHandler._querySettings.iteritems():
     131            for (name, value) in SimBriefHandler._querySettings.items():
    132132                if isinstance(value, bool):
    133133                    js += "form." + name + ".checked=" + \
     
    175175
    176176            thread = threading.Thread(target = self._getResults, args = (link,))
    177             thread.daemon = True
    178             thread.start()
     177            _thread.daemon = True
     178            _thread.start()
    179179        else:
    180180            self._updateProgress(SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING,
     
    219219
    220220        # Obtaining the xml
    221         response = urllib2.urlopen(link)
     221        response = urllib.request.urlopen(link)
    222222        xmlContent = response.read()
    223223        # Processing xml
     
    242242                    imageLinks.append(imageLink[2])
    243243        flightInfo["image_links"] = imageLinks
    244         print(sorted(availableInfo.keys()))
     244        print((sorted(availableInfo.keys())))
    245245        htmlFilePath = "simbrief_plan.html" if self._htmlFilePath is None \
    246246          else self._htmlFilePath
     
    266266def _initializeCEF(args, initializedCallback):
    267267    """Perform the actual initialization of CEF using the given arguments."""
    268     print "Initializing CEF with args:", args
     268    print("Initializing CEF with args:", args)
    269269
    270270    settings = {
     
    290290                    switches[arg[2:assignIndex]] = arg[assignIndex+1:]
    291291        else:
    292             print "Unhandled switch", arg
     292            print("Unhandled switch", arg)
    293293
    294294    cefpython.Initialize(settings, switches)
     
    296296    gobject.timeout_add(10, _handleTimeout)
    297297
    298     print "Initialized, executing callback..."
     298    print("Initialized, executing callback...")
    299299    initializedCallback()
    300300
     
    322322        window = container.get_window()
    323323        if window is None:
    324             print "mlx.gui.cef.startInContainer: no window found!"
     324            print("mlx.gui.cef.startInContainer: no window found!")
    325325            windowID = None
    326326        else:
  • src/mlx/gui/checklist.py

    r300 r919  
    11
    2 from common import *
     2from .common import *
    33
    44from mlx.i18n import xstr
     
    190190            self._saveChecklist()
    191191            config = self._gui.config
    192             for (aircraftType, checklist) in self._checklists.iteritems():
     192            for (aircraftType, checklist) in self._checklists.items():
    193193                config.setChecklist(aircraftType, checklist)
    194194            config.save()
  • src/mlx/gui/common.py

    r863 r919  
    3131
    3232if not pygobject:
    33     print "Using PyGTK"
     33    print("Using PyGTK")
    3434    pygobject = False
    3535    import pygtk
     
    4242        import appindicator
    4343        appIndicator = True
    44     except Exception, e:
     44    except Exception as e:
    4545        pass
    4646
     
    113113    def text2unicode(text):
    114114        """Convert the given text, returned by a Gtk widget, to Unicode."""
    115         return unicode(text)
     115        return str(text)
    116116
    117117    def text2str(text):
  • src/mlx/gui/delaycodes.py

    r840 r919  
    33#------------------------------------------------------------------------------
    44
    5 from dcdata import CAPTION, DELAYCODE, getTable
     5from .dcdata import CAPTION, DELAYCODE, getTable
    66
    77from mlx.gui.common import *
  • src/mlx/gui/faultexplain.py

    r842 r919  
    247247    def reset(self):
    248248        """Reset the widget by removing all faults."""
    249         for (alignment, faultFrame) in self._faultWidgets.itervalues():
     249        for (alignment, faultFrame) in self._faultWidgets.values():
    250250            self._faults.remove(alignment)
    251251        self._faults.show_all()
  • src/mlx/gui/flight.py

    r872 r919  
    405405    def _offlineClicked(self, button):
    406406        """Called when the offline button was clicked."""
    407         print "mlx.flight.LoginPage: offline flight selected"
     407        print("mlx.flight.LoginPage: offline flight selected")
    408408        self._wizard.nextPage()
    409409
    410410    def _loginClicked(self, button):
    411411        """Called when the login button was clicked."""
    412         print "mlx.flight.LoginPage: logging in"
     412        print("mlx.flight.LoginPage: logging in")
    413413        self._wizard.login(self._handleLoginResult,
    414414                           self._pilotID.get_text(),
     
    649649        if response==RESPONSETYPE_OK:
    650650            fileName = text2unicode(dialog.get_filename())
    651             print "Saving", fileName
     651            print("Saving", fileName)
    652652            try:
    653653                with open(fileName, "wt") as f:
    654654                    flight.writeIntoFile(f)
    655             except Exception, e:
    656                 print "Failed to save flight:", util.utf2unicode(str(e))
     655            except Exception as e:
     656                print("Failed to save flight:", util.utf2unicode(str(e)))
    657657                dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    658658                                           type = MESSAGETYPE_ERROR,
     
    706706        flight=self._getSelectedFlight()
    707707
    708         print "DPI", context.get_dpi_x(), context.get_dpi_y()
     708        print("DPI", context.get_dpi_x(), context.get_dpi_y())
    709709
    710710        scale = context.get_dpi_x() / 72.0
     
    719719
    720720        layout = cr.create_layout()
    721         layout.set_text(u"Malév VA official briefing")
     721        layout.set_text("Malév VA official briefing")
    722722        font = pango.FontDescription("sans")
    723723        font.set_size(int(32 * scale * pango.SCALE))
     
    740740
    741741        layout = cr.create_layout()
    742         layout.set_text(u"%s (%s) részére" %
     742        layout.set_text("%s (%s) részére" %
    743743                        (loginResult.pilotName, loginResult.pilotID))
    744744        font = pango.FontDescription("sans")
     
    940940        if response==RESPONSETYPE_OK:
    941941            fileName = text2unicode(dialog.get_filename())
    942             print "Loading", fileName
     942            print("Loading", fileName)
    943943            bookedFlight = web.BookedFlight()
    944944            try:
     
    946946                    bookedFlight.readFromFile(f)
    947947                self.addFlight(bookedFlight)
    948             except Exception, e:
    949                 print "Failed to load flight:", util.utf2unicode(str(e))
     948            except Exception as e:
     949                print("Failed to load flight:", util.utf2unicode(str(e)))
    950950                dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    951951                                           type = MESSAGETYPE_ERROR,
     
    16291629                                            self.phoneNumber, self.nationality,
    16301630                                            self.password)
    1631         print "Registering with data:"
    1632         print "  name:", self.name1, self.name2, registrationData.firstName, registrationData.surName, requestedNameOrder
    1633         print "  yearOfBirth:", self.yearOfBirth, registrationData.yearOfBirth
    1634         print "  emailAddress:", self.emailAddress, registrationData.emailAddress
    1635         print "  emailAddressPublic:", self.emailAddressPublic, registrationData.emailAddressPublic
    1636         print "  vatsimID:", self.vatsimID, registrationData.vatsimID
    1637         print "  ivaoID:", self.ivaoID, registrationData.ivaoID
    1638         print "  phoneNumber:", self.phoneNumber, registrationData.phoneNumber
    1639         print "  nationality:", self.nationality, registrationData.nationality
     1631        print("Registering with data:")
     1632        print("  name:", self.name1, self.name2, registrationData.firstName, registrationData.surName, requestedNameOrder)
     1633        print("  yearOfBirth:", self.yearOfBirth, registrationData.yearOfBirth)
     1634        print("  emailAddress:", self.emailAddress, registrationData.emailAddress)
     1635        print("  emailAddressPublic:", self.emailAddressPublic, registrationData.emailAddressPublic)
     1636        print("  vatsimID:", self.vatsimID, registrationData.vatsimID)
     1637        print("  ivaoID:", self.ivaoID, registrationData.ivaoID)
     1638        print("  phoneNumber:", self.phoneNumber, registrationData.phoneNumber)
     1639        print("  nationality:", self.nationality, registrationData.nationality)
    16401640
    16411641        gui = self._wizard.gui
     
    16531653        gui.endBusy()
    16541654
    1655         print "Registration result:"
    1656         print "  returned:", returned
     1655        print("Registration result:")
     1656        print("  returned:", returned)
    16571657        if returned:
    1658             print "  registered:", result.registered
     1658            print("  registered:", result.registered)
    16591659            if result.registered:
    1660                 print "  pilotID", result.pilotID
    1661                 print "  loggedIn", result.loggedIn
    1662             print "  emailAlreadyRegistered:", result.emailAlreadyRegistered
    1663             print "  invalidData:", result.invalidData
     1660                print("  pilotID", result.pilotID)
     1661                print("  loggedIn", result.loggedIn)
     1662            print("  emailAlreadyRegistered:", result.emailAlreadyRegistered)
     1663            print("  invalidData:", result.invalidData)
    16641664
    16651665        registrationOK = returned and result.registered
     
    18301830    def activate(self):
    18311831        """Activate the student page."""
    1832         print "StudentPage.activate"
     1832        print("StudentPage.activate")
    18331833        self._getEntryExamStatusCancelled = False
    18341834
     
    18441844    def finalize(self):
    18451845        """Finalize the page."""
    1846         print "StudentPage.finalize"
     1846        print("StudentPage.finalize")
    18471847        self._getEntryExamStatusCancelled = True
    18481848
     
    18641864    def _handleEntryExamStatus(self, returned, result):
    18651865        """Called when the entry exam status is availabe."""
    1866         print "_handleEntryExamStatus", returned, result
     1866        print("_handleEntryExamStatus", returned, result)
    18671867        if returned and not self._getEntryExamStatusCancelled:
    18681868            self._entryExamLink = result.entryExamLink
     
    29912991
    29922992            plan = self._getPlan()
    2993             print "plan:", plan
     2993            print("plan:", plan)
    29942994
    29952995            takeoffRunway = self._takeoffRunway.get_text()
     
    30273027        are returned. Otherwise a dialog box is displayed informing the user of
    30283028        invalid credentials and requesting another set of them."""
    3029         print "_getCredentials", count
     3029        print("_getCredentials", count)
    30303030        if count==0:
    30313031            return (self._userName.get_text(), self._password.get_text())
     
    30613061    def _simBriefProgress(self, progress, result, flightInfo):
    30623062        """The real SimBrief progress handler."""
    3063         print "_simBriefProgress", progress, result, flightInfo
     3063        print("_simBriefProgress", progress, result, flightInfo)
    30643064        if result==cef.SIMBRIEF_RESULT_NONE:
    30653065            message = SimBriefSetupPage.progress2Message.get(progress,
     
    37583758    def _metarChanged(self, buffer):
    37593759        """Called when the METAR has changed."""
    3760         print "BriefingPage.metarChanged", self._updatingMETAR
     3760        print("BriefingPage.metarChanged", self._updatingMETAR)
    37613761        if not self._updatingMETAR:
    37623762            self.metarEdited = True
     
    37703770
    37713771        It uppercases all characters."""
    3772         print "BriefingPage.metarInserted", self._updatingMETAR
     3772        print("BriefingPage.metarInserted", self._updatingMETAR)
    37733773        if not self._updatingMETAR:
    37743774            self._updatingMETAR = True
     
    40254025    def activate(self):
    40264026        """Activate the page."""
    4027         print "TakeoffPage.activate"
     4027        print("TakeoffPage.activate")
    40284028
    40294029        self._updatingMETAR = True
     
    40694069    def allowForward(self):
    40704070        """Allow going to the next page."""
    4071         print "TakeoffPage.allowForward"
     4071        print("TakeoffPage.allowForward")
    40724072        self._forwardAllowed = True
    40734073        self._updateForwardButton()
     
    40754075    def reset(self):
    40764076        """Reset the page if the wizard is reset."""
    4077         print "TakeoffPage.reset"
     4077        print("TakeoffPage.reset")
    40784078
    40794079        super(TakeoffPage, self).reset()
     
    40954095        pages."""
    40964096        if self._active:
    4097             print "TakeoffPage.changeMETAR"
     4097            print("TakeoffPage.changeMETAR")
    40984098            self._updatingMETAR = True
    40994099            self._metar.get_buffer().set_text(metar, -1)
     
    41164116                     self.derate is not None)
    41174117
    4118         print "TakeoffPage._updateForwardButton: forwardAllowed:", self._forwardAllowed, ", sensitive:", sensitive
     4118        print("TakeoffPage._updateForwardButton: forwardAllowed:", self._forwardAllowed, ", sensitive:", sensitive)
    41194119        if self._forwardAllowed:
    4120             print "  METAR: ", self._metar.get_text()
    4121             print "  runway: ", self._runway.get_text()
    4122             print "  SID:", self.sid
    4123             print "  V1:", self.v1
    4124             print "  VR:", self.vr
    4125             print "  V2:", self.v2
    4126             print "  derateType:", self._derateType
    4127             print "  derate:", self.derate
     4120            print("  METAR: ", self._metar.get_text())
     4121            print("  runway: ", self._runway.get_text())
     4122            print("  SID:", self.sid)
     4123            print("  V1:", self.v1)
     4124            print("  VR:", self.vr)
     4125            print("  V2:", self.v2)
     4126            print("  derateType:", self._derateType)
     4127            print("  derate:", self.derate)
    41284128
    41294129        self._button.set_sensitive(sensitive)
     
    41314131    def _valueChanged(self, widget, arg = None):
    41324132        """Called when the value of some widget has changed."""
    4133         print "TakeoffPage._valueChanged"
     4133        print("TakeoffPage._valueChanged")
    41344134
    41354135        self._updateForwardButton()
     
    41384138        """Called when the value of some entry widget has changed and the value
    41394139        should be converted to uppercase."""
    4140         print "TakeoffPage._upperChanged"
     4140        print("TakeoffPage._upperChanged")
    41414141        entry.set_text(entry.get_text().upper())
    41424142        self._valueChanged(entry, arg)
     
    41514151    def _derateChanged(self, entry):
    41524152        """Called when the value of the derate is changed."""
    4153         print "TakeoffPage._derateChanged"
     4153        print("TakeoffPage._derateChanged")
    41544154        self._updateForwardButton()
    41554155
     
    42624262    def _metarChanged(self, entry):
    42634263        """Called when the METAR has changed."""
    4264         print "TakeoffPage.metarChanged", self._updatingMETAR
     4264        print("TakeoffPage.metarChanged", self._updatingMETAR)
    42654265        if not self._updatingMETAR:
    42664266            self._updateForwardButton()
     
    42714271
    42724272        It uppercases all characters."""
    4273         print "TakeoffPage.metarInserted", self._updatingMETAR
     4273        print("TakeoffPage.metarInserted", self._updatingMETAR)
    42744274        if not self._updatingMETAR:
    42754275            self._updatingMETAR = True
     
    46284628        pages."""
    46294629        if self._active:
    4630             print "LandingPage.changeMETAR"
     4630            print("LandingPage.changeMETAR")
    46314631            self._updatingMETAR = True
    46324632            self._metar.get_buffer().set_text(metar, -1)
     
    46894689    def _metarChanged(self, entry):
    46904690        """Called when the METAR has changed."""
    4691         print "LandingPage.metarChanged", self._updatingMETAR
     4691        print("LandingPage.metarChanged", self._updatingMETAR)
    46924692        if not self._updatingMETAR:
    46934693            self._updateForwardButton()
     
    46984698
    46994699        It uppercases all characters."""
    4700         print "LandingPage.metarInserted", self._updatingMETAR
     4700        print("LandingPage.metarInserted", self._updatingMETAR)
    47014701        if not self._updatingMETAR:
    47024702            self._updatingMETAR = True
     
    52175217        pass
    52185218
    5219     def _formatTime(self, scheduledTime, realTimestamp, (warning, error)):
     5219    def _formatTime(self, scheduledTime, realTimestamp, xxx_todo_changeme):
    52205220        """Format the departure or arrival time based on the given data as a
    52215221        markup for a label."""
     5222        (warning, error) = xxx_todo_changeme
    52225223        realTime = time.gmtime(realTimestamp)
    52235224
     
    57525753        elif stage==const.STAGE_LANDING:
    57535754            if not self._arrivalBriefingPage.metarEdited:
    5754                 print "Downloading arrival METAR again"
     5755                print("Downloading arrival METAR again")
    57555756                self.gui.webHandler.getMETARs(self._arrivalMETARCallback,
    57565757                                              [self._bookedFlight.arrivalICAO])
  • src/mlx/gui/flightlist.py

    r868 r919  
    6161
    6262        if self._extraColumnAttributes is not None:
    63             for (key, value) in self._extraColumnAttributes.iteritems():
     63            for (key, value) in self._extraColumnAttributes.items():
    6464                if key=="alignment":
    6565                    self._renderer.set_alignment(value, 0.5)
     
    401401        gui.endBusy()
    402402
    403         print "PendingFlightsFrame._handleReflyResult", returned, result
     403        print("PendingFlightsFrame._handleReflyResult", returned, result)
    404404
    405405        if returned:
     
    444444        gui.endBusy()
    445445
    446         print "PendingFlightsFrame._handleDeleteResult", returned, result
     446        print("PendingFlightsFrame._handleDeleteResult", returned, result)
    447447
    448448        if returned:
  • src/mlx/gui/gates.py

    r619 r919  
    143143        self._fleetStore.clear()
    144144        if fleet is None:
    145             for (gateNumber, label) in self._gateLabels.iteritems():
     145            for (gateNumber, label) in self._gateLabels.items():
    146146                label.set_markup("<b>" + gateNumber + "</b>")
    147147        else:       
  • src/mlx/gui/gui.py

    r869 r919  
    11# -*- coding: utf-8 -*-
    22
    3 from statusicon import StatusIcon
    4 from statusbar import Statusbar
    5 from info import FlightInfo
    6 from update import Updater
     3from .statusicon import StatusIcon
     4from .statusbar import Statusbar
     5from .info import FlightInfo
     6from .update import Updater
    77from mlx.gui.common import *
    88from mlx.gui.flight import Wizard
     
    1818from mlx.gui.acars import ACARS
    1919from mlx.gui.timetable import TimetableWindow
    20 import cef
     20from . import cef
    2121
    2222import mlx.const as const
     
    5151class GUI(fs.ConnectionListener):
    5252    """The main GUI class."""
    53     _authors = [ (u"Váradi", u"István", "prog_test"),
    54                  (u"Galyassy", u"Tamás", "negotiation"),
    55                  (u"Kurják", u"Ákos", "test"),
    56                  (u"Nagy", u"Dániel", "test"),
    57                  (u"Radó", u"Iván", "test"),
    58                  (u"Petrovszki", u"Gábor", "test"),
    59                  (u"Serfőző", u"Tamás", "test"),
    60                  (u"Szebenyi", u"Bálint", "test"),
    61                  (u"Zsebényi-Loksa", u"Gergely", "test") ]
     53    _authors = [ ("Váradi", "István", "prog_test"),
     54                 ("Galyassy", "Tamás", "negotiation"),
     55                 ("Kurják", "Ákos", "test"),
     56                 ("Nagy", "Dániel", "test"),
     57                 ("Radó", "Iván", "test"),
     58                 ("Petrovszki", "Gábor", "test"),
     59                 ("Serfőző", "Tamás", "test"),
     60                 ("Szebenyi", "Bálint", "test"),
     61                 ("Zsebényi-Loksa", "Gergely", "test") ]
    6262
    6363    def __init__(self, programDirectory, config):
     
    14621462                secondaryMarkup = xstr("sendPIREP_unknown_sec")
    14631463        else:
    1464             print "PIREP sending failed", result
     1464            print("PIREP sending failed", result)
    14651465            messageFormat = xstr("sendPIREP_failed")
    14661466            secondaryMarkup = xstr("sendPIREP_failed_sec")
     
    16861686                secondaryMarkup = xstr("sendPIREP_unknown_sec")
    16871687        else:
    1688             print "PIREP sending failed", result
     1688            print("PIREP sending failed", result)
    16891689            messageFormat = xstr("sendPIREP_failed")
    16901690            secondaryMarkup = xstr("sendPIREP_failed_sec")
     
    17111711
    17121712        for (timestampString, text) in self._logger.lines:
    1713             description += unicode(formatFlightLogLine(timestampString, text))
     1713            description += str(formatFlightLogLine(timestampString, text))
    17141714
    17151715        description += "\n\n" + ("=" * 40)
     
    17981798            for index in hotkeys:
    17991799                if index==self._pilotHotkeyIndex:
    1800                     print "gui.GUI._handleHotkeys: pilot hotkey pressed"
     1800                    print("gui.GUI._handleHotkeys: pilot hotkey pressed")
    18011801                    self._flight.pilotHotkeyPressed()
    18021802                elif index==self._checklistHotkeyIndex:
    1803                     print "gui.GUI._handleHotkeys: checklist hotkey pressed"
     1803                    print("gui.GUI._handleHotkeys: checklist hotkey pressed")
    18041804                    self._flight.checklistHotkeyPressed()
    18051805                else:
    1806                     print "gui.GUI._handleHotkeys: unhandled hotkey index:", index
     1806                    print("gui.GUI._handleHotkeys: unhandled hotkey index:", index)
    18071807
    18081808    def _showManual(self, menuitem):
  • src/mlx/gui/info.py

    r846 r919  
    11
    2 from common import *
     2from .common import *
    33
    44from mlx.gui.delaycodes import DelayCodeTable
  • src/mlx/gui/pirep.py

    r855 r919  
    11
    2 from common import *
    3 from dcdata import getTable
    4 from info import FlightInfo
    5 from flight import comboModel
     2from .common import *
     3from .dcdata import getTable
     4from .info import FlightInfo
     5from .flight import comboModel
    66
    77from mlx.pirep import PIREP
  • src/mlx/gui/prefs.py

    r738 r919  
    11
    2 from common import *
     2from .common import *
    33
    44from mlx.i18n import xstr
     
    66import mlx.config as config
    77
    8 import urlparse
     8import urllib.parse
    99
    1010#------------------------------------------------------------------------------
     
    6363
    6464        self._hotkeyModel = gtk.ListStore(str)
    65         for keyCode in range(ord("0"), ord("9")+1) + range(ord("A"), ord("Z")+1):
     65        for keyCode in list(range(ord("0"), ord("9")+1)) + list(range(ord("A"), ord("Z")+1)):
    6666            self._hotkeyModel.append([chr(keyCode)])
    6767
     
    829829        sensitive = False
    830830        try:
    831             result = urlparse.urlparse(self._updateURL.get_text())
     831            result = urllib.parse.urlparse(self._updateURL.get_text())
    832832            sensitive = result.scheme!="" and (result.netloc + result.path)!=""
    833833        except:
  • src/mlx/gui/statusbar.py

    r679 r919  
    11
    2 from common import *
     2from .common import *
    33
    44import mlx.const as const
  • src/mlx/gui/statusicon.py

    r544 r919  
    11
    2 from common import *
     2from .common import *
    33
    44import mlx.const as const
     
    154154    def _updateFlightStatus(self):
    155155        """Update the flight status."""
    156         stage = u"-" if self._stage is None \
     156        stage = "-" if self._stage is None \
    157157                else xstr("flight_stage_" + const.stage2string(self._stage))
    158158
     
    172172            if self._noGoReason is not None:
    173173                rating = '<span foreground="red">' + rating + '</span>'
    174             markup = u"MAVA Logger X %s\n\n%s: %s\n%s: %s" %\
     174            markup = "MAVA Logger X %s\n\n%s: %s\n%s: %s" %\
    175175                     (const.VERSION, xstr("statusicon_stage"), stage,
    176176                      xstr("statusicon_rating"), rating)
  • src/mlx/gui/timetable.py

    r879 r919  
    44
    55from mlx.gui.common import *
    6 from flightlist import ColumnDescriptor
     6from .flightlist import ColumnDescriptor
    77from mlx.rpc import ScheduledFlight
    88
     
    249249                    self._tooltips.set_tip(widget, "")
    250250                    self._tooltips.disable()
    251         except Exception, e:
    252             print e
     251        except Exception as e:
     252            print(e)
    253253            self._tooltips.set_tip(widget, "")
    254254            self._tooltips.disable()
     
    656656            typeFamilies.add(const.aircraftType2Family(aircraftType))
    657657
    658         for (typeFamily, checkButton) in self._typeFamilyButtons.iteritems():
     658        for (typeFamily, checkButton) in self._typeFamilyButtons.items():
    659659            checkButton.set_sensitive(typeFamily in typeFamilies)
    660660
     
    712712        """Update the timetable list."""
    713713        aircraftTypes = []
    714         for (aircraftFamily, button) in self._typeFamilyButtons.iteritems():
     714        for (aircraftFamily, button) in self._typeFamilyButtons.items():
    715715            if button.get_active():
    716716                aircraftTypes += const.aircraftFamily2Types[aircraftFamily]
Note: See TracChangeset for help on using the changeset viewer.