Next / Previous / Contents / TCC Help System / NM Tech homepage

51.19. PageGet.__str__(): Debug display

This class is provided with a .__str__() function for debug display of PageGet objects.

pageget.py
# - - -   P a g e G e t . _ _ s t r _ _   - - -

    TIME_FORMAT  =  "%Y-%m-%dT%H:%M:%S %z"

    def __str__ ( self ):
        "Output self as a string"
        humanDate  =  self.when.strftime ( self.TIME_FORMAT )

        if  self.username != "-":
            isPassword  =  " [PWD]"
        else:
            isPassword  =  ""

        return ( "%s %s%s %s %s %s" %
                 ( humanDate, self.accessor, isPassword,
                   self.command, self.status, self.url ) )