From e3f0e31b91c8a5f9232156b2deb611dc7c8b83e5 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Fri, 14 Dec 2012 10:26:19 +0100 Subject: [PATCH 1/1] fixes --- scripts/fix_something.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/fix_something.py b/scripts/fix_something.py index 59781308..2d73ba16 100755 --- a/scripts/fix_something.py +++ b/scripts/fix_something.py @@ -22,19 +22,21 @@ tag_with_name = r"<([^>]+)name=\"([^>]+)>" def fix(book, author, dry_run=True): if len(book) == 0: - print "%s does not contain chunks" % book.slug + print "%s ==> does not contain chunks" % book.slug return fc = book[0] txt = fc.materialize() newtxt, cnt = re.subn(tag_with_name, r'<\1nazwa="\2>', txt) if cnt == 0: - print "%s nothing changed" % book + print "%s ==> nothing changed" % book.slug return if not dry_run: - print "%s changing" % book + print "%s ==> changing" % book.slug fc.commit(newtxt, author=author, description=u"Automatyczna zmiana atrybutu name na nazwa") + else: + print "%s ==> i would change this" % book.slug import sys @@ -46,7 +48,7 @@ opts, oth_ = getopt.getopt(sys.argv[1:], dry_run = not (("--seriously",'') in opts) me = User.objects.get(username='marcinkoziej') if dry_run: - print "This is a dry run, to really change dates, run with --seriously" + print "This is a dry run, to really fix something, run with --seriously" for b in Book.objects.all(): fix(b, me, dry_run) -- 2.20.1