diff options
author | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
---|---|---|
committer | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
commit | 12cf076118570eebbff08c6b3090e0d4798447a1 (patch) | |
tree | 3ba25e17e3c3a5e82316558ba3864b955919ff72 /venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN | |
parent | c45662ff3923b34614ddcc8feb9195541166dcc5 (diff) |
no venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN')
2 files changed, 0 insertions, 103 deletions
diff --git a/venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN/__init__.py b/venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN/__init__.py deleted file mode 100644 index 6db322e..0000000 --- a/venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN/__init__.py +++ /dev/null @@ -1,103 +0,0 @@ -from collections import OrderedDict - -from faker.utils.decorators import slugify - -from .. import Provider as InternetProvider - - -class Provider(InternetProvider): - user_name_formats = ( - "{{last_romanized_name}}.{{first_romanized_name}}", - "{{first_romanized_name}}.{{last_romanized_name}}", - "{{first_romanized_name}}##", - "?{{last_romanized_name}}", - ) - - tlds = OrderedDict( - ( - ("cn", 0.8), - ("net", 0.1), - ("com", 0.05), - ("org", 0.05), - ) - ) - - second_level_domains = ( - "ac", - "com", - "edu", - "gov", - "mil", - "net", - "org", - "ah", - "bj", - "cq", - "fj", - "gd", - "gs", - "gz", - "gx", - "ha", - "hb", - "he", - "hi", - "hk", - "hl", - "hn", - "jl", - "js", - "jx", - "ln", - "mo", - "nm", - "nx", - "qh", - "sc", - "sd", - "sh", - "sn", - "sx", - "tj", - "xj", - "xz", - "yn", - "zj", - ) - - domain_formats = ( - "##", - "??", - "{{first_romanized_name}}", - "{{last_romanized_name}}", - "{{first_romanized_name}}{{last_romanized_name}}", - "{{last_romanized_name}}{{last_romanized_name}}", - "{{first_romanized_name}}{{first_romanized_name}}", - ) - - @slugify - def domain_word(self) -> str: - pattern: str = self.random_element(self.domain_formats) - if "#" in pattern or "?" in pattern: - return self.bothify(pattern) - else: - return self.generator.parse(pattern) - - def domain_name(self, levels: int = 1) -> str: - if levels < 1: - raise ValueError("levels must be greater than or equal to 1") - if levels == 1: - domain_word = self.domain_word() - # Avoids he.cn as seen in issue #687 - while domain_word in self.second_level_domains: - domain_word = self.domain_word() - return domain_word + "." + self.tld() - elif levels == 2: - my_tld = self.tld() - if my_tld == "cn": - my_second_level: str = self.random_element(self.second_level_domains) - else: - my_second_level = self.domain_word() - return self.domain_word() + "." + my_second_level + "." + my_tld - else: - return self.domain_word() + "." + self.domain_name(levels - 1) diff --git a/venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN/__pycache__/__init__.cpython-311.pyc b/venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN/__pycache__/__init__.cpython-311.pyc Binary files differdeleted file mode 100644 index 35c4f32..0000000 --- a/venv/lib/python3.11/site-packages/faker/providers/internet/zh_CN/__pycache__/__init__.cpython-311.pyc +++ /dev/null |