def __init__(self, persistent_dict_cls=PersistentDictionary, thread_cls=threading.Thread, open_file_func=open, open_process_func=subprocess.Popen, smtp_client_cls=smtplib.SMTP, time_func=time.time): self.open_file_func = open_file_func self.open_process_func = open_process_func self.smtp_client_cls = smtp_client_cls self.persistent_dict_cls = persistent_dict_cls self.time_func = time_func self.thread_cls = thread_cls self.number_of_git_blames_running = 0 self.building_blocks = self._parse_whitelist_file("building_blocks", BuildingBlock) self.third_party_whitelist = self._parse_whitelist_file("third_party_whitelist", ThirdPartyWhitelistEntry) self.known_errors = self._parse_whitelist_file("known_errors", KnownError) self.email_remapping = dict((e["remap"], e["to"]) for e in self._read_json_file("email_remapping")) self.watch_all_errors, self.watch_only_if_blamed = self._parse_watchers_file("watched_files") self.repository = get_repository(open_process_func=open_process_func) self.extract_base_path_pattern = re.compile('^.*/%s/?(.*)$' % config.report_runtime_package_directory_name) self.only_blame_patterns = [re.compile(p) for p in config.only_blame_filepaths_matching] self.lock = threading.RLock() self.errors_seen = None self._refresh_errors_seen() self.persist_thread = self.thread_cls(target=self._run_background_update_thread) self.persist_thread.daemon = True self.persist_thread.start()
def __init__(self, *args, **kwargs): super(FlawlessThriftServiceHandler, self).__init__(*args, **kwargs) self.number_of_git_blames_running = 0 self.repository = get_repository(open_process_func=self.open_process_func) self.lock = threading.RLock() self.errors_seen = None self._refresh_errors_seen() self.persist_thread = self.thread_cls(target=self._run_background_update_thread) self.persist_thread.daemon = True self.persist_thread.start()
def __init__(self, *args, **kwargs): super(FlawlessThriftServiceHandler, self).__init__(*args, **kwargs) self.number_of_git_blames_running = 0 self.repository = get_repository( open_process_func=self.open_process_func) self.lock = threading.RLock() self.errors_seen = None self._refresh_errors_seen() self.persist_thread = self.thread_cls( target=self._run_background_update_thread) self.persist_thread.daemon = True self.persist_thread.start()
def __init__(self, persistent_dict_cls=PersistentDictionary, thread_cls=threading.Thread, open_file_func=open, open_process_func=subprocess.Popen, smtp_client_cls=smtplib.SMTP, time_func=time.time): self.open_file_func = open_file_func self.open_process_func = open_process_func self.smtp_client_cls = smtp_client_cls self.persistent_dict_cls = persistent_dict_cls self.time_func = time_func self.thread_cls = thread_cls self.number_of_git_blames_running = 0 self.building_blocks = self._parse_whitelist_file( "building_blocks", BuildingBlock) self.third_party_whitelist = self._parse_whitelist_file( "third_party_whitelist", ThirdPartyWhitelistEntry) self.known_errors = self._parse_whitelist_file("known_errors", KnownError) self.email_remapping = dict( (e["remap"], e["to"]) for e in self._read_json_file("email_remapping")) self.watch_all_errors, self.watch_only_if_blamed = self._parse_watchers_file( "watched_files") self.repository = get_repository(open_process_func=open_process_func) self.extract_base_path_pattern = re.compile( '^.*/%s/?(.*)$' % config.report_runtime_package_directory_name) self.only_blame_patterns = [ re.compile(p) for p in config.only_blame_filepaths_matching ] self.lock = threading.RLock() self.errors_seen = None self._refresh_errors_seen() self.persist_thread = self.thread_cls( target=self._run_background_update_thread) self.persist_thread.daemon = True self.persist_thread.start()