From 4016e852d87da755e3664c778523fc49ece1f031 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Sep 2012 13:58:43 +0530 Subject: [PATCH] ... --- src/calibre/devices/mtp/driver.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/calibre/devices/mtp/driver.py b/src/calibre/devices/mtp/driver.py index 8f8f4d119b..31679062d2 100644 --- a/src/calibre/devices/mtp/driver.py +++ b/src/calibre/devices/mtp/driver.py @@ -32,6 +32,7 @@ class MTP_DEVICE(BASE): CAN_SET_METADATA = [] BACKLOADING_ERROR_MESSAGE = None MANAGES_DEVICE_PRESENCE = True + FORMATS = ['epub', 'azw3', 'mobi', 'pdf'] def open(self, devices, library_uuid): self.current_library_uuid = library_uuid @@ -225,6 +226,8 @@ class MTP_DEVICE(BASE): return ans # }}} + # Sending files to the device {{{ + def create_upload_path(self, path, mdata, fname): from calibre.devices import create_upload_path from calibre.utils.filenames import ascii_filename as sanitize @@ -237,6 +240,19 @@ class MTP_DEVICE(BASE): ) return tuple(x.lower() for x in filepath.split('/')) + # }}} + + # Settings {{{ + @classmethod + def settings(self): + # TODO: Implement this + class Opts(object): + def __init__(s): + s.format_map = self.FORMATS + return Opts() + + # }}} + if __name__ == '__main__': dev = MTP_DEVICE(None) dev.startup()