mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-19 11:43:54 +02:00
...
This commit is contained in:
parent
382d6de38d
commit
17ddcaa9df
1 changed files with 12 additions and 2 deletions
|
|
@ -761,9 +761,19 @@ def get_storage_number_map_alt(debug=False):
|
|||
for devinfo, devpath in DeviceSet().interfaces():
|
||||
if not devpath.endswith(os.sep):
|
||||
devpath += os.sep
|
||||
GetVolumeNameForVolumeMountPoint(devpath, wbuf, len(wbuf))
|
||||
try:
|
||||
GetVolumeNameForVolumeMountPoint(devpath, wbuf, len(wbuf))
|
||||
except WindowsError as err:
|
||||
if debug:
|
||||
prints('Failed to get volume id for drive: %s with error: %s' % (devpath, as_unicode(err)))
|
||||
continue
|
||||
vname = wbuf.value
|
||||
wbuf, names = get_volume_pathnames(vname, buf=wbuf)
|
||||
try:
|
||||
wbuf, names = get_volume_pathnames(vname, buf=wbuf)
|
||||
except WindowsError as err:
|
||||
if debug:
|
||||
prints('Failed to get mountpoints for volume %s with error: %s' % (devpath, as_unicode(err)))
|
||||
continue
|
||||
for name in names:
|
||||
name = name.upper()
|
||||
if len(name) == 3 and name.endswith(':\\') and name[0] in string.ascii_uppercase:
|
||||
|
|
|
|||
Loading…
Reference in a new issue