mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix Windows detection code so _main_prefix can not be None
This commit is contained in:
parent
381b5a0607
commit
fe94bb088c
@ -120,7 +120,6 @@ class Device(_Device):
|
|||||||
|
|
||||||
def total_space(self, end_session=True):
|
def total_space(self, end_session=True):
|
||||||
msz = csz = 0
|
msz = csz = 0
|
||||||
print self._main_prefix
|
|
||||||
if not iswindows:
|
if not iswindows:
|
||||||
if self._main_prefix is not None:
|
if self._main_prefix is not None:
|
||||||
stats = os.statvfs(self._main_prefix)
|
stats = os.statvfs(self._main_prefix)
|
||||||
@ -185,11 +184,11 @@ class Device(_Device):
|
|||||||
if 'main' and 'card' in drives.keys():
|
if 'main' and 'card' in drives.keys():
|
||||||
break
|
break
|
||||||
|
|
||||||
if not drives:
|
|
||||||
raise DeviceError(_('Unable to detect the %s disk drive. Try rebooting.') % self.__class__.__name__)
|
|
||||||
|
|
||||||
self._main_prefix = drives.get('main', None)
|
self._main_prefix = drives.get('main', None)
|
||||||
self._card_prefix = drives.get('card', None)
|
self._card_prefix = drives.get('card', None)
|
||||||
|
|
||||||
|
if not self._main_prefix:
|
||||||
|
raise DeviceError(_('Unable to detect the %s disk drive. Try rebooting.') % self.__class__.__name__)
|
||||||
|
|
||||||
def get_osx_mountpoints(self, raw=None):
|
def get_osx_mountpoints(self, raw=None):
|
||||||
if raw is None:
|
if raw is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user