<s> import logging <EOL> from common import bit9api <EOL> from connectors import VirusTotal <EOL> from ConfigParser import RawConfigParser <EOL> import sys <EOL> import requests <EOL> logging . basicConfig ( format = '<STR_LIT>' , level = logging . DEBUG ) <EOL> log = logging . getLogger ( __name__ ) <EOL> logging . getLogger ( "<STR_LIT>" ) . setLevel ( logging . WARNING ) <EOL> logging . getLogger ( "<STR_LIT>" ) . setLevel ( logging . WARNING ) <EOL> def main ( ) : <EOL> inifile = RawConfigParser ( { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : False , <EOL> "<STR_LIT>" : None , <EOL> "<STR_LIT>" : None , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : False , <EOL> "<STR_LIT>" : None , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : None , <EOL> } ) <EOL> inifile . read ( "<STR_LIT>" ) <EOL> config = { } <EOL> config [ "<STR_LIT>" ] = inifile . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> config [ "<STR_LIT>" ] = inifile . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> config [ "<STR_LIT>" ] = inifile . getboolean ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> config [ "<STR_LIT>" ] = inifile . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> config [ "<STR_LIT>" ] = inifile . getboolean ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> config [ "<STR_LIT>" ] = inifile . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> config [ "<STR_LIT>" ] = inifile . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> config [ "<STR_LIT>" ] = inifile . getboolean ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> log_file = inifile . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> if log_file : <EOL> file_handler = logging . FileHandler ( log_file ) <EOL> formatter = logging . Formatter ( '<STR_LIT>' ) <EOL> file_handler . setFormatter ( formatter ) <EOL> file_handler . setLevel ( logging . DEBUG ) <EOL> logging . getLogger ( ) . addHandler ( file_handler ) <EOL> if not config [ "<STR_LIT>" ] : <EOL> log . fatal ( "<STR_LIT>" ) <EOL> return <NUM_LIT:1> <EOL> if not config [ "<STR_LIT>" ] : <EOL> log . fatal ( "<STR_LIT>" ) <EOL> return <NUM_LIT:1> <EOL> if not config [ "<STR_LIT>" ] : <EOL> requests . packages . urllib3 . disable_warnings ( ) <EOL> log . info ( "<STR_LIT>" ) <EOL> for k , v in config . iteritems ( ) : <EOL> log . info ( "<STR_LIT>" % ( k , v ) ) <EOL> bit9 = bit9api . bit9Api ( <EOL> config [ "<STR_LIT>" ] , <EOL> token = config [ "<STR_LIT>" ] , <EOL> ssl_verify = config [ "<STR_LIT>" ] <EOL> ) <EOL> vt = VirusTotal . virusTotalConnector ( <EOL> bit9 , <EOL> vt_token = config [ "<STR_LIT>" ] , <EOL> allow_uploads = config [ "<STR_LIT>" ] , <EOL> connector_name = config [ "<STR_LIT>" ] , <EOL> download_location = config [ "<STR_LIT>" ] <EOL> ) <EOL> log . info ( "<STR_LIT>" ) <EOL> vt . start ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( main ( ) ) </s>
