<s> from . search_command import SearchCommand <EOL> from . import csv <EOL> class StreamingCommand ( SearchCommand ) : <EOL> """<STR_LIT>""" <EOL> def stream ( self , records ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( '<STR_LIT>' ) <EOL> def _execute ( self , operation , reader , writer ) : <EOL> try : <EOL> for record in operation ( SearchCommand . records ( reader ) ) : <EOL> writer . writerow ( record ) <EOL> except Exception as e : <EOL> from traceback import format_exc <EOL> from sys import exit <EOL> self . logger . error ( format_exc ( ) ) <EOL> exit ( <NUM_LIT:1> ) <EOL> def _prepare ( self , argv , input_file ) : <EOL> ConfigurationSettings = type ( self ) . ConfigurationSettings <EOL> argv = argv [ <NUM_LIT:2> : ] <EOL> if input_file is None : <EOL> reader = None <EOL> else : <EOL> reader = csv . DictReader ( input_file ) <EOL> return ConfigurationSettings , self . stream , argv , reader <EOL> class ConfigurationSettings ( SearchCommand . ConfigurationSettings ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def local ( self ) : <EOL> """<STR_LIT>""" <EOL> return type ( self ) . _local <EOL> _local = False <EOL> @ property <EOL> def overrides_timeorder ( self ) : <EOL> """<STR_LIT>""" <EOL> return type ( self ) . _overrides_timeorder <EOL> _overrides_timeorder = False <EOL> @ property <EOL> def retainsevents ( self ) : <EOL> """<STR_LIT>""" <EOL> return type ( self ) . _retainsevents <EOL> _retainsevents = True <EOL> @ property <EOL> def streaming ( self ) : <EOL> """<STR_LIT>""" <EOL> return True <EOL> @ classmethod <EOL> def fix_up ( cls , command ) : <EOL> """<STR_LIT>""" <EOL> if command . stream == StreamingCommand . stream : <EOL> raise AttributeError ( '<STR_LIT>' ) <EOL> return </s>
