another hack for w32's low timer resolution

This commit is contained in:
Damien Elmes 2010-02-12 16:03:48 +09:00
parent 6857233eef
commit 4769bfa7a5

View file

@ -145,10 +145,17 @@ The current importer only supports a single active card template. Please disable
# add facts # add facts
self.deck.updateProgress() self.deck.updateProgress()
factIds = [genID() for n in range(len(cards))] factIds = [genID() for n in range(len(cards))]
def fudgeCreated(d, tmp=[]):
if not tmp:
tmp.append(time.time())
else:
tmp[0] += 0.00001
d['created'] = tmp[0]
return d
self.deck.s.execute(factsTable.insert(), self.deck.s.execute(factsTable.insert(),
[{'modelId': self.model.id, [fudgeCreated({'modelId': self.model.id,
'tags': canonifyTags(self.tagsToAdd + " " + cards[n].tags), 'tags': canonifyTags(self.tagsToAdd + " " + cards[n].tags),
'id': factIds[n]} for n in range(len(cards))]) 'id': factIds[n]}) for n in range(len(cards))])
self.deck.factCount += len(factIds) self.deck.factCount += len(factIds)
self.deck.s.execute(""" self.deck.s.execute("""
delete from factsDeleted delete from factsDeleted