Changeset 954:ad190b3a88c7 for src


Ignore:
Timestamp:
05/12/19 07:15:26 (5 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Removed text2unicode (re #347).

Location:
src/mlx/gui
Files:
7 edited

Legend:

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

    r919 r954  
    126126                                     descriptionBuffer.get_end_iter(),
    127127                                     False)
    128         description = text2unicode(description)
    129128        self.set_sensitive(False)
    130         self._gui.sendBugReport(text2unicode(self._summary.get_text()),
     129        self._gui.sendBugReport(self._summary.get_text(),
    131130                                description,
    132                                 text2unicode(self._email.get_text()),
     131                                self._email.get_text(),
    133132                                self._bugReportSent)
    134133
  • src/mlx/gui/checklist.py

    r919 r954  
    204204        numSelected = 0
    205205        for path in fileChooser.get_filenames():
    206             path = text2unicode(path)
    207206            numSelected += 1
    208207            if os.path.isfile(path): numFiles += 1
     
    213212        """Called when the Add button is clicked."""
    214213        for path in self._fileChooser.get_filenames():
    215             path = text2unicode(path)
    216214            self._fileListModel.append([os.path.basename(path),
    217215                                        path])
  • src/mlx/gui/common.py

    r926 r954  
    110110
    111111    pixbuf_new_from_file = gdk.pixbuf_new_from_file
    112 
    113     def text2unicode(text):
    114         """Convert the given text, returned by a Gtk widget, to Unicode."""
    115         return str(text)
    116 
    117     def text2str(text):
    118         """Convert the given text, returned by xstr to a string."""
    119         return str(text)
    120112
    121113else: # pygobject
     
    199191    import codecs
    200192    _utf8Decoder = codecs.getdecoder("utf-8")
    201 
    202     def text2unicode(str):
    203         """Convert the given text, returned by a Gtk widget, to Unicode."""
    204         return _utf8Decoder(str)[0]
    205 
    206     def text2str(text):
    207         """Convert the given text, returned by xstr to a string."""
    208         return _utf8Decoder(text)[0]
    209193
    210194import cairo
  • src/mlx/gui/flight.py

    r919 r954  
    648648
    649649        if response==RESPONSETYPE_OK:
    650             fileName = text2unicode(dialog.get_filename())
     650            fileName = dialog.get_filename()
    651651            print("Saving", fileName)
    652652            try:
     
    939939
    940940        if response==RESPONSETYPE_OK:
    941             fileName = text2unicode(dialog.get_filename())
     941            fileName = dialog.get_filename()
    942942            print("Loading", fileName)
    943943            bookedFlight = web.BookedFlight()
     
    47404740        self._lastSavePath = os.path.join(self._wizard.gui.config.pirepDirectory,
    47414741                                          self._getDefaultPIREPName())
    4742         self._lastSavePath = text2unicode(self._lastSavePath)
     4742        self._lastSavePath = self._lastSavePath
    47434743        self._savePIREP(page, automatic = True)
    47444744
     
    47774777
    47784778        if result==RESPONSETYPE_OK:
    4779             self._lastSavePath = text2unicode(dialog.get_filename())
     4779            self._lastSavePath = dialog.get_filename()
    47804780            self._savePIREP(page)
    47814781
     
    47974797            type = MESSAGETYPE_ERROR
    47984798            message = xstr("finish_save_failed")
    4799             secondary = xstr("finish_save_failed_sec") % (text2unicode(error),)
     4799            secondary = xstr("finish_save_failed_sec") % (error,)
    48004800        else:
    48014801            type = MESSAGETYPE_INFO
  • src/mlx/gui/gui.py

    r946 r954  
    14921492
    14931493        if result==RESPONSETYPE_OK:
    1494             self._lastLoadedPIREP = text2unicode(dialog.get_filename())
     1494            self._lastLoadedPIREP = dialog.get_filename()
    14951495
    14961496            pirep = PIREP.load(self._lastLoadedPIREP)
  • src/mlx/gui/info.py

    r919 r954  
    108108        """Get the comments."""
    109109        buffer = self._comments.get_buffer()
    110         return text2unicode(buffer.get_text(buffer.get_start_iter(),
    111                                             buffer.get_end_iter(), True))
     110        return buffer.get_text(buffer.get_start_iter(),
     111                               buffer.get_end_iter(), True)
    112112
    113113    @comments.setter
  • src/mlx/gui/prefs.py

    r919 r954  
    296296                                                       self._vsSmoothingLength)
    297297        config.useSimBrief = self._useSimBrief.get_active()
    298         config.pirepDirectory = text2unicode(self._pirepDirectory.get_text())
     298        config.pirepDirectory = self._pirepDirectory.get_text()
    299299        config.pirepAutoSave = self._pirepAutoSave.get_active()
    300300
     
    565565
    566566        if result==RESPONSETYPE_OK:
    567             self._pirepDirectory.set_text(text2unicode(dialog.get_filename()))
     567            self._pirepDirectory.set_text(dialog.get_filename())
    568568
    569569    def _pirepDirectoryChanged(self, entry):
Note: See TracChangeset for help on using the changeset viewer.