X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/b25c0f434cc50d48379fc8aa4c1bf5ea32212396..01e9eecd54a34ddfc82f4092377f7b6cdcfadc31:/librarian/text.py diff --git a/librarian/text.py b/librarian/text.py index 931a152..cfe4a4d 100644 --- a/librarian/text.py +++ b/librarian/text.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from librarian import dcparser, parser from lxml import etree import cStringIO @@ -54,9 +58,9 @@ def wrap_words(context, text, wrapping): text = ''.join(text) if not wrapping: return text - + words = re.split(r'\s', text) - + line_length = 0 lines = [[]] for word in words: @@ -90,7 +94,7 @@ def transform(input_filename, output_filename, is_file=True, parse_dublincore=Tr result = document.transform(style, **options) output_file = codecs.open(output_filename, 'wb', encoding='utf-8') - + if parse_dublincore: url = dcparser.parse(input_filename).url else: