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

def manilaaccount::ManilaAccount::manilaSetHPFromOutline (   self,
  filename 
)

Sets the Manila homepage from an OPML file.

Definition at line 359 of file manilaaccount.py.

00359                                               :
        """Sets the Manila homepage from an OPML file."""
        boolTrue = xmlrpclib.Boolean(1)

        if (not self.checkSetupOK()):
            return 0

        try:
            file = open(filename, "r")
            opmlDoc = file.read()
            #print opmlDoc
            file.close()
        except IOError, e:
            self.setErrorMessage("Couldn't open file '%s' for sending to Manila server." % filename)
            return

        try:
            self.currentHPMsgNum  = self.manilaSite.manila.homepage.getMsgNum(self.prefs["username"], \
                                                                              self.getPassword(), \
                                                                              self.settings["sitename"])
        except xmlrpclib.Fault, e:
            self.setErrorMessage("Error getting current homepage message number: %s" % e.faultString)
            return 0
        
        
        rendererInfo = { 'flRenderOnEntry' : boolTrue, 'name' : 'pikeRenderer' }
        bodyType = "text/x-opml"
        
        try:
            self.manilaSite.manila.message.set(self.prefs["username"], \
                                               self.getPassword(), \
                                               self.settings["sitename"], \
                                               self.currentHPMsgNum, \
                                               "Weblog", \
                                               opmlDoc, \
                                               bodyType,\
                                               {},
                                               rendererInfo)
            
            self.setErrorMessage("")
        except xmlrpclib.Fault, e:
            self.setErrorMessage("Error setting Manila homepage: %s" % e.faultString)
            return 0
        
        return 1


    def setPrefs(self, siteurl="", rpcserver="", username="", password="", \


Generated by  Doxygen 1.6.0   Back to index