Skip to content

Commit

Permalink
Update of IANA() infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Jun 17, 2018
1 parent e1d639b commit 07b9049
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion PyFunceble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
from PyFunceble.production import Production

CURRENT_DIRECTORY = getcwd() + directory_separator
VERSION = "0.82.3.dev-beta"
VERSION = "0.82.4.dev-beta"

CONFIGURATION_FILENAME = ".PyFunceble.yaml"

Expand Down
35 changes: 21 additions & 14 deletions PyFunceble/iana.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def _referer(cls, extension):
"amsterdam": "whois.nic.amsterdam",
"analytics": "whois.nic.analytics",
"aramco": "whois.nic.aramco",
"arte": "whois.nic.arte",
"as": "whois.nic.as",
"athleta": "whois.nic.athleta",
"audible": "whois.nic.audible",
"author": "whois.nic.author",
Expand All @@ -134,6 +136,7 @@ def _referer(cls, extension):
"calvinklein": "whois.nic.calvinklein",
"caravan": "whois.nic.caravan",
"cartier": "whois.nic.cartier",
"caseih": "whois.nic.caseih",
"cbn": "whois.nic.cbn",
"cbre": "whois.nic.cbre",
"cd": "chois.nic.cd",
Expand All @@ -156,6 +159,7 @@ def _referer(cls, extension):
"duns": "whois.nic.duns",
"dupont": "whois.nic.dupont",
"earth": "whois.nic.earth",
"energy": "whois.nic.energy",
"epost": "whois.nic.epost",
"everbank": "whois.nic.everbank",
"farmers": "whois.nic.farmers",
Expand Down Expand Up @@ -229,33 +233,36 @@ def _referer(cls, extension):
"ps": "whois.pnina.ps",
"ren": "whois.nic.ren",
"rw": "whois.ricta.org.rw",
"shaw": "whois.afilias-srs.net",
"shop": "whois.nic.shop",
"sl": "whois.nic.sl",
"stream": "whois.nic.stream",
"tokyo": "whois.nic.tokyo",
"tvs": "whois.nic.tvs",
"uno": "whois.nic.uno",
"za": "whois.registry.net.za",
"xn--e1a4c": "whois.eu",
"xn--ses554g": "whois.registry.knet.cn",
}

if extension in manual_server:
return manual_server[extension]
whois_record = Lookup().whois(
PyFunceble.CONFIGURATION["iana_whois_server"], "hello." + extension
)

else:
whois_record = Lookup().whois(
PyFunceble.CONFIGURATION["iana_whois_server"], "hello." + extension, 10
)
if whois_record:
regex_referer = r"(refer:)\s+(.*)"

if whois_record:
regex_referer = r"(refer:)\s+(.*)"
matched = Regex(
whois_record, regex_referer, return_data=True, rematch=True
).match()

matched = Regex(
whois_record, regex_referer, return_data=True, rematch=True
).match()
if matched:
return matched[1]

if matched:
return matched[1]
if extension in manual_server:
return manual_server[extension]

return None
return None

def _extensions(self, line):
"""
Expand Down
9 changes: 5 additions & 4 deletions iana-domains-db.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"aaa": "whois.nic.aaa",
"aarp": "whois.nic.aarp",
"abarth": "whois.afilias-srs.net",
"abarth": null,
"abb": "whois.nic.abb",
"abbott": "whois.afilias-srs.net",
"abbvie": "whois.afilias-srs.net",
Expand Down Expand Up @@ -243,6 +243,7 @@
"ch": "whois.nic.ch",
"chanel": "whois.nic.chanel",
"channel": "whois.nic.google",
"charity": "whois.nic.charity",
"chase": "whois.nic.chase",
"chat": "whois.nic.chat",
"cheap": "whois.nic.cheap",
Expand Down Expand Up @@ -377,7 +378,7 @@
"dunlop": "whois.nic.dunlop",
"duns": "whois.nic.duns",
"dupont": "whois.nic.dupont",
"durban": "durban-whois.registry.net.za",
"durban": null,
"dvag": "whois.ksregistry.net",
"dvr": "whois.nic.dvr",
"dz": "whois.nic.dz",
Expand Down Expand Up @@ -467,7 +468,7 @@
"ford": "whois.nic.ford",
"forex": "whois.nic.forex",
"forsale": "whois.nic.forsale",
"forum": "whois.nic.forum",
"forum": null,
"foundation": "whois.nic.foundation",
"fox": "whois.nic.fox",
"fr": "whois.nic.fr",
Expand Down Expand Up @@ -949,7 +950,7 @@
"ott": "whois.nic.ott",
"ovh": "whois-ovh.nic.fr",
"pa": null,
"page": "whois.nic.google",
"page": null,
"pamperedchef": null,
"panasonic": "whois.nic.gmo",
"panerai": null,
Expand Down
2 changes: 1 addition & 1 deletion version.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
current_version: 0.82.3.dev-beta
current_version: 0.82.4.dev-beta
deprecated: [0.0.0, 0.0.1, 0.65.0, 0.67.1, 0.68.0, 0.69.3, 0.69.5, 0.70.4, 0.71.2,
0.72.7, 0.73.1, 0.74.5, 0.75.1, 0.76.2, 0.77.0, 0.78.0, 0.79.1, 0.80.9, 0.81.8]
force_update:
Expand Down

0 comments on commit 07b9049

Please sign in to comment.