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

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

Upload's a story.

Definition at line 891 of file textRouter.py.

00891                                                     :
        """Upload's a story."""
        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() ]

        defIndex = ((curManilaAccount.currentStory != -1) and [curManilaAccount.currentStory] or [0])[0]

        dlg = ChooserDialog(self, "Story Upload", \
                            "Choose a story to upload the text to...", \
                            listX, listX[defIndex])
        dlg.showModal()

        if dlg.accepted():
            i = dlg.components.options.findString(dlg.components.options.stringSelection)
            if i == -1:
                self.status("No story selected for uploading text to.")
            else:
                msgNum = int(curManilaAccount.storiesList.keys()[i])
                self.showWaitMsg("Uploading to story '%s' (msg num: %d)..." % \
                                 (listX[i],msgNum))
                curManilaAccount.manilaUploadStory(msgNum, self.getSubjectText(),\
                                                   self.getOutputText(), "text/x-outline-tabbed")
                if curManilaAccount.anErrorOccured():
                    self.status("Story upload failed: %s" % curManilaAccount.getErrorMessage())
                else:
                    self.status("Uploaded to story '%s' (msg num: %d) successfully." % \
                                (listX[i],msgNum))
        else:
            self.status("Story upload cancelled.")

        dlg.destroy()



    def on_menuManilaUploadPicture_select(self, event):


Generated by  Doxygen 1.6.0   Back to index