Logo Search packages:      
Sourcecode: pythoncard version File versions  Download package

def textRouter::TextRouter::on_menuManilaDownloadStory_select (   self,
  event 
)

Download's a story.  Cool.

Definition at line 845 of file textRouter.py.

00845                                                       :
        """Download's a story.  Cool."""
        if not self.checkManilaAccounts(3):
            return

        curManilaAccount = self.theManilaAccounts[self.theCurrentManilaAccount]

        if not curManilaAccount.checkSetupOK():
            self.status(curManilaAccount.getErrorMessage())
            return

        listX = [ "%s" % curManilaAccount.storiesList[key][0] for key in curManilaAccount.storiesList.keys() ]
        dlg = ChooserDialog(self, "Story Download", \
                            "Choose a story to download...", \
                            listX, listX[0])

        result = dlg.showModal()

        if result.accepted:
            i = dlg.components.options.findString(dlg.components.options.stringSelection)
            if i == -1:
                self.status("No story selected for downloading.")
            else:
                msgNum = int(curManilaAccount.storiesList.keys()[i])
                self.showWaitMsg("Downloading story '%s' (msg num: %d)..." % \
                                 (listX[i],msgNum))
                story = curManilaAccount.manilaDownloadStory(msgNum)
                if curManilaAccount.anErrorOccured():
                    self.status("Story download failed: %s" % curManilaAccount.getErrorMessage())
                else:
                    self.updateTextBox(story["body"].replace("\r", "\n"))
                    self.updateSubject(story["subject"])
                    curManilaAccount.currentStory = i
                    if "opml" in story:
                        result = dialog.messageDialog(self, \
                                                    "Warning: The story you downloaded also contained an OPML version,\nif you save this text version of the story it may overwrite the OPML version.",
                                                    "Warning..", wx.ICON_EXCLAMATION | wx.OK)
                    self.status("Downloaded story '%s' (msg num: %d) successfully." % \
                                (listX[i],msgNum))
        else:
            self.status("Story download cancelled.")

        dlg.destroy()



    def on_menuManilaUploadStory_select(self, event):


Generated by  Doxygen 1.6.0   Back to index