Changeset 831:66c2d86eb283


Ignore:
Timestamp:
12/30/16 15:53:35 (7 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Eliminated superfluous whitespace.

File:
1 edited

Legend:

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

    r437 r831  
    2929        The frame will contain an alignment to properly distance the
    3030        insides. The alignment will contain a VBox to contain the real
    31         contents. 
     31        contents.
    3232
    3333        The function returns a tuple with the following items:
     
    4343        box = gtk.VBox()
    4444        alignment.add(box)
    45        
     45
    4646        return (frame, box)
    4747
     
    6666    def getTextWindow(heightRequest = 40):
    6767        """Get a scrollable text window.
    68        
     68
    6969        Returns a tuple of the following items:
    7070        - the window,
     
    8787                    dataLabelXAlignment = 0.0):
    8888        """Attach a labeled data to the given column and row of the
    89         table. 
    90        
     89        table.
     90
    9191        If width is given, that will be the width of the data
    9292        label.
     
    9595        dataBox = gtk.HBox()
    9696        table.attach(dataBox, column, column+1, row, row+1)
    97        
     97
    9898        dataLabel = PIREPViewer.addLabeledData(dataBox, labelText,
    9999                                               width = width)
     
    105105    def addLabeledData(hBox, labelText, width = None, dataPadding = 8):
    106106        """Add a label and a data label to the given HBox.
    107        
     107
    108108        Returnsd the data label."""
    109109        label = PIREPViewer.getLabel(labelText)
    110110        hBox.pack_start(label, False, False, 0)
    111                
     111
    112112        dataLabel = PIREPViewer.getDataLabel(width = width)
    113113        hBox.pack_start(dataLabel, False, False, dataPadding)
     
    122122        filler.set_size_request(-1, height)
    123123        vBox.pack_start(filler, False, False, 0)
    124        
     124
    125125    @staticmethod
    126126    def timestamp2text(label, timestamp):
     
    136136                                          xstr("pirepView_title"),
    137137                                          parent = gui.mainWindow)
    138                                          
     138
    139139        self.set_resizable(False)
    140140
    141141        self._gui = gui
    142        
     142
    143143        contentArea = self.get_content_area()
    144144
    145145        self._notebook = gtk.Notebook()
    146146        contentArea.pack_start(self._notebook, False, False, 4)
    147        
     147
    148148        dataTab = self._buildDataTab()
    149149        label = gtk.Label(xstr("pirepView_tab_data"))
     
    151151        label.set_tooltip_text(xstr("pirepView_tab_data_tooltip"))
    152152        self._notebook.append_page(dataTab, label)
    153        
     153
    154154        commentsTab = self._buildCommentsTab()
    155155        label = gtk.Label(xstr("pirepView_tab_comments"))
     
    157157        label.set_tooltip_text(xstr("pirepView_tab_comments_tooltip"))
    158158        self._notebook.append_page(commentsTab, label)
    159        
     159
    160160        logTab = self._buildLogTab()
    161161        label = gtk.Label(xstr("pirepView_tab_log"))
     
    166166        self._okButton = self.add_button(xstr("button_ok"), RESPONSETYPE_OK)
    167167        self._okButton.set_can_default(True)
    168        
     168
    169169    def setPIREP(self, pirep):
    170170        """Setup the data in the dialog from the given PIREP."""
     
    175175        aircraftType = xstr("aircraft_" + icaoCodes[bookedFlight.aircraftType].lower())
    176176        self._aircraftType.set_text(aircraftType)
    177        
     177
    178178        self._departureICAO.set_text(bookedFlight.departureICAO)
    179179        self._departureTime.set_text("%02d:%02d" % \
     
    191191        self._cargoWeight.set_text(str(bookedFlight.cargoWeight))
    192192        self._mailWeight.set_text(str(bookedFlight.mailWeight))
    193        
     193
    194194        self._route.get_buffer().set_text(bookedFlight.route)
    195195
     
    218218        PIREPViewer.timestamp2text(self._flightTimeStart, pirep.flightTimeStart)
    219219        PIREPViewer.timestamp2text(self._flightTimeEnd, pirep.flightTimeEnd)
    220        
     220
    221221        self._flownDistance.set_text("%.1f" % (pirep.flownDistance,))
    222222        self._fuelUsed.set_text("%.0f" % (pirep.fuelUsed,))
     
    233233        self._flownCargoWeight.set_text("%.0f" % (pirep.cargoWeight,))
    234234        self._flownMailWeight.set_text("%.0f" % (pirep.mailWeight,))
    235         self._flightType.set_text(xstr("flighttype_" + 
     235        self._flightType.set_text(xstr("flighttype_" +
    236236                                       flightType2string(pirep.flightType)))
    237237        self._online.set_text(xstr("pirepView_" +
     
    242242            if delayCodes: delayCodes += ", "
    243243            delayCodes += code
    244        
    245         self._delayCodes.get_buffer().set_text(delayCodes)       
     244
     245        self._delayCodes.get_buffer().set_text(delayCodes)
    246246
    247247        self._comments.get_buffer().set_text(pirep.comments)
     
    270270        box1 = gtk.VBox()
    271271        table.attach(box1, 0, 1, 0, 1)
    272        
     272
    273273        box2 = gtk.VBox()
    274274        table.attach(box2, 1, 2, 0, 1)
    275        
     275
    276276        flightFrame = self._buildFlightFrame()
    277277        box1.pack_start(flightFrame, False, False, 4)
     
    296296    def _buildFlightFrame(self):
    297297        """Build the frame for the flight data."""
    298        
     298
    299299        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_flight"))
    300        
     300
    301301        dataBox = gtk.HBox()
    302302        mainBox.pack_start(dataBox, False, False, 0)
    303        
     303
    304304        self._callsign = \
    305305            PIREPViewer.addLabeledData(dataBox,
     
    327327        mainBox.pack_start(table, False, False, 0)
    328328        table.set_row_spacings(4)
    329         table.set_col_spacings(8)       
     329        table.set_col_spacings(8)
    330330
    331331        self._departureICAO = \
     
    352352        mainBox.pack_start(table, False, False, 0)
    353353        table.set_row_spacings(4)
    354         table.set_col_spacings(8)       
     354        table.set_col_spacings(8)
    355355
    356356        self._numPassengers = \
     
    365365
    366366        self._bagWeight = \
    367             PIREPViewer.tableAttach(table, 0, 1, 
     367            PIREPViewer.tableAttach(table, 0, 1,
    368368                                    xstr("pirepView_bagWeight"),
    369369                                    width = 5)
    370370
    371371        self._cargoWeight = \
    372             PIREPViewer.tableAttach(table, 1, 1, 
     372            PIREPViewer.tableAttach(table, 1, 1,
    373373                                    xstr("pirepView_cargoWeight"),
    374374                                    width = 5)
    375375
    376376        self._mailWeight = \
    377             PIREPViewer.tableAttach(table, 2, 1, 
     377            PIREPViewer.tableAttach(table, 2, 1,
    378378                                    xstr("pirepView_mailWeight"),
    379379                                    width = 5)
    380            
     380
    381381        PIREPViewer.addVFiller(mainBox)
    382382
    383383        mainBox.pack_start(PIREPViewer.getLabel(xstr("pirepView_route")),
    384384                           False, False, 0)
    385        
     385
    386386        (routeWindow, self._route) = PIREPViewer.getTextWindow()
    387387        mainBox.pack_start(routeWindow, False, False, 0)
     
    392392        """Build the frame for the user-specified route and flight
    393393        level."""
    394        
     394
    395395        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_route"))
    396396
    397397        levelBox = gtk.HBox()
    398398        mainBox.pack_start(levelBox, False, False, 0)
    399        
     399
    400400        self._filedCruiseLevel = \
    401             PIREPViewer.addLabeledData(levelBox, 
     401            PIREPViewer.addLabeledData(levelBox,
    402402                                       xstr("pirepView_filedCruiseLevel"),
    403403                                       width = 6)
     
    416416
    417417    def _buildDepartureFrame(self):
    418         """Build the frame for the departure data."""       
     418        """Build the frame for the departure data."""
    419419        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_departure"))
    420420
     
    429429        dataBox = gtk.HBox()
    430430        mainBox.pack_start(dataBox, False, False, 0)
    431        
     431
    432432        self._departureRunway = \
    433433            PIREPViewer.addLabeledData(dataBox,
     
    441441
    442442        return frame
    443                            
     443
    444444    def _buildArrivalFrame(self):
    445         """Build the frame for the arrival data."""       
     445        """Build the frame for the arrival data."""
    446446        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_arrival"))
    447447
     
    457457        mainBox.pack_start(table, False, False, 0)
    458458        table.set_row_spacings(4)
    459         table.set_col_spacings(8)       
     459        table.set_col_spacings(8)
    460460
    461461        self._star = \
     
    468468                                    xstr("pirepView_transition"),
    469469                                    width = 12)
    470                            
     470
    471471        self._approachType = \
    472472            PIREPViewer.tableAttach(table, 0, 1,
    473473                                    xstr("pirepView_approachType"),
    474474                                    width = 7)
    475                            
     475
    476476        self._arrivalRunway = \
    477             PIREPViewer.tableAttach(table, 1, 1, 
     477            PIREPViewer.tableAttach(table, 1, 1,
    478478                                    xstr("pirepView_runway"),
    479479                                    width = 5)
    480                            
     480
    481481        return frame
    482482
    483483    def _buildStatisticsFrame(self):
    484         """Build the frame for the statistics data."""       
     484        """Build the frame for the statistics data."""
    485485        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_statistics"))
    486486
     
    490490        table.set_col_spacings(8)
    491491        table.set_homogeneous(False)
    492        
     492
    493493        self._blockTimeStart = \
    494494            PIREPViewer.tableAttach(table, 0, 0,
    495495                                    xstr("pirepView_blockTimeStart"),
    496496                                    width = 6)
    497        
     497
    498498        self._blockTimeEnd = \
    499499            PIREPViewer.tableAttach(table, 1, 0,
     
    505505                                    xstr("pirepView_flightTimeStart"),
    506506                                    width = 6)
    507        
     507
    508508        self._flightTimeEnd = \
    509             PIREPViewer.tableAttach(table, 1, 1, 
     509            PIREPViewer.tableAttach(table, 1, 1,
    510510                                    xstr("pirepView_flightTimeEnd"),
    511511                                    width = 6)
     
    515515                                    xstr("pirepView_flownDistance"),
    516516                                    width = 8)
    517        
     517
    518518        self._fuelUsed = \
    519519            PIREPViewer.tableAttach(table, 1, 2,
    520520                                    xstr("pirepView_fuelUsed"),
    521521                                    width = 6)
    522        
     522
    523523        self._rating = \
    524524            PIREPViewer.tableAttach(table, 0, 3,
     
    528528
    529529    def _buildMiscellaneousFrame(self):
    530         """Build the frame for the miscellaneous data."""       
     530        """Build the frame for the miscellaneous data."""
    531531        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_miscellaneous"))
    532532
     
    534534        mainBox.pack_start(table, False, False, 0)
    535535        table.set_row_spacings(4)
    536         table.set_col_spacings(8)       
    537        
     536        table.set_col_spacings(8)
     537
    538538        self._flownNumPassengers = \
    539539            PIREPViewer.tableAttach(table, 0, 0,
     
    565565                                    xstr("pirepView_flightType"),
    566566                                    width = 15)
    567            
     567
    568568        self._online = \
    569569            PIREPViewer.tableAttach(table, 1, 2,
     
    575575        mainBox.pack_start(PIREPViewer.getLabel(xstr("pirepView_delayCodes")),
    576576                           False, False, 0)
    577    
     577
    578578        (textWindow, self._delayCodes) = PIREPViewer.getTextWindow()
    579579        mainBox.pack_start(textWindow, False, False, 0)
    580580
    581         return frame       
     581        return frame
    582582
    583583    def _buildCommentsTab(self):
     
    601601            PIREPViewer.getTextWindow(heightRequest = -1)
    602602        flightDefectsBox.pack_start(flightDefectsWindow, True, True, 0)
    603        
     603
    604604        return table
    605605
     
    611611        addFaultTag(self._log.get_buffer())
    612612        mainBox.pack_start(logWindow, True, True, 0)
    613        
     613
    614614        return mainBox
    615        
     615
    616616#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.