From b7577601803bd38f46ea39de64657b7471bdef0a Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Wed, 6 Oct 2010 20:29:42 +0100 Subject: [PATCH] Add set_plugboards to interface.py --- src/calibre/devices/interface.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/calibre/devices/interface.py b/src/calibre/devices/interface.py index 2307bf94d6..29ba5020c7 100644 --- a/src/calibre/devices/interface.py +++ b/src/calibre/devices/interface.py @@ -411,6 +411,22 @@ class DevicePlugin(Plugin): ''' raise NotImplementedError() + def set_plugboards(self, plugboards, pb_func): + ''' + provide the driver the current set of plugboards and a function to + select a specific plugboard. This method is called immediately before + add_books and sync_booklists. + + pb_func is a callable with the following signature: + def pb_func(device_name, format, plugboards) + You give it the current device name (either the class name or + DEVICE_PLUGBOARD_NAME), the format you are interested in (a 'real' + format or 'device_db'), and the plugboards (you were given those by + set_plugboards, the same place you got this method). + + Return value: None or a single plugboard instance. + ''' + pass class BookList(list): '''