3737#
3838####### END LICENSE BLOCK ######
3939
40- from __future__ import division
40+ from __future__ import division, print_function
4141from ctypes import byref, cast, c_bool, c_byte, c_char, c_char_p, c_float, \
4242 CFUNCTYPE, c_long, c_short, c_ubyte, c_uint32, c_ushort, c_ulong, CDLL, \
4343 POINTER, string_at, Structure, c_int, c_void_p
@@ -74,7 +74,7 @@ class Path(object):
7474 def GPath(obj):
7575 return obj
7676 def deprint(obj):
77- print obj
77+ print( obj)
7878 def _(obj):
7979 return obj
8080
@@ -171,7 +171,7 @@ def PositiveIsErrorCheck(result, function, cArguments, *args):
171171
172172if _CBash:
173173 def LoggingCB(logString):
174- print logString,
174+ print( logString, end=' ')
175175 return 0
176176
177177 def RaiseCB(raisedString):
@@ -191,7 +191,7 @@ def RaiseCB(raisedString):
191191 #CBash. Dunno.
192192
193193 #This particular callback may disappear, or be morphed into something else
194- print "CBash encountered an error", raisedString, "Check the log."
194+ print( "CBash encountered an error", raisedString, "Check the log.")
195195## raise CBashError("Check the log.")
196196 return
197197
@@ -1326,7 +1326,7 @@ def fflags(y):
13261326 for x in xrange(32):
13271327 z = 1 << x
13281328 if y & z == z:
1329- print hex(z)
1329+ print( hex(z) )
13301330 global _dump_RecIndent
13311331 global _dump_LastIndent
13321332 if hasattr(record, 'copyattrs'):
@@ -1341,20 +1341,20 @@ def fflags(y):
13411341 attr = attr[:-5]
13421342 wasList = True
13431343 rec = getattr(record, attr)
1344- if _dump_RecIndent: print " " * (_dump_RecIndent - 1),
1344+ if _dump_RecIndent: print( " " * (_dump_RecIndent - 1), end=' ')
13451345 if wasList:
1346- print attr
1346+ print( attr)
13471347 else:
1348- print attr + " " * (msize - len(attr)), ":",
1348+ print( attr + " " * (msize - len(attr)), ":", end=' ')
13491349 if rec is None:
1350- print rec
1350+ print( rec)
13511351 elif 'flag' in attr.lower() or 'service' in attr.lower():
1352- print hex(rec)
1352+ print( hex(rec) )
13531353 if _dump_ExpandLists == True:
13541354 for x in xrange(32):
13551355 z = pow(2, x)
13561356 if rec & z == z:
1357- print " " * _dump_RecIndent, " Active" + " " * (msize - len(" Active")), " :", hex(z)
1357+ print( " " * _dump_RecIndent, " Active" + " " * (msize - len(" Active")), " :", hex(z) )
13581358
13591359 elif isinstance(rec, list):
13601360 if len(rec) > 0:
@@ -1364,15 +1364,15 @@ def fflags(y):
13641364 IsFidList = False
13651365 break
13661366 if IsFidList:
1367- print rec
1367+ print( rec)
13681368 elif not wasList:
1369- print rec
1369+ print( rec)
13701370 elif not wasList:
1371- print rec
1371+ print( rec)
13721372 elif isinstance(rec, basestring):
1373- print repr(rec)
1373+ print( repr(rec) )
13741374 elif not wasList:
1375- print rec
1375+ print( rec)
13761376 _dump_RecIndent += 2
13771377 printRecord(rec)
13781378 _dump_RecIndent -= 2
@@ -1383,12 +1383,12 @@ def fflags(y):
13831383 for rec in record:
13841384 printRecord(rec)
13851385 if _dump_LastIndent == _dump_RecIndent:
1386- print
1386+ print()
13871387 global _dump_ExpandLists
13881388 _dump_ExpandLists = expand
13891389 try:
13901390 msize = max([len(attr) for attr in record.copyattrs])
1391- print " fid" + " " * (msize - len("fid")), ":", record.fid
1391+ print( " fid" + " " * (msize - len("fid")), ":", record.fid)
13921392 except AttributeError:
13931393 pass
13941394 printRecord(record)
0 commit comments