View Single Post
Old 08-25-2014, 10:37 PM   #619
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by auspex View Post
Yes, I think a lot of things will translate easily. And you're right that the database will be marginally harder. otoh, there's no such thing as a separate annotation file, so they're just another database query. It's the annotations that I really, really, want.
The only part of the plugin that looks at the annotations file is the annotations file backup. The bit that reads and displays the annotations uses the database. And it uses as much of the driver annotation support as it can. The same goes for the annotations plugin. But, in that case the code was copied and modified heavily. I actually should look at the changes and copy some of them back to the driver.
Quote:
I just noticed something in the KoboUtilities plugin.

In dialogs.py, you:
Code:
try:
    ...
    from PyQt5 import QtWidgets as QtGui
except ImportError as e:
    from PyQt4 import QtGui
while in config.py, it's:
Code:
try:
    ...
    from PyQt5 import QtGui
except ImportError as e:
    from PyQt4 import QtGui
Now, it appears to be an unused import in config, but to save you grief if you later need to use QtGui, you might want to make those match!
The Qt5 imports were done to minimise the changes elsewhere and to keep the plugin working in both environments. The refactoring done from Qt4 to Qt5 meant that some classes and methods moved or changed names. Hence the import of "QtWidgets" as "QtGui". QtGui still exists in Qt5, it just happens that I don't need it directly in this plugin. At least one of the others I ported did. And the leftover QtGui in config.py is also because of this. For some reason I had "QtGui.QSpinBox" rather than import QSpinBox directly. I changed that for the new version and forgot to cleanup the imports.

Some time in the future I will remove the Qt4 references and clean all this up. But, it won't happen until I think that most people have moved to calibre v2.
davidfor is offline   Reply With Quote