configBase.SettingRow(right, 'save_profile')
configBase.TitleRow(right, 'SD Card settings')
- if len(profile.getSDcardDrives()) > 1:
- configBase.SettingRow(right, 'sdpath', profile.getSDcardDrives())
- else:
- configBase.SettingRow(right, 'sdpath')
+ configBase.SettingRow(right, 'sdpath', profile.getSDcardDrives())
configBase.SettingRow(right, 'sdshortnames')
configBase.TitleRow(right, 'Cura settings')
item['params'].append({'name': m.group(1), 'type': m.group(2), 'default': m.group(3), 'description': m.group(4)})
else:
print "Unknown item in effect meta data: %s %s" % (line[0], line[1])
- if item['name'] != None and item['type'] == 'postprocess':
+ if item['name'] is not None and item['type'] == 'postprocess':
ret.append(item)
return ret
return None
def getSDcardDrives():
- drives = ['']
+ drives = []
if platform.system() == "Windows":
from ctypes import windll
bitmask = windll.kernel32.GetLogicalDrives()
for letter in string.uppercase:
- if bitmask & 1:
+ if bitmask & 1 and windll.kernel32.GetDriveTypeA(letter + ':/') == 2:
drives.append(letter + ':/')
bitmask >>= 1
- if platform.system() == "Darwin":
- drives = []
+ elif platform.system() == "Darwin":
for volume in glob.glob('/Volumes/*'):
if stat.S_ISLNK(os.lstat(volume).st_mode):
continue
+ #'Ejectable: Yes' in os.system('diskutil info \'%s\'' % (volume))
+ drives.append(volume)
+ else:
+ for volume in glob.glob('/media/*'):
drives.append(volume)
return drives