INNER CODE UNIT · Python

_read_domains

atenreiro/opensquat · opensquat/app.py:134

    def _read_domains(self):
        """Load the domain feed file into self.list_file_domains."""
        with open(self.domain_filename, mode='r', encoding='utf-8') as file_domains:
            for mydomains in file_domains:
                domain = mydomains.replace("\n", "")
                domain = domain.lower().strip()
                # Skip comments and empty lines
                if domain and not domain.startswith("#"):
                    self.list_file_domains.append(domain)

    def _read_keywords(self):
        """Load the keywords file into self.list_file_keywords."""
        with open(self.keywords_filename, mode='r', encoding='utf-8') as file_keywords:
            for line in file_keywords:
                line = line.strip()
                if line and not line.startswith("#"):
                    self.list_file_keywords.append(line)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…