mirror of
https://github.com/ankitects/anki.git
synced 2025-11-14 08:37:11 -05:00
minor utils tweaks
This commit is contained in:
parent
84d59e4b01
commit
173379f451
2 changed files with 2 additions and 9 deletions
|
|
@ -189,8 +189,6 @@ create index if not exists ix_fsums_csum on fsums (csum);
|
||||||
|
|
||||||
# 2.0 schema migration
|
# 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):
|
def _moveTable(db, table, cards=False):
|
||||||
if cards:
|
if cards:
|
||||||
|
|
|
||||||
|
|
@ -169,19 +169,14 @@ def entsToTxt(html):
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
def hexifyID(id):
|
def hexifyID(id):
|
||||||
if id < 0:
|
|
||||||
id += 18446744073709551616L
|
|
||||||
return "%x" % id
|
return "%x" % id
|
||||||
|
|
||||||
def dehexifyID(id):
|
def dehexifyID(id):
|
||||||
id = int(id, 16)
|
return int(id, 16)
|
||||||
if id >= 9223372036854775808L:
|
|
||||||
id -= 18446744073709551616L
|
|
||||||
return id
|
|
||||||
|
|
||||||
def ids2str(ids):
|
def ids2str(ids):
|
||||||
"""Given a list of integers, return a string '(int1,int2,...)'."""
|
"""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
|
# Tags
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue