<s> from . EntityUtil import Cleaner , ALL <EOL> from . RuleSet import RuleSet <EOL> class ExtraStatement ( RuleSet ) : <EOL> def __init__ ( self , operator , statement , comment , styleSheet = None ) : <EOL> self . extra = True <EOL> self . nested = False <EOL> self . selector = self . operator = operator . strip ( ) <EOL> self . comment = comment <EOL> self . statement = statement <EOL> self . styleSheet = styleSheet <EOL> self . fixedSelector = '<STR_LIT>' <EOL> self . fixedStatement = '<STR_LIT>' <EOL> self . browser = ALL <EOL> self . toBeUsed = { } <EOL> def isImport ( self ) : <EOL> return self . operator == '<STR_LIT>' <EOL> def rebase ( self ) : <EOL> self . fixedSelector = '<STR_LIT>' <EOL> self . fixedStatement = '<STR_LIT>' <EOL> def isOpmOperator ( self ) : <EOL> return self . operator . find ( '<STR_LIT>' ) != - <NUM_LIT:1> <EOL> def compress ( self , browser = ALL ) : <EOL> if self . isOpmOperator ( ) : <EOL> return '<STR_LIT>' <EOL> if not self . browser & browser : <EOL> return '<STR_LIT>' <EOL> msg = Cleaner . clean ( self . statement ) <EOL> if not msg . endswith ( '<STR_LIT:}>' ) and not msg . endswith ( '<STR_LIT:;>' ) : <EOL> msg = msg + '<STR_LIT:;>' <EOL> return msg <EOL> def fixed ( self , config ) : <EOL> return self . statement . strip ( ) if len ( self . comment ) == <NUM_LIT:0> else self . comment + '<STR_LIT:\n>' + self . statement . strip ( ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT:%s>' % self . statement </s>
