IGN:Various usbms cleanups

This commit is contained in:
Kovid Goyal 2009-01-20 14:23:40 -08:00
parent 1fa831703d
commit 276d58e1d9
3 changed files with 18 additions and 3 deletions

View File

@ -9,6 +9,7 @@ from itertools import cycle
from calibre.devices.usbms.driver import USBMS
import calibre.devices.cybookg3.t2b as t2b
from calibre.devices.errors import FreeSpaceError
class CYBOOKG3(USBMS):
# Ordered list of supported formats

View File

@ -3,10 +3,10 @@ __copyright__ = '2009, John Schember <john at nachtimwald.com>'
'''
Generic device driver. This is not a complete stand alone driver. It is
intended to be subclassed with the relevant parts implemented for a particular
device. This class handles devive detection.
device. This class handles device detection.
'''
import os, subprocess, time
import os, subprocess, time, re
from calibre.devices.interface import Device as _Device
from calibre.devices.errors import DeviceError

View File

@ -11,9 +11,23 @@ from itertools import cycle
from calibre.devices.usbms.device import Device
from calibre.devices.usbms.books import BookList, Book
from calibre.devices.errors import FreeSpaceError
from calibre.devices.errors import FreeSpaceError, PathError
from calibre.devices.mime import MIME_MAP
class File(object):
def __init__(self, path):
stats = os.stat(path)
self.is_dir = os.path.isdir(path)
self.is_readonly = not os.access(path, os.W_OK)
self.ctime = stats.st_ctime
self.wtime = stats.st_mtime
self.size = stats.st_size
if path.endswith(os.sep):
path = path[:-1]
self.path = path
self.name = os.path.basename(path)
class USBMS(Device):
FORMATS = []
EBOOK_DIR_MAIN = ''