<s> """<STR_LIT>""" <EOL> from __future__ import print_function , absolute_import <EOL> from optparse import OptionParser <EOL> from sniffer . scanner import Scanner <EOL> from sniffer . runner import ScentSniffer <EOL> from sniffer . metadata import __version__ <EOL> import sys <EOL> import colorama <EOL> colorama . init ( ) <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def run ( sniffer_instance = None , wait_time = <NUM_LIT:0.5> , clear = True , args = ( ) , <EOL> debug = False ) : <EOL> """<STR_LIT>""" <EOL> if sniffer_instance is None : <EOL> sniffer_instance = ScentSniffer ( ) <EOL> if debug : <EOL> scanner = Scanner ( <EOL> sniffer_instance . watch_paths , <EOL> scent = sniffer_instance . scent , logger = sys . stdout ) <EOL> else : <EOL> scanner = Scanner ( <EOL> sniffer_instance . watch_paths , scent = sniffer_instance . scent ) <EOL> sniffer_instance . set_up ( tuple ( args ) , clear , debug ) <EOL> sniffer_instance . observe_scanner ( scanner ) <EOL> scanner . loop ( wait_time ) <EOL> def main ( sniffer_instance = None , test_args = ( ) , progname = sys . argv [ <NUM_LIT:0> ] , <EOL> args = sys . argv [ <NUM_LIT:1> : ] ) : <EOL> """<STR_LIT>""" <EOL> parser = OptionParser ( version = "<STR_LIT>" + __version__ ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , dest = "<STR_LIT>" , metavar = "<STR_LIT>" , <EOL> default = <NUM_LIT:0.5> , type = "<STR_LIT:float>" , <EOL> help = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , dest = "<STR_LIT>" , default = True , <EOL> action = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , dest = "<STR_LIT>" , default = [ ] , <EOL> action = "<STR_LIT>" , <EOL> help = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> ( options , args ) = parser . parse_args ( args ) <EOL> test_args = test_args + tuple ( options . test_args ) <EOL> if options . debug : <EOL> print ( "<STR_LIT>" , options ) <EOL> print ( "<STR_LIT>" , test_args ) <EOL> try : <EOL> print ( "<STR_LIT>" ) <EOL> run ( sniffer_instance , options . wait_time , options . clear_on_run , <EOL> test_args , options . debug ) <EOL> except KeyboardInterrupt : <EOL> print ( "<STR_LIT>" ) <EOL> except Exception : <EOL> import traceback <EOL> traceback . print_exc ( ) <EOL> return sys . exit ( <NUM_LIT:1> ) <EOL> return sys . exit ( <NUM_LIT:0> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> try : <EOL> import psyco <EOL> psyco . full ( ) <EOL> except ImportError : <EOL> pass <EOL> main ( ) </s>
