minor utils tweaks

This commit is contained in:
Damien Elmes 2011-04-14 09:18:11 +09:00
parent 84d59e4b01
commit 173379f451
2 changed files with 2 additions and 9 deletions

View file

@ -189,8 +189,6 @@ create index if not exists ix_fsums_csum on fsums (csum);
# 2.0 schema migration
######################################################################
# we don't have access to the progress handler at this point, so the GUI code
# will need to set up a progress handling window before opening a deck.
def _moveTable(db, table, cards=False):
if cards:

View file

@ -169,19 +169,14 @@ def entsToTxt(html):
##############################################################################
def hexifyID(id):
if id < 0:
id += 18446744073709551616L
return "%x" % id
def dehexifyID(id):
id = int(id, 16)
if id >= 9223372036854775808L:
id -= 18446744073709551616L
return id
return int(id, 16)
def ids2str(ids):
"""Given a list of integers, return a string '(int1,int2,...)'."""
return "(%s)" % ",".join([str(i) for i in ids])
return "(%s)" % ",".join(str(i) for i in ids)
# Tags
##############################################################################