comparison bitsyblog/utils.py @ 5:794dac65c9b6

comment about how brittle the CSS validation is
author k0s <k0scist@gmail.com>
date Mon, 05 Oct 2009 09:06:10 -0400
parents e3823be6a423
children c228832db770
comparison
equal deleted inserted replaced
4:60cfc4b825f0 5:794dac65c9b6
13 """use a webservice to determine if the argument is valid css""" 13 """use a webservice to determine if the argument is valid css"""
14 url = 'http://jigsaw.w3.org/css-validator/validator?text=%s' 14 url = 'http://jigsaw.w3.org/css-validator/validator?text=%s'
15 url = url % urllib.quote_plus(css) 15 url = url % urllib.quote_plus(css)
16 foo = urllib2.urlopen(url) 16 foo = urllib2.urlopen(url)
17 text = foo.read() 17 text = foo.read()
18 return not 'We found the following errors' in text 18 return not 'We found the following errors' in text # XXX hacky
19 19
20 def date(datestamp): 20 def date(datestamp):
21 datestamp = os.path.split(datestamp)[-1] 21 datestamp = os.path.split(datestamp)[-1]
22 retval = [] 22 retval = []
23 for i in timeformat: 23 for i in timeformat: