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

def manilaaccount::ManilaAccount::manilaSetHP (   self,
  text,
  autoRender = "Yes" 
)

Sets the Manila homepage to be the current text.

Definition at line 267 of file manilaaccount.py.

00267                                                  :
        """Sets the Manila homepage to be the current text."""
        boolTrue = xmlrpclib.Boolean(1)

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

        if text == "":
            self.setErrorMessage("Text to blog can't be blank. (You may want to check the output mode.)")
            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
        
        
        defRendererInfo = { 'flRenderOnEntry' : boolTrue, 'name' : 'pikeRenderer' }
        defWindowInfo ={'height' : 100, 'width' : 100, 'top' : 10, 'left' : 10, 'right' : 110, 'bottom' : 110,\
                        'scrollLine' : 1, 'expansionState' : 1}
        defBodyType = "text/x-outline-tabbed"
        
        #print self.currentHPContent
        if ("msgnum" in self.currentHPContent) and (self.currentHPMsgNum == self.currentHPContent["msgnum"]):
            subject = ("subject" in self.currentHPContent) and \
                      self.currentHPContent["subject"]
            bodyType = ("bodyType" in self.currentHPContent) and \
                      self.currentHPContent["bodyType"] or defBodyType
            windowInfo = ("windowInfo" in self.currentHPContent) and \
                         self.currentHPContent["windowInfo"] or defWindowInfo

            if autoRender == "Yes":
                rendererInfo = ("rendererInfo" in self.currentHPContent) and \
                               self.currentHPContent["rendererInfo"] or defRendererInfo
            else:
                #print "no"
                # we were gonna sort out a renderer that doesn't insert "<BR>"'s here, but one could not
                # be found.  it needs investigating futher.
                rendererInfo = defRendererInfo

        else:
            subject = ""
            bodyType = defBodyType
            windowInfo = defWindowInfo
            if autoRender == "Yes":
                rendererInfo = defRendererInfo
            else:
                #print "no"
                rendererInfo = defRendererInfo
                
            
        #print subject
        #print bodyType
        #print windowInfo
        #print rendererInfo

        try:
            self.manilaSite.manila.message.set(self.prefs["username"], \
                                               self.getPassword(), \
                                               self.settings["sitename"], \
                                               self.currentHPMsgNum, \
                                               subject, \
                                               text, \
                                               bodyType,\
                                               windowInfo,\
                                               rendererInfo)
            
            self.setErrorMessage("")
        except xmlrpclib.Fault, e:
            self.setErrorMessage("Error setting current Manila homepage: %s" % e.faultString)
            return 0
        
        return 1


    def manilaSetHomepageFromMSG(self, msgNum):


Generated by  Doxygen 1.6.0   Back to index