X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fstorage%2Frecord.py;h=9622268273d11906aa444efc79518bc293d9b337;hb=ecc85e0b923922cf7117d29b380f5284edb88f21;hp=8600723a0e378d3fd11222c32bd94d565928cc48;hpb=0eb2fd645abe02f4fbb79d9ebc5a17b292b8dd2d;p=sfa.git diff --git a/sfa/storage/record.py b/sfa/storage/record.py index 8600723a..96222682 100644 --- a/sfa/storage/record.py +++ b/sfa/storage/record.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from sfa.util.sfatime import utcparse, datetime_to_string from types import StringTypes from datetime import datetime @@ -82,15 +84,15 @@ class Record: if format == 'text': self.dump_text(dump_parents,sort=sort) elif format == 'xml': - print self.save_as_xml() + print(self.save_as_xml()) elif format == 'simple': - print self.dump_simple() + print(self.dump_simple()) else: - raise Exception, "Invalid format %s" % format + raise Exception("Invalid format %s" % format) def dump_text(self, dump_parents=False, sort=False): - print 40*'=' - print "RECORD" + print(40*'=') + print("RECORD") # print remaining fields fields = self.fields() if sort: fields.sort() @@ -102,12 +104,12 @@ class Record: if callable (attrib): continue # handle gid if attrib_name == 'gid': - print " gid:" - print GID(string=attrib).dump_string(8, dump_parents) + print(" gid:") + print(GID(string=attrib).dump_string(8, dump_parents)) elif attrib_name in ['date created', 'last updated']: - print " %s: %s" % (attrib_name, self.date_repr(attrib_name)) + print(" %s: %s" % (attrib_name, self.date_repr(attrib_name))) else: - print " %s: %s" % (attrib_name, attrib) + print(" %s: %s" % (attrib_name, attrib)) def dump_simple(self): return "%s"%self