<s> from . BIFFRecords import ColInfoRecord <EOL> class Column ( object ) : <EOL> def __init__ ( self , colx , parent_sheet ) : <EOL> if not ( isinstance ( colx , int ) and <NUM_LIT:0> <= colx <= <NUM_LIT:255> ) : <EOL> raise ValueError ( "<STR_LIT>" % colx ) <EOL> self . _index = colx <EOL> self . _parent = parent_sheet <EOL> self . _parent_wb = parent_sheet . get_parent ( ) <EOL> self . _xf_index = <NUM_LIT> <EOL> self . width = <NUM_LIT> <EOL> self . hidden = <NUM_LIT:0> <EOL> self . level = <NUM_LIT:0> <EOL> self . collapse = <NUM_LIT:0> <EOL> def set_style ( self , style ) : <EOL> self . _xf_index = self . _parent_wb . add_style ( style ) <EOL> def width_in_pixels ( self ) : <EOL> return int ( round ( self . width * <NUM_LIT> + <NUM_LIT> , <NUM_LIT:0> ) ) <EOL> def get_biff_record ( self ) : <EOL> options = ( self . hidden & <NUM_LIT> ) << <NUM_LIT:0> <EOL> options |= ( self . level & <NUM_LIT> ) << <NUM_LIT:8> <EOL> options |= ( self . collapse & <NUM_LIT> ) << <NUM_LIT:12> <EOL> return ColInfoRecord ( self . _index , self . _index , self . width , self . _xf_index , options ) . get ( ) </s>
