def get_drive_icon_data(self, keys=RegistryKeys()): ''' Load drive icon data into pictures object ''' self.drives = [] drives = keys.drives temp = values(drives) value = 'RegistryName' labels = [x[value] for x in temp if len(x[value]) == 1] for label in labels: drive_path = values('%s\%s'%(drives, label))[0]['Values'][''] drive_name = path.basename(drive_path) self.drives.append({'label': label, 'name': drive_name, 'path': drive_path})
def set_py_runas_admin(self): value = '\"C:\\Python27\\python.exe\" \"%1\" %*' try: with reg.CreateKey(CLASSES_ROOT, self.keys.py_runas_admin) as key: reg.SetValue(key, 'command', reg.REG_SZ, value) except: warn('Failed to set key for running python file type as admin.') py_runas_admin = self.keys.py_runas_admin return values(py_runas_admin, HKCR=True)[0]['Values'][''] == value
def get_trim(self): '''Return [Prefetch, Superfetch].''' trimPrefetch = '' trimSuperfetch = '' try: trimKeys = values(self.keys.TRIM) trimPrefetch = trimKeys['Values']['EnablePrefetcher'] trimSuperfetch = trimKeys['Values']['EnableSuperfetch'] except: warn('Failed to retrieve TRIM registry keys.') return [trimPrefetch, trimSuperfetch]