mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pylint clean ups
This commit is contained in:
parent
eba26565b8
commit
02e4e537e4
@ -51,7 +51,7 @@ class CYBOOKG3(USBMS):
|
|||||||
return size
|
return size
|
||||||
return os.path.getsize(obj)
|
return os.path.getsize(obj)
|
||||||
|
|
||||||
sizes = map(get_size, files)
|
sizes = [get_size(f) for f in files]
|
||||||
size = sum(sizes)
|
size = sum(sizes)
|
||||||
|
|
||||||
if on_card and size > self.free_space()[2] - 1024*1024:
|
if on_card and size > self.free_space()[2] - 1024*1024:
|
||||||
|
@ -191,7 +191,6 @@ class Device(_Device):
|
|||||||
self._main_prefix = drives['main'] if 'main' in drives.keys() else None
|
self._main_prefix = drives['main'] if 'main' in drives.keys() else None
|
||||||
self._card_prefix = drives['card'] if 'card' in drives.keys() else None
|
self._card_prefix = drives['card'] if 'card' in drives.keys() else None
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_osx_mountpoints(self, raw=None):
|
def get_osx_mountpoints(self, raw=None):
|
||||||
if raw is None:
|
if raw is None:
|
||||||
ioreg = '/usr/sbin/ioreg'
|
ioreg = '/usr/sbin/ioreg'
|
||||||
|
@ -34,7 +34,7 @@ class USBMS(Device):
|
|||||||
SUPPORTS_SUB_DIRS = False
|
SUPPORTS_SUB_DIRS = False
|
||||||
|
|
||||||
def __init__(self, key='-1', log_packets=False, report_progress=None):
|
def __init__(self, key='-1', log_packets=False, report_progress=None):
|
||||||
pass
|
Device.__init__(self, key, log_packets, report_progress)
|
||||||
|
|
||||||
def get_device_information(self, end_session=True):
|
def get_device_information(self, end_session=True):
|
||||||
"""
|
"""
|
||||||
@ -54,7 +54,8 @@ class USBMS(Device):
|
|||||||
|
|
||||||
# Get all books in all directories under the root ebook_dir directory
|
# Get all books in all directories under the root ebook_dir directory
|
||||||
for path, dirs, files in os.walk(os.path.join(prefix, ebook_dir)):
|
for path, dirs, files in os.walk(os.path.join(prefix, ebook_dir)):
|
||||||
# Filter out anything that isn't in the list of supported ebook types
|
# Filter out anything that isn't in the list of supported ebook
|
||||||
|
# types
|
||||||
for book_type in self.FORMATS:
|
for book_type in self.FORMATS:
|
||||||
for filename in fnmatch.filter(files, '*.%s' % (book_type)):
|
for filename in fnmatch.filter(files, '*.%s' % (book_type)):
|
||||||
title, author, mime = self.__class__.extract_book_metadata_by_filename(filename)
|
title, author, mime = self.__class__.extract_book_metadata_by_filename(filename)
|
||||||
@ -80,7 +81,7 @@ class USBMS(Device):
|
|||||||
return size
|
return size
|
||||||
return os.path.getsize(obj)
|
return os.path.getsize(obj)
|
||||||
|
|
||||||
sizes = map(get_size, files)
|
sizes = [get_size(f) for f in files]
|
||||||
size = sum(sizes)
|
size = sum(sizes)
|
||||||
|
|
||||||
if on_card and size > self.free_space()[2] - 1024*1024:
|
if on_card and size > self.free_space()[2] - 1024*1024:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user