mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
8dde6d8433
commit
492915a94d
20
src/calibre/devices/mtp/driver.py
Normal file
20
src/calibre/devices/mtp/driver.py
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from calibre.constants import iswindows
|
||||
|
||||
if iswindows:
|
||||
from calibre.devices.mtp.windows.driver import MTP_DEVICE as BASE
|
||||
BASE
|
||||
else:
|
||||
from calibre.devices.mtp.unix.driver import MTP_DEVICE as BASE
|
||||
|
||||
class MTP_DEVICE(BASE):
|
||||
pass
|
||||
|
22
src/calibre/devices/mtp/test.py
Normal file
22
src/calibre/devices/mtp/test.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import unittest
|
||||
|
||||
from calibre.devices.mtp.driver import MTP_DEVICE
|
||||
|
||||
class Test(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.dev = MTP_DEVICE(None)
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
|
@ -777,8 +777,10 @@ initlibmtp(void) {
|
||||
|
||||
m = Py_InitModule3("libmtp", libmtp_methods, "Interface to libmtp.");
|
||||
if (m == NULL) return;
|
||||
|
||||
MTPError = PyErr_NewException("libmtp.MTPError", NULL, NULL);
|
||||
if (MTPError == NULL) return;
|
||||
PyModule_AddObject(m, "MTPError", MTPError);
|
||||
|
||||
LIBMTP_Init();
|
||||
LIBMTP_Set_Debug(LIBMTP_DEBUG_NONE);
|
||||
|
@ -195,12 +195,15 @@ initwpd(void) {
|
||||
|
||||
WPDError = PyErr_NewException("wpd.WPDError", NULL, NULL);
|
||||
if (WPDError == NULL) return;
|
||||
PyModule_AddObject(m, "WPDError", MTPError);
|
||||
|
||||
NoWPD = PyErr_NewException("wpd.NoWPD", NULL, NULL);
|
||||
if (NoWPD == NULL) return;
|
||||
PyModule_AddObject(m, "NoWPD", MTPError);
|
||||
|
||||
WPDFileBusy = PyErr_NewException("wpd.WPDFileBusy", NULL, NULL);
|
||||
if (WPDFileBusy == NULL) return;
|
||||
PyModule_AddObject(m, "WPDFileBusy", MTPError);
|
||||
|
||||
Py_INCREF(&DeviceType);
|
||||
PyModule_AddObject(m, "Device", (PyObject *)&DeviceType);
|
||||
|
Loading…
x
Reference in New Issue
Block a user