Quote:
Originally Posted by chaley
You can do the same thing in a custom template function. Example:
...
Does this answer your question?
|
Yes, thank you.
It's not polished, obviously, but this does what I wanted:
template function:
Code:
def evaluate(self, formatter, kwargs, mi, locals, *fnargs):
from calibre.gui2.ui import get_gui
dm = get_gui().device_manager
info = dm.get_current_device_information()
v = ''
if dm.is_device_present and info is not None:
print(info)
v = info['info'][4]['main']['device_name']
return v
custom column template:
See attached screen caps for all the GUI settings.
ADDED:
Quote:
Originally Posted by chaley
I could add a function that returns the connected device name, but it wouldn't be guaranteed to be the empty string for a time after a device disconnects.
|
chaley was right about that. I've updated the function above to also notice when the device is not present.