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

def bloggeraccount::BloggerAccount::checkSetupOK (   self,
  toCheck = 0 
)

Checks that the setup is OK for contacting a server.

Accepts an integer arguement, each bit specifies corresponds to one check, if the bit is
one the check is done.  If the argument is 0, all checks are done.
Returns 1 if the checks are passed, 0 if one fails.

Definition at line 277 of file bloggeraccount.py.

00277                                        :
        """Checks that the setup is OK for contacting a server.

        Accepts an integer arguement, each bit specifies corresponds to one check, if the bit is
        one the check is done.  If the argument is 0, all checks are done.
        Returns 1 if the checks are passed, 0 if one fails."""

        # do we need to have the settings entered ?
        if toCheck == 0 or toCheck & 1:
            if self.prefs['username'] == "" or self.prefs['rpcserver'] == "":
                self.setErrorMessage("You must setup the Blogger account details first.") 
                return 0

        # do we need to be logged in ?
        if toCheck == 0 or toCheck & 2:
            if self.getLoggedIn() == 0:
                self.setErrorMessage("You must login first.") 
                return 0

        # do we need to have an activeBlog chosen ?
        if toCheck == 0 or toCheck & 4:
            if self.getActiveBlog() == -1:
                self.setErrorMessage("You must choose a blog first.") 
                return 0
            
        # do we need to have downloaded list of previous posts
        if toCheck & 8:
            #if self.blogs[self.prefs["activeBlog"]-1]["previousPosts"] == []:
            if ("previousPosts" not in self.blogs[self.prefs["activeBlog"]-1]) or \
                   self.blogs[self.prefs["activeBlog"]-1]["previousPosts"] == []:
                self.setErrorMessage("You must download the previous posts first.") 
                return 0

        self.setErrorMessage("")
        return 1


    def getPassword(self):


Generated by  Doxygen 1.6.0   Back to index