X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/13480b3da2d3da87f1d99c6d340c1553ca9d89c1..016496137ecab524164f1de8ad17ccf791469166:/librarian/__init__.py diff --git a/librarian/__init__.py b/librarian/__init__.py index 0616f23..a0d70e7 100644 --- a/librarian/__init__.py +++ b/librarian/__init__.py @@ -3,7 +3,6 @@ # This file is part of Librarian, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -import os import re import urllib from .utils import XMLNamespace @@ -23,13 +22,24 @@ class UnicodeException(Exception): message = unicode(args, encoding='utf-8', errors='ignore') return message + class ParseError(UnicodeException): pass + class ValidationError(UnicodeException): pass +# was deleted, but still used??? +class NoDublinCore(ValidationError): + pass + + +class BuildError(Exception): + pass + + class EmptyNamespace(XMLNamespace): def __init__(self): super(EmptyNamespace, self).__init__('') @@ -53,8 +63,7 @@ class WLURI(object): slug = None example = 'http://wolnelektury.pl/katalog/lektura/template/' - _re_wl_uri = re.compile(r'http://(www\.)?wolnelektury.pl/katalog/lektura/' - '(?P[-a-z0-9]+)/?$') + _re_wl_uri = re.compile(r'http://(www\.)?wolnelektury.pl/katalog/lektura/(?P[-a-z0-9]+)/?$') def __init__(self, uri): uri = unicode(uri) @@ -93,4 +102,3 @@ class WLURI(object): class URLOpener(urllib.FancyURLopener): version = 'FNP Librarian (http://git.nowoczesnapolska.org.pl/?p=librarian.git)' urllib._urlopener = URLOpener() -