def main(): """ The main method to launch the scanner. """ # Move to the project directory. project_dir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir) os.chdir(project_dir) conf_file = os.path.join('conf', CONFIG_FILE) config = SafeConfigParser() config.read(conf_file) scanner = Scanner(config) scanner.setup_environment() if get_boolean(config, 'Steps', 'download_new_creative_ids'): scanner.download_new_creative_ids() if get_boolean(config, 'Steps', 'download_creatives'): scanner.download_creatives() if get_boolean(config, 'Steps', 'browse_creatives'): scanner.browse_creatives('https') if get_boolean(config, 'Steps', 'browse_creatives_over_http'): scanner.browse_creatives('http') if get_boolean(config, 'Steps', 'check_compliance'): scanner.check_compliance() if get_boolean(config, 'Steps', 'upload_creatives'): scanner.upload_creatives() if get_boolean(config, 'Steps', 'compress_log_file'): scanner.compress_log_file() if get_boolean(config, 'Steps', 'remove_temp_files'): scanner.remove_temp_files() sys.exit(0)