menu/lcdmenu.py
def _format(self, message, pre="", post="", just=-1):
        """
        Formats a message for the screen, padding any shortfall with spaces.
        :param message: The main message to display
        :type message: basestring
        :param pre: A possible prefix for the message
        :param post: A possible suffix displayed a the RHS
        :param just: -1 for left justified, 0 for center and 1 for right
        :return: The formatted string, padded with spaces to the width of the
        screen
        """
        length = self.lcd.cols - len(pre) - len(post)
        if len(message) > length:
            start = self._counter % (length + 1)
            justified = (message + "|" + message)[start:start + length]
        else:
            justified = message
        if just < 0:
            justified = justified.ljust(length)
        elif just == 0:
            justified = justified.center(length)
        else:
            justified = justified.rjust(length)
        return pre + justified + post

        Formats a message for the screen, padding any shortfall with spaces.
        :param message: The main message to display
        :type message: basestring
        :param pre: A possible prefix for the message
        :param post: A possible suffix displayed a the RHS
        :param just: -1 for left justified, 0 for center and 1 for right
        :return: The formatted string, padded with spaces to the width of the
        screen
        
Formats a message for the screen, padding any shortfall with spaces.
Formats a message for the screen padding any shortfall with spaces .
def _format(self, message, pre="", post="", just=-1):
        length = self.lcd.cols - len(pre) - len(post)
        if len(message) > length:
            start = self._counter % (length + 1)
            justified = (message + "|" + message)[start:start + length]
        else:
            justified = message
        if just < 0:
            justified = justified.ljust(length)
        elif just == 0:
            justified = justified.center(length)
        else:
            justified = justified.rjust(length)
        return pre + justified + post
def _format ( self , message , pre = "" , post = "" , just = - 1 ) : length = self . lcd . cols - len ( pre ) - len ( post ) if len ( message ) > length : start = self . _counter % ( length + 1 ) justified = ( message + "|" + message ) [ start : start + length ] else : justified = message if just < 0 : justified = justified . ljust ( length ) elif just == 0 : justified = justified . center ( length ) else : justified = justified . rjust ( length ) return pre + justified + post
Formats a message for the screen, padding any shortfall with spaces.
Formats a message for the screen padding any shortfall with spaces .
"""
        Formats a message for the screen, padding any shortfall with spaces.
        :param message: The main message to display
        :type message: basestring
        :param pre: A possible prefix for the message
        :param post: A possible suffix displayed a the RHS
        :param just: -1 for left justified, 0 for center and 1 for right
        :return: The formatted string, padded with spaces to the width of the
        screen
        """
The formatted string, padded with spaces to the width of the
screen
The formatted string padded with spaces to the width of the screen
self
message
The main message to display
The main message to display
pre
A possible prefix for the message
A possible prefix for the message
post
A possible suffix displayed a the RHS
A possible suffix displayed a the RHS
just
1 for left justified, 0 for center and 1 for right
1 for left justified 0 for center and 1 for right