From 00bd549c0c589668fac543cfef07f1376450235e Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 5 Mar 2014 19:24:58 +0100 Subject: [PATCH] Remove duplicate content type map. --- linkcheck/parser/__init__.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/linkcheck/parser/__init__.py b/linkcheck/parser/__init__.py index 8f8c634b..912de57d 100644 --- a/linkcheck/parser/__init__.py +++ b/linkcheck/parser/__init__.py @@ -17,28 +17,11 @@ """ Main functions for link parsing """ -from ..checker import get_url_from from .. import winutil, fileutil, log, LOG_CHECK, strformat from ..htmlutil import linkparse from ..HtmlParser import htmlsax from ..bookmarks import firefox -ContentMimetypes = { - "text/html": "html", - "application/xhtml+xml": "html", - # Include PHP file which helps when checking local .php files. - # It does not harm other URL schemes like HTTP since HTTP servers - # should not send this content type. They send text/html instead. - "application/x-httpd-php": "html", - "text/css": "css", - "application/x-shockwave-flash": "swf", - "application/msword": "word", - "text/plain+linkchecker": "text", - "text/plain+opera": "opera", - "text/plain+chromium": "chromium", - "application/x-plist+safari": "safari", - "text/vnd.wap.wml": "wml", - } def parse_url(url_data): """Parse a URL.""" @@ -49,7 +32,7 @@ def parse_url(url_data): return parse_firefox(url_data) # determine parse routine according to content types mime = url_data.get_content_type() - key = ContentMimetypes[mime] + key = url_data.ContentMimetypes[mime] return globals()["parse_"+key](url_data)