Ignore:
Timestamp:
03/24/19 08:15:59 (4 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Ran 2to3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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])
Note: See TracChangeset for help on using the changeset viewer.