From e4a93a2f49da13ceeed38ece87a909beb9d83f55 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Mon, 11 Nov 2013 10:00:34 +0100 Subject: [PATCH] adding header and move to python 3 --- backup.py | 32 +++++++++++++++++++++++++------- 1 files changed, 25 insertions(+), 7 deletions(-) diff --git a/backup.py b/backup.py index d15743d..6599cbf 100644 --- a/backup.py +++ b/backup.py @@ -1,3 +1,21 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2013 Intra2net AG +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# + import argparse import binascii import json @@ -32,20 +50,20 @@ def check_equal_dirs(path1, path2, deltatar): target_it = deltatar.jsonize_path_iterator(target_it, strip=nbars2) while True: try: - sitem = source_it.next() - titem = target_it.next() + sitem = next(source_it) + titem = next(target_it) except StopIteration: try: - titem = target_it.next() + titem = next(target_it) raise Exception("iterators do not stop at the same time") except StopIteration: break try: assert deltatar._equal_stat_dicts(sitem, titem) - except Exception, e: - print sitem - print titem - print "FAIL" + except Exception as e: + print(sitem) + print(titem) + print("FAIL") raise if __name__ == "__main__": -- 1.7.1