(self, res, *args)
Check that the return code is OK.

        It also prints out what happened (which would end
        up /dev/null'ed in non-verbose mode)
Check that the return code is OK.
Check that the return code is OK .
def assertok(self, res, *args):
        """Check that the return code is OK.

        It also prints out what happened (which would end
        up /dev/null'ed in non-verbose mode)
        """
        if 'uid FETCH' in args[0] and not self.verbose_mails:
            res = utils.shorten(res, 140)
        if 'SEARCH' in args[0]:
            res = utils.shorten(res, 140)
        self.logger.debug("{} = {}".format(args, res))
        if res[0] not in ["OK", "BYE"]:
            self.logger.error(
                __("{} returned {} - aborting".format(args, res)))
            raise ISBGError(__exitcodes__['imap'] if self.exitcodes else -1,
                            "\n%s returned %s - aborting\n" % (repr(args), res)
                            )
def assertok ( self , res , * args ) : if 'uid FETCH' in args [ 0 ] and not self . verbose_mails : res = utils . shorten ( res , 140 ) if 'SEARCH' in args [ 0 ] : res = utils . shorten ( res , 140 ) self . logger . debug ( "{} = {}" . format ( args , res ) ) if res [ 0 ] not in [ "OK" , "BYE" ] : self . logger . error ( __ ( "{} returned {} - aborting" . format ( args , res ) ) ) raise ISBGError ( __exitcodes__ [ 'imap' ] if self . exitcodes else - 1 , "\n%s returned %s - aborting\n" % ( repr ( args ) , res ) )