Code optimization and bug fixes. Removed the broken, partial atspi driver implementation.

This commit is contained in:
Storm Dragon
2025-06-18 15:08:36 -04:00
parent d81d563bb6
commit 27dcff23bb
5 changed files with 156 additions and 452 deletions

View File

@ -49,33 +49,35 @@ class settingsManager():
def getBindingBackup(self):
return self.bindingsBackup.copy()
def loadSoundIcons(self, soundIconPath):
siConfig = open(soundIconPath + '/soundicons.conf',"r")
while(True):
line = siConfig.readline()
if not line:
break
line = line.replace('\n','')
if line.replace(" ","") == '':
continue
if line.replace(" ","").startswith("#"):
continue
if line.count("=") != 1:
continue
Values = line.split('=')
soundIcon = Values[0].upper()
Values[1] = Values[1].replace("'","")
Values[1] = Values[1].replace('"',"")
soundIconFile = ''
if os.path.exists(Values[1]):
soundIconFile = Values[1]
else:
if not soundIconPath.endswith("/"):
soundIconPath += '/'
if os.path.exists(soundIconPath + Values[1]):
soundIconFile = soundIconPath + Values[1]
self.env['soundIcons'][soundIcon] = soundIconFile
self.env['runtime']['debug'].writeDebugOut("SoundIcon: " + soundIcon + '.' + soundIconFile, debug.debugLevel.INFO, onAnyLevel=True)
siConfig.close()
try:
with open(soundIconPath + '/soundicons.conf', "r") as siConfig:
while(True):
line = siConfig.readline()
if not line:
break
line = line.replace('\n','')
if line.replace(" ","") == '':
continue
if line.replace(" ","").startswith("#"):
continue
if line.count("=") != 1:
continue
Values = line.split('=')
soundIcon = Values[0].upper()
Values[1] = Values[1].replace("'","")
Values[1] = Values[1].replace('"',"")
soundIconFile = ''
if os.path.exists(Values[1]):
soundIconFile = Values[1]
else:
if not soundIconPath.endswith("/"):
soundIconPath += '/'
if os.path.exists(soundIconPath + Values[1]):
soundIconFile = soundIconPath + Values[1]
self.env['soundIcons'][soundIcon] = soundIconFile
self.env['runtime']['debug'].writeDebugOut("SoundIcon: " + soundIcon + '.' + soundIconFile, debug.debugLevel.INFO, onAnyLevel=True)
except (IOError, OSError) as e:
self.env['runtime']['debug'].writeDebugOut('loadSoundIcons: failed to load sound icons from ' + soundIconPath + '. Error: ' + str(e), debug.debugLevel.ERROR)
def getSettingsFile(self):
return self.settingsFile
def setSettingsFile(self, settingsFile):