<s> from __future__ import absolute_import <EOL> from openpyxl . compat import safe_string <EOL> from openpyxl . descriptors import NoneSet , Typed , Bool , Alias <EOL> from . colors import ColorDescriptor <EOL> from . hashable import HashableObject <EOL> BORDER_NONE = None <EOL> BORDER_DASHDOT = '<STR_LIT>' <EOL> BORDER_DASHDOTDOT = '<STR_LIT>' <EOL> BORDER_DASHED = '<STR_LIT>' <EOL> BORDER_DOTTED = '<STR_LIT>' <EOL> BORDER_DOUBLE = '<STR_LIT>' <EOL> BORDER_HAIR = '<STR_LIT>' <EOL> BORDER_MEDIUM = '<STR_LIT>' <EOL> BORDER_MEDIUMDASHDOT = '<STR_LIT>' <EOL> BORDER_MEDIUMDASHDOTDOT = '<STR_LIT>' <EOL> BORDER_MEDIUMDASHED = '<STR_LIT>' <EOL> BORDER_SLANTDASHDOT = '<STR_LIT>' <EOL> BORDER_THICK = '<STR_LIT>' <EOL> BORDER_THIN = '<STR_LIT>' <EOL> class Side ( HashableObject ) : <EOL> """<STR_LIT>""" <EOL> __fields__ = ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> color = ColorDescriptor ( allow_none = True ) <EOL> style = NoneSet ( values = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) <EOL> border_style = Alias ( '<STR_LIT>' ) <EOL> def __init__ ( self , style = None , color = None , border_style = None ) : <EOL> if border_style is not None : <EOL> style = border_style <EOL> self . style = style <EOL> self . color = color <EOL> class Border ( HashableObject ) : <EOL> """<STR_LIT>""" <EOL> tagname = "<STR_LIT>" <EOL> __fields__ = ( '<STR_LIT:left>' , <EOL> '<STR_LIT:right>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> __elements__ = ( '<STR_LIT:start>' , '<STR_LIT:end>' , '<STR_LIT:left>' , '<STR_LIT:right>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> start = Typed ( expected_type = Side , allow_none = True ) <EOL> end = Typed ( expected_type = Side , allow_none = True ) <EOL> left = Typed ( expected_type = Side , allow_none = True ) <EOL> right = Typed ( expected_type = Side , allow_none = True ) <EOL> top = Typed ( expected_type = Side , allow_none = True ) <EOL> bottom = Typed ( expected_type = Side ) <EOL> diagonal = Typed ( expected_type = Side , allow_none = True ) <EOL> vertical = Typed ( expected_type = Side , allow_none = True ) <EOL> horizontal = Typed ( expected_type = Side , allow_none = True ) <EOL> outline = Bool ( ) <EOL> diagonalUp = Bool ( ) <EOL> diagonalDown = Bool ( ) <EOL> def __init__ ( self , left = Side ( ) , right = Side ( ) , top = Side ( ) , <EOL> bottom = Side ( ) , diagonal = Side ( ) , diagonal_direction = None , <EOL> vertical = None , horizontal = None , diagonalUp = False , diagonalDown = False , <EOL> outline = True , start = None , end = None ) : <EOL> self . left = left <EOL> self . right = right <EOL> self . top = top <EOL> self . bottom = bottom <EOL> self . diagonal = diagonal <EOL> self . vertical = vertical <EOL> self . horizontal = horizontal <EOL> self . diagonal_direction = diagonal_direction <EOL> self . diagonalUp = diagonalUp <EOL> self . diagonalDown = diagonalDown <EOL> self . outline = outline <EOL> self . start = start <EOL> self . end = end <EOL> def __iter__ ( self ) : <EOL> for attr in self . __attrs__ : <EOL> value = getattr ( self , attr ) <EOL> if value and attr != "<STR_LIT>" : <EOL> yield attr , value <EOL> elif attr == "<STR_LIT>" and not value : <EOL> yield attr , value <EOL> DEFAULT_BORDER = Border ( ) </s>
