diff --git a/morituri/common/drive.py b/morituri/common/drive.py index c4cfd5d..95c9452 100644 --- a/morituri/common/drive.py +++ b/morituri/common/drive.py @@ -24,12 +24,14 @@ import os from morituri.common import log + def _listify(listOrString): if type(listOrString) == str: return [listOrString, ] return listOrString + def getAllDevicePaths(): try: return _getAllDevicePathsPyCdio() @@ -37,6 +39,7 @@ def getAllDevicePaths(): log.info('drive', 'Cannot import pycdio') return _getAllDevicePathsStatic() + def _getAllDevicePathsPyCdio(): import pycdio import cdio @@ -46,6 +49,7 @@ def _getAllDevicePathsPyCdio(): # ticket 102: this cdio call returns a list of str, or a single str return _listify(cdio.get_devices_with_cap(pycdio.FS_MATCH_ALL, False)) + def _getAllDevicePathsStatic(): ret = []