python 3 support: fixes, no longer maxint, missing sys import, next change by 2to3
svn: r20637
This commit is contained in:
@@ -133,7 +133,7 @@ def __do_export(database):
|
|||||||
data = cursor.first()
|
data = cursor.first()
|
||||||
while data:
|
while data:
|
||||||
pickle.dump(data, backup_table, 2)
|
pickle.dump(data, backup_table, 2)
|
||||||
data = next(cursor)
|
data = cursor.next()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
backup_table.close()
|
backup_table.close()
|
||||||
except (IOError,OSError):
|
except (IOError,OSError):
|
||||||
|
@@ -1182,7 +1182,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
|
|
||||||
def create_id(self):
|
def create_id(self):
|
||||||
return "%08x%08x" % ( int(time.time()*10000),
|
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):
|
def __add_object(self, obj, transaction, find_next_func, commit_func):
|
||||||
if find_next_func and not obj.gramps_id:
|
if find_next_func and not obj.gramps_id:
|
||||||
|
@@ -56,6 +56,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import bisect
|
import bisect
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
_LOG = logging.getLogger(".gui.basetreemodel")
|
_LOG = logging.getLogger(".gui.basetreemodel")
|
||||||
|
@@ -324,7 +324,7 @@ class DbGrdb(Callback):
|
|||||||
|
|
||||||
def create_id(self):
|
def create_id(self):
|
||||||
return "%08x%08x" % ( int(time.time()*10000),
|
return "%08x%08x" % ( int(time.time()*10000),
|
||||||
self.rand.randint(0, maxint))
|
self.rand.randint(0, maxsize))
|
||||||
|
|
||||||
def get_person_cursor(self):
|
def get_person_cursor(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
Reference in New Issue
Block a user