Ignore:
Timestamp:
12/27/12 08:04:59 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The exception strings are converted from UTF-8 to unicode for proper logging (re #170)

Location:
src/mlx/gui
Files:
2 edited

Legend:

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

    r373 r401  
    9696        """Convert the given text, returned by xstr to a string."""
    9797        return str(text)
     98
    9899else:
    99100    print "Using PyGObject"
     
    106107    from gi.repository import Pango as pango
    107108    appIndicator = True
    108    
     109
    109110    MESSAGETYPE_ERROR = gtk.MessageType.ERROR
    110111    MESSAGETYPE_QUESTION = gtk.MessageType.QUESTION
     
    156157    import codecs
    157158    _utf8Decoder = codecs.getdecoder("utf-8")
    158    
     159
    159160    def text2unicode(str):
    160161        """Convert the given text, returned by a Gtk widget, to Unicode."""
     
    182183        self._noGoReason = None
    183184        self._updateFlightStatus()
    184        
     185
    185186    def setStage(self, stage):
    186187        """Set the stage of the flight."""
     
    233234            self.emit("integer-changed", self._currentInteger)
    234235        self._set_text()
    235    
     236
    236237    def _handle_changed(self, widget):
    237238        """Handle the changed signal."""
     
    253254                      else str(self._currentInteger))
    254255        self._selfSetting = False
    255                
     256
    256257#------------------------------------------------------------------------------
    257258
  • src/mlx/gui/flight.py

    r393 r401  
    512512                    flight.writeIntoFile(f)
    513513            except Exception, e:
    514                 print "Failed to save flight:", str(e)
     514                print "Failed to save flight:", util.utf2unicode(str(e))
    515515                dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    516516                                           type = MESSAGETYPE_ERROR,
     
    555555                self._addFlight(bookedFlight)
    556556            except Exception, e:
    557                 print "Failed to load flight:", str(e)
     557                print "Failed to load flight:", util.utf2unicode(str(e))
    558558                dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    559559                                           type = MESSAGETYPE_ERROR,
Note: See TracChangeset for help on using the changeset viewer.