Mercurial > hg > bitsyblog
changeset 123:6bdf817a9e34
ignoring css issues
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 03 Nov 2020 14:52:46 -0800 |
parents | c4a8285f9875 |
children | ff6ce18cb0be |
files | bitsyblog/settings.py |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/bitsyblog/settings.py Tue Nov 03 14:49:44 2020 -0800 +++ b/bitsyblog/settings.py Tue Nov 03 14:52:46 2020 -0800 @@ -1,12 +1,13 @@ """user settings / preferences""" import parser # bitsyblog dateutils.parser with mods to retain strftime format -import urllib2 import utils + class InvalidSettingError(Exception): """error when trying to validate a setting""" + class Setting(object): def __init__(self, name, value=None): self.name = name @@ -32,7 +33,7 @@ else: raise InvalidSettingError('unrecognized date format: %s' % format) - + class CSSFile(Setting): def __init__(self): Setting.__init__(self, 'CSS file') @@ -41,10 +42,9 @@ if not hasattr(value, 'file'): return True # blank set: don't do anything css = value.file.read() - try: - validcss = utils.validate_css(css) - except urllib2.URLError: - raise InvalidSettingError('Could not validate CSS (sorry!)') + + # XXX `validate_css` is a dummy function for now. + validcss = utils.validate_css(css) if not validcss: raise InvalidSettingError('%s is not valid css' % filename) filename = value.filename