aboutsummaryrefslogtreecommitdiff
path: root/models/openid-php-openid-782224d/admin/gettlds.py
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-12-15 20:07:48 -0500
committerCash Costello <cash.costello@gmail.com>2011-12-15 20:07:48 -0500
commit580cd62f0a4fac5dba37a8a152afaecd99e8c767 (patch)
treead71f414174ffe91536ecb9875377ce2682b53fc /models/openid-php-openid-782224d/admin/gettlds.py
parentd9bf22a0e29c2a70049443a0ae8521a2c0492c8b (diff)
downloadelgg-580cd62f0a4fac5dba37a8a152afaecd99e8c767.tar.gz
elgg-580cd62f0a4fac5dba37a8a152afaecd99e8c767.tar.bz2
removed old libraries - depends on openid_api now
Diffstat (limited to 'models/openid-php-openid-782224d/admin/gettlds.py')
-rw-r--r--models/openid-php-openid-782224d/admin/gettlds.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/models/openid-php-openid-782224d/admin/gettlds.py b/models/openid-php-openid-782224d/admin/gettlds.py
deleted file mode 100644
index 430063808..000000000
--- a/models/openid-php-openid-782224d/admin/gettlds.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""
-Fetch the current TLD list from the IANA Web site, parse it, and print
-an expression suitable for direct insertion into each library's trust
-root validation module
-
-Usage:
- python gettlds.py (php|python|ruby)
-
-Then cut-n-paste.
-"""
-
-import urllib2
-
-import sys
-
-langs = {
- 'php': (r"'/\.(",
- "'", "|", "|' .",
- r")\.?$/'"),
- 'python': ("['",
- "'", "', '", "',",
- "']"),
- 'ruby': ("%w'",
- "", " ", "",
- "'"),
- }
-
-lang = sys.argv[1]
-prefix, line_prefix, separator, line_suffix, suffix = langs[lang]
-
-f = urllib2.urlopen('http://data.iana.org/TLD/tlds-alpha-by-domain.txt')
-tlds = []
-output_line = ""
-for input_line in f:
- if input_line.startswith('#'):
- continue
-
- tld = input_line.strip().lower()
- new_output_line = output_line + prefix + tld
- if len(new_output_line) > 60:
- print output_line + line_suffix
- output_line = line_prefix + tld
- else:
- output_line = new_output_line
- prefix = separator
-
-print output_line + suffix