This commit is contained in:
Kovid Goyal 2012-08-23 11:54:07 +05:30
parent 8dde6d8433
commit 492915a94d
4 changed files with 47 additions and 0 deletions

View 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

View 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

View File

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

View File

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