<s> from __future__ import absolute_import <EOL> from openpyxl . compat import safe_string <EOL> from openpyxl . descriptors import Bool , MinMax , Min , Alias , NoneSet <EOL> from . hashable import HashableObject <EOL> horizontal_alignments = ( <EOL> "<STR_LIT>" , "<STR_LIT:left>" , "<STR_LIT>" , "<STR_LIT:right>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , ) <EOL> vertical_aligments = ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> ) <EOL> class Alignment ( HashableObject ) : <EOL> """<STR_LIT>""" <EOL> tagname = "<STR_LIT>" <EOL> __fields__ = ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> horizontal = NoneSet ( values = horizontal_alignments ) <EOL> vertical = NoneSet ( values = vertical_aligments ) <EOL> textRotation = NoneSet ( values = range ( <NUM_LIT> ) ) <EOL> textRotation . values . add ( <NUM_LIT:255> ) <EOL> text_rotation = Alias ( '<STR_LIT>' ) <EOL> wrapText = Bool ( allow_none = True ) <EOL> wrap_text = Alias ( '<STR_LIT>' ) <EOL> shrinkToFit = Bool ( allow_none = True ) <EOL> shrink_to_fit = Alias ( '<STR_LIT>' ) <EOL> indent = Min ( min = <NUM_LIT:0> ) <EOL> relativeIndent = Min ( min = <NUM_LIT:0> ) <EOL> justifyLastLine = Bool ( allow_none = True ) <EOL> readingOrder = Min ( min = <NUM_LIT:0> ) <EOL> def __init__ ( self , horizontal = None , vertical = None , <EOL> textRotation = <NUM_LIT:0> , wrapText = None , shrinkToFit = None , indent = <NUM_LIT:0> , relativeIndent = <NUM_LIT:0> , <EOL> justifyLastLine = None , readingOrder = <NUM_LIT:0> , text_rotation = None , <EOL> wrap_text = None , shrink_to_fit = None , mergeCell = None ) : <EOL> self . horizontal = horizontal <EOL> self . vertical = vertical <EOL> self . indent = indent <EOL> self . relativeIndent = relativeIndent <EOL> self . justifyLastLine = justifyLastLine <EOL> self . readingOrder = readingOrder <EOL> if text_rotation is not None : <EOL> textRotation = text_rotation <EOL> if textRotation is not None : <EOL> self . textRotation = int ( textRotation ) <EOL> if wrap_text is not None : <EOL> wrapText = wrap_text <EOL> self . wrapText = wrapText <EOL> if shrink_to_fit is not None : <EOL> shrinkToFit = shrink_to_fit <EOL> self . shrinkToFit = shrinkToFit <EOL> def __iter__ ( self ) : <EOL> for attr in self . __attrs__ : <EOL> value = getattr ( self , attr ) <EOL> if value is not None and value != <NUM_LIT:0> : <EOL> yield attr , safe_string ( value ) </s>
