<s> import re <EOL> from clom . _compat import number_types <EOL> __all__ = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> NOTSET = object ( ) <EOL> STDIN = <NUM_LIT:0> <EOL> STDOUT = <NUM_LIT:1> <EOL> STDERR = <NUM_LIT:2> <EOL> class BaseArg ( object ) : <EOL> def __init__ ( self , data ) : <EOL> self . data = data <EOL> def __str__ ( self ) : <EOL> raise NotImplemented <EOL> class RawArg ( BaseArg ) : <EOL> """<STR_LIT>""" <EOL> def __str__ ( self ) : <EOL> return str ( self . data ) <EOL> class LiteralArg ( BaseArg ) : <EOL> """<STR_LIT>""" <EOL> _find_unsafe = re . compile ( r'<STR_LIT>' ) . search <EOL> def __str__ ( self ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( self . data , number_types ) : <EOL> return str ( self . data ) <EOL> elif self . data is None or self . data == '<STR_LIT>' : <EOL> return "<STR_LIT>" <EOL> elif self . _find_unsafe ( self . data ) is None : <EOL> return self . data <EOL> d = str ( self . data ) <EOL> d = "<STR_LIT:'>" + d . replace ( "<STR_LIT:'>" , "<STR_LIT>" ) + "<STR_LIT:'>" <EOL> return d <EOL> class Arg ( BaseArg ) : <EOL> """<STR_LIT>""" <EOL> def __str__ ( self ) : <EOL> if self . data is None : <EOL> d = '<STR_LIT>' <EOL> else : <EOL> d = str ( self . data ) <EOL> if '<STR_LIT:U+0020>' in d : <EOL> d = '<STR_LIT:">' + d + '<STR_LIT:">' <EOL> return d </s>
