# -*- 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 from urllib import quote_plus from anxvalidator.form import Form from anxvalidator.urlvalidate import UrlValidate class Result (object): def __init__(self, url, force_media=False): self.url = url self.u = UrlValidate (url, force_media=force_media) if (self.u.is_annodex): self.c = UrlValidate (url, request_cmml=True) else: self.c = None def link (self): return '%s' % (self.url, self.url) def __str__(self): s = '''

Results

for %s:


%s
''' % (self.link(), self.u.__str__()) if (self.c): s += '''

With HTTP request header Accept: text/x-cmml:

%s
''' % (self.c.__str__()) if False: # this service seems to be broken s += '''

Check this URL with other services:

''' % (quote_plus(self.url)) s += '''
''' return s