Quote:
Originally Posted by JimmXinu
Can I have a hint on how I'd get device manager/info in a custom template function? The only way I know now is self.gui.device_manager in a plugin.
|
You can do the same thing in a custom template function. Example:
Code:
def evaluate(self, formatter, kwargs, mi, locals):
from calibre.gui2.ui import get_gui
info = get_gui().device_manager.get_current_device_information()
v = ''
if info is not None:
print(info)
v = "yes"
return v
Does this answer your question?