From a23a39950a1651c9cea0e2f053ed2e3c5fe176de Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 21 Jul 2012 00:01:18 -0400 Subject: [PATCH] Apparently some special sites have no subdomain? --- pages/copyvios.mako | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/copyvios.mako b/pages/copyvios.mako index 90db49f..91f25b7 100644 --- a/pages/copyvios.mako +++ b/pages/copyvios.mako @@ -153,7 +153,10 @@ for special in site: if "closed" not in special and "private" not in special: full = urlparse(special["url"]).netloc - lang, project = full.rsplit(".", 2)[:2] + if full.count(".") == 1: # No subdomain, so use "www" + lang, project = "www", full.split(".")[0] + else: + lang, project = full.rsplit(".", 2)[:2] code = u"{0}::{1}".format(lang, special["dbname"]) name = special["code"].capitalize() languages.add((code, u"{0} ({1})".format(lang, name))) @@ -307,7 +310,7 @@ Site: - http:// + http:// - . + . - .org + .org