# -*- coding: iso8859-1 -*- # # Copyright (C) 2006 CSIRO Australia # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of voluntary contributions made by many # individuals. For exact contribution history, see the revision # history and logs. # # Author: Conrad Parker import urllib user_agent = 'Mozilla/5.0 (compatible; AnnodexValidator/1.0; +http://validator.annodex.org/notbot.html)' class anxURLopener (urllib.URLopener): def __init__ (self, request_cmml=False): self.version = user_agent urllib.URLopener.__init__ (self) self.request_cmml = request_cmml def http_error (self, url, fp, errcode, errmsg, headers): self.url = url self.errcode = errcode self.errmsg = errmsg self.headers = headers raise IOError