View Single Post
Old 08-23-2018, 01:12 PM   #14
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
If user never changed font in Calibre > Preferences > Look & Feel then in gui.json not exist "font" section.
Spoiler:
Code:
Traceback (most recent call last):
  File "calibre_plugins.calibrespy.ui", line 105, in run_calibrespy_from_gui
  File "calibre_plugins.calibrespy.calibrespy_dialog", line 128, in __init__
  File "calibre_plugins.calibrespy.calibrespy_dialog", line 1005, in build_fonts
TypeError: 'NoneType' object has no attribute '__getitem__'


This code works (tested in Windows only):

Spoiler:
Code:
        if calibre_font is not None:
            family = calibre_font[0]
            size = calibre_font[1]
        else:
            if iswindows:
                family = 'Segoe UI'
                size = 9
            else:
                family = 'Sans Serif'
                size = 10


Additional question on the screenshot.
Attached Thumbnails
Click image for larger version

Name:	calibrespy-mobi.png
Views:	945
Size:	76.3 KB
ID:	165813  

Last edited by BeckyEbook; 08-23-2018 at 02:35 PM.
BeckyEbook is online now   Reply With Quote