X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/cba76114f031d47c93e1af947a350230cbef0a1f..7dc1b2c84ca9b53454d9eb0c296b4f005dcb780c:/librarian/__init__.py?ds=inline diff --git a/librarian/__init__.py b/librarian/__init__.py index c46d5d1..0c77901 100644 --- a/librarian/__init__.py +++ b/librarian/__init__.py @@ -10,6 +10,8 @@ import re import shutil import urllib +from util import makedirs + class UnicodeException(Exception): def __str__(self): @@ -65,12 +67,14 @@ class EmptyNamespace(XMLNamespace): return tag # some common namespaces we use +XMLNS = XMLNamespace('http://www.w3.org/XML/1998/namespace') RDFNS = XMLNamespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') DCNS = XMLNamespace('http://purl.org/dc/elements/1.1/') XINS = XMLNamespace("http://www.w3.org/2001/XInclude") XHTMLNS = XMLNamespace("http://www.w3.org/1999/xhtml") NCXNS = XMLNamespace("http://www.daisy.org/z3986/2005/ncx/") OPFNS = XMLNamespace("http://www.idpf.org/2007/opf") +PLMETNS = XMLNamespace("http://dl.psnc.pl/schemas/plmet/") WLNS = EmptyNamespace() @@ -271,8 +275,7 @@ class OutputFile(object): """Save file to a path. Create directories, if necessary.""" dirname = os.path.dirname(os.path.abspath(path)) - if not os.path.isdir(dirname): - os.makedirs(dirname) + makedirs(dirname) shutil.copy(self.get_filename(), path)