#NEWLINE# def __init__( self , w , align = LEFT , width = RELATIVE_100 , min_width = None , left = 0 , right = 0 ) : #NEWLINE# #INDENT# '\n        :param w: a box, flow or fixed widget to pad on the left and/or right\n            this widget is stored as self.original_widget\n        :type w: Widget\n\n        :param align: one of: ``\'left\'``, ``\'center\'``, ``\'right\'``\n            (``\'relative\'``, *percentage* 0=left 100=right)\n\n        :param width: one of:\n\n            *given width*\n              integer number of columns for self.original_widget\n\n            ``\'pack\'``\n              try to pack self.original_widget to its ideal size\n\n            (``\'relative\'``, *percentage of total width*)\n              make width depend on the container\'s width\n\n            ``\'clip\'``\n              to enable clipping mode for a fixed widget\n\n        :param min_width: the minimum number of columns for\n            self.original_widget or ``None``\n        :type min_width: int\n\n        :param left: a fixed number of columns to pad on the left\n        :type left: int\n\n        :param right: a fixed number of columns to pad on the right\n        :type right: int\n\n        Clipping Mode: (width= ``\'clip\'``)\n        In clipping mode this padding widget will behave as a flow\n        widget and self.original_widget will be treated as a fixed\n        widget.  self.original_widget will will be clipped to fit\n        the available number of columns.  For example if align is\n        ``\'left\'`` then self.original_widget may be clipped on the right.\n\n        >>> size = (7,)\n        >>> def pr(w):\n        ...     for t in w.render(size).text:\n        ...         print "|%s|" % (t.decode(\'ascii\'),)\n        >>> pr(Padding(Text(u"Head"), (\'relative\', 20), \'pack\'))\n        | Head  |\n        >>> pr(Padding(Divider(u"-"), left=2, right=1))\n        |  ---- |\n        >>> pr(Padding(Divider(u"*"), \'center\', 3))\n        |  ***  |\n        >>> p=Padding(Text(u"1234"), \'left\', 2, None, 1, 1)\n        >>> p\n        <Padding flow widget <Text flow widget \'1234\'> left=1 right=1 width=2>\n        >>> pr(p)   # align against left\n        | 12    |\n        | 34    |\n        >>> p.align = \'right\'\n        >>> pr(p)   # align against right\n        |    12 |\n        |    34 |\n        >>> pr(Padding(Text(u"hi\\nthere"), \'right\', \'pack\')) # pack text first\n        |  hi   |\n        |  there|\n        ' #NEWLINE# self . __super . __init__ ( w ) #NEWLINE# if ( ( type ( align ) == tuple ) and ( align [ 0 ] in ( 'fixed left' , 'fixed right' ) ) ) : #NEWLINE# #INDENT# if ( align [ 0 ] == 'fixed left' ) : #NEWLINE# #INDENT# left = align [ 1 ] #NEWLINE# align = LEFT #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# right = align [ 1 ] #NEWLINE# align = RIGHT #NEWLINE# #UNINDENT# #UNINDENT# if ( ( type ( width ) == tuple ) and ( width [ 0 ] in ( 'fixed left' , 'fixed right' ) ) ) : #NEWLINE# #INDENT# if ( width [ 0 ] == 'fixed left' ) : #NEWLINE# #INDENT# left = width [ 1 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# right = width [ 1 ] #NEWLINE# #UNINDENT# width = RELATIVE_100 #NEWLINE# #UNINDENT# if ( width is None ) : #NEWLINE# #INDENT# width = CLIP #NEWLINE# #UNINDENT# self . left = left #NEWLINE# self . right = right #NEWLINE# ( self . _align_type , self . _align_amount ) = normalize_align ( align , PaddingError ) #NEWLINE# ( self . _width_type , self . _width_amount ) = normalize_width ( width , PaddingError ) #NEWLINE# self . min_width = min_width