2to3 -f except
[sfa.git] / sfa / trust / sfaticket.py
index 0be5d93..78e6d87 100644 (file)
@@ -1,12 +1,35 @@
+#----------------------------------------------------------------------
+# Copyright (c) 2008 Board of Trustees, Princeton University
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and/or hardware specification (the "Work") to
+# deal in the Work without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Work, and to permit persons to whom the Work
+# is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Work.
+#
+# THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS
+# IN THE WORK.
+#----------------------------------------------------------------------
 #
 # implements SFA tickets
 #
 
+from __future__ import print_function
+
 import xmlrpclib
 
 from sfa.trust.certificate import Certificate
-from sfa.trust.rights import *
-from sfa.trust.gid import *
+from sfa.trust.gid import GID
 
 # Ticket is tuple:
 #   (gidCaller, gidObject, attributes, rspec, delegate)
@@ -103,25 +126,25 @@ class SfaTicket(Certificate):
             self.gidObject = None
 
     def dump(self, dump_parents=False):
-        print "TICKET", self.get_subject()
+        print("TICKET", self.get_subject())
 
-        print "  gidCaller:"
+        print("  gidCaller:")
         gidCaller = self.get_gid_caller()
         if gidCaller:
             gidCaller.dump(8, dump_parents)
 
-        print "  gidObject:"
+        print("  gidObject:")
         gidObject = self.get_gid_object()
         if gidObject:
             gidObject.dump(8, dump_parents)
 
-        print "  attributes:"
+        print("  attributes:")
         for attrname in self.get_attributes().keys():
-            print "        ", attrname, self.get_attributes()[attrname]
+            print("        ", attrname, self.get_attributes()[attrname])
 
-        print "       rspec:"
-        print "        ", self.get_rspec()
+        print("       rspec:")
+        print("        ", self.get_rspec())
 
         if self.parent and dump_parents:
-           print "PARENT",
+           print("PARENT", end=' ')
            self.parent.dump(dump_parents)