X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/56145861cf5fa01c5fbb429d40242e0a16189ed1..df341bdd09208d2b0f84060454cc0000df19deba:/src/catalogue/management/__init__.py diff --git a/src/catalogue/management/__init__.py b/src/catalogue/management/__init__.py index e537f9e5..6f6f6b6e 100644 --- a/src/catalogue/management/__init__.py +++ b/src/catalogue/management/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # @@ -54,14 +52,14 @@ class XmlUpdater(object): def fix_chunk(self, chunk, user, verbose=0, dry_run=False): """Runs the update for a single chunk.""" if verbose >= 2: - print chunk.get_absolute_url() + print(chunk.get_absolute_url()) old_head = chunk.head src = old_head.materialize() try: tree = etree.fromstring(src) except: if verbose: - print "%s: invalid XML" % chunk.get_absolute_url() + print("%s: invalid XML" % chunk.get_absolute_url()) self.counters['Bad XML'] += 1 return @@ -82,7 +80,7 @@ class XmlUpdater(object): if not dry_run: new_head = chunk.commit( - etree.tostring(tree, encoding=unicode), + etree.tostring(tree, encoding='unicode'), author=user, description=self.commit_desc ) @@ -90,7 +88,7 @@ class XmlUpdater(object): if old_head.publishable: new_head.set_publishable(True) if verbose >= 2: - print "done" + print("done") self.counters['Updated chunks'] += 1 def run(self, user, verbose=0, dry_run=False, books=None): @@ -113,4 +111,4 @@ class XmlUpdater(object): def print_results(self): """Prints the counters.""" for item in sorted(self.counters.items()): - print "%s: %d" % item + print("%s: %d" % item)