mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
23 lines
524 B
Python
Executable file
23 lines
524 B
Python
Executable file
#!/usr/bin/python
|
|
|
|
# Data is from https://publicsuffix.org/list/public_suffix_list.dat
|
|
|
|
tldlist = []
|
|
|
|
with open('public_suffix_list.dat', 'rb') as f:
|
|
content = f.read()
|
|
content = content.decode('utf-8')
|
|
for line in content.splitlines():
|
|
if line.startswith('//') or not line:
|
|
continue
|
|
tldlist.append(line)
|
|
|
|
tldcount = len(tldlist)
|
|
|
|
print('''static const char* TLDTbl[%d] = {''' % tldcount)
|
|
|
|
for tld in tldlist:
|
|
print(' "%s",' % tld)
|
|
|
|
print('''};
|
|
static const qint16 TLDTblSize = %d;''' % tldcount)
|