mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
...
This commit is contained in:
parent
382d6de38d
commit
17ddcaa9df
@ -761,9 +761,19 @@ def get_storage_number_map_alt(debug=False):
|
|||||||
for devinfo, devpath in DeviceSet().interfaces():
|
for devinfo, devpath in DeviceSet().interfaces():
|
||||||
if not devpath.endswith(os.sep):
|
if not devpath.endswith(os.sep):
|
||||||
devpath += os.sep
|
devpath += os.sep
|
||||||
|
try:
|
||||||
GetVolumeNameForVolumeMountPoint(devpath, wbuf, len(wbuf))
|
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
|
vname = wbuf.value
|
||||||
|
try:
|
||||||
wbuf, names = get_volume_pathnames(vname, buf=wbuf)
|
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:
|
for name in names:
|
||||||
name = name.upper()
|
name = name.upper()
|
||||||
if len(name) == 3 and name.endswith(':\\') and name[0] in string.ascii_uppercase:
|
if len(name) == 3 and name.endswith(':\\') and name[0] in string.ascii_uppercase:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user