save as => cancel

Bug #507137 reported by Matthieu Bizien
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
perroquet
Fix Committed
Low
Unassigned

Bug Description

If you click on "save as" then on "cancel" you have an exception

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/perroquetlib/gui.py", line 575, in on_imagemenuitemSaveAs_activate
    self.core.Save(True)
  File "/usr/lib/python2.6/dist-packages/perroquetlib/core.py", line 319, in Save
    self.gui.SetTitle(self.outputSavePath, False)
  File "/usr/lib/python2.6/dist-packages/perroquetlib/gui.py", line 210, in SetTitle
    newTitle += " - " + title
TypeError: cannot concatenate 'str' and 'NoneType' objects

Changed in perroquet:
status: New → Triaged
importance: Undecided → Low
milestone: none → 1.1.0
Revision history for this message
Matthieu Bizien (oao2005) wrote :

The issue is that if you click on cancel, you willn't have "" but None. So I have a patch:

class Core(object):
    def Save(self, saveAs = False):

        if saveAs or self.outputSavePath == "":
            self.outputSavePath = self.gui.AskSavePath()
            if self.outputSavePath == None:
                return

        self.gui.SetTitle(self.outputSavePath, False)
        saver = ExerciceSaver()
        saver.SetPath(self.outputSavePath)
        saver.SetVideoPath(self.videoPath)
        saver.SetExercicePath(self.exercicePath)
        saver.SetTranslationPath(self.translationPath)
        saver.SetCurrentSequence(self.currentSubId)
        saver.SetRepeatCount(self.repeatCount)
        saver.SetSequenceList(self.sequenceList)
        saver.Save()

        self.SetCanSave(False)

Changed in perroquet:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.