adding header and move to python 3
authorEduardo Robles Elvira <edulix@wadobo.com>
Mon, 11 Nov 2013 09:00:34 +0000 (10:00 +0100)
committerEduardo Robles Elvira <edulix@wadobo.com>
Mon, 11 Nov 2013 09:00:37 +0000 (10:00 +0100)
backup.py

index d15743d..6599cbf 100644 (file)
--- 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
+# <http://www.gnu.org/licenses/lgpl-3.0.html>
+
 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__":