This commit is contained in:
Kovid Goyal 2012-09-03 13:58:43 +05:30
parent bc7de03717
commit 4016e852d8

View File

@ -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()