python 3 support: fixes, no longer maxint, missing sys import, next change by 2to3

svn: r20637
This commit is contained in:
Benny Malengier 2012-11-07 21:20:24 +00:00
parent 5326703ef0
commit 70d50d2fc2
4 changed files with 4 additions and 3 deletions

View File

@ -133,7 +133,7 @@ def __do_export(database):
data = cursor.first()
while data:
pickle.dump(data, backup_table, 2)
data = next(cursor)
data = cursor.next()
cursor.close()
backup_table.close()
except (IOError,OSError):

View File

@ -1182,7 +1182,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
def create_id(self):
return "%08x%08x" % ( int(time.time()*10000),
self.rand.randint(0, maxint))
self.rand.randint(0, maxsize))
def __add_object(self, obj, transaction, find_next_func, commit_func):
if find_next_func and not obj.gramps_id:

View File

@ -56,6 +56,7 @@ from __future__ import print_function
import logging
import bisect
import sys
import time
_LOG = logging.getLogger(".gui.basetreemodel")

View File

@ -324,7 +324,7 @@ class DbGrdb(Callback):
def create_id(self):
return "%08x%08x" % ( int(time.time()*10000),
self.rand.randint(0, maxint))
self.rand.randint(0, maxsize))
def get_person_cursor(self):
raise NotImplementedError