mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use random UUIDs as book id
This commit is contained in:
parent
5599164fef
commit
2d8b5b80bf
@ -19,6 +19,7 @@ The LRF file format is documented at U{http://www.sven.de/librie/Librie/LrfForma
|
|||||||
import sys, os
|
import sys, os
|
||||||
from optparse import OptionParser, OptionValueError
|
from optparse import OptionParser, OptionValueError
|
||||||
from htmlentitydefs import name2codepoint
|
from htmlentitydefs import name2codepoint
|
||||||
|
from uuid import uuid4
|
||||||
|
|
||||||
from ttfquery import describe, findsystem
|
from ttfquery import describe, findsystem
|
||||||
from fontTools.ttLib import TTLibError
|
from fontTools.ttLib import TTLibError
|
||||||
@ -266,8 +267,8 @@ def Book(options, logger, font_delta=0, header=None,
|
|||||||
hb.append(header)
|
hb.append(header)
|
||||||
hdr.PutObj(hb)
|
hdr.PutObj(hb)
|
||||||
ps['headheight'] = profile.header_height
|
ps['headheight'] = profile.header_height
|
||||||
ps['header'] = hdr
|
ps['header'] = hdr
|
||||||
ps['topmargin'] = 0
|
ps['topmargin'] = 0
|
||||||
ps['textheight'] = profile.screen_height - (options.bottom_margin + ps['topmargin'] + ps['headheight'] + profile.fudge)
|
ps['textheight'] = profile.screen_height - (options.bottom_margin + ps['topmargin'] + ps['headheight'] + profile.fudge)
|
||||||
fontsize = int(10*profile.font_size+font_delta*20)
|
fontsize = int(10*profile.font_size+font_delta*20)
|
||||||
baselineskip = fontsize + 20
|
baselineskip = fontsize + 20
|
||||||
@ -283,6 +284,7 @@ def Book(options, logger, font_delta=0, header=None,
|
|||||||
book = _Book(textstyledefault=tsd,
|
book = _Book(textstyledefault=tsd,
|
||||||
pagestyledefault=ps,
|
pagestyledefault=ps,
|
||||||
blockstyledefault=dict(blockwidth=ps['textwidth']),
|
blockstyledefault=dict(blockwidth=ps['textwidth']),
|
||||||
|
bookid=uuid4().hex,
|
||||||
**settings)
|
**settings)
|
||||||
for family in fonts.keys():
|
for family in fonts.keys():
|
||||||
if fonts[family]:
|
if fonts[family]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user