Skip to content

Commit

Permalink
Fix typos as mentioned in LibreELEC#221 review
Browse files Browse the repository at this point in the history
  • Loading branch information
ysard committed Nov 13, 2021
1 parent 7f89a1e commit 4308197
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions resources/lib/modules/pulseaudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,10 @@ def menu_connections(self, focusItem=None):

rebuildList = 0
self.dbusDevices = self.get_sinks()
for dbusDevice in self.dbusDevices:
if self.dbusDevices:
rebuildList = 1
oe.winOeMain.getControl(int(oe.listObject['palist'])).reset()
self.clear_list()
break

fallbackSink = dbus_pulseaudio.core_get_property('FallbackSink')

Expand Down Expand Up @@ -177,7 +176,7 @@ def menu_connections(self, focusItem=None):
sinkName = bytearray(self.dbusDevices[dbusDevice]['PropertyList']['device.description']).decode().strip('\x00')

# fallback to the ugly name
if sinkName == '':
if not sinkName:
sinkName = self.dbusDevices[dbusDevice]['Name']

for prop in properties:
Expand All @@ -196,7 +195,7 @@ def menu_connections(self, focusItem=None):
if rebuildList == 1:
self.listItems[dbusDevice] = oe.winOeMain.addConfigItem(sinkName, dictProperties, oe.listObject['palist'])
else:
if self.listItems[dbusDevice] != None:
if self.listItems[dbusDevice] is not None:
self.listItems[dbusDevice].setLabel(sinkName)
for dictProperty in dictProperties:
self.listItems[dbusDevice].setProperty(dictProperty, dictProperties[dictProperty])
Expand All @@ -206,7 +205,7 @@ def open_context_menu(self, listItem):
values = {}
if listItem is None:
listItem = oe.winOeMain.getControl(oe.listObject['palist']).getSelectedItem()
if listItem.getProperty('ActiveProfileName') != '':
if listItem.getProperty('ActiveProfileName'):
values[1] = {
'text': oe._(32505),
'action': 'change_profile',
Expand All @@ -218,9 +217,9 @@ def open_context_menu(self, listItem):
}
items = []
actions = []
for key in list(values.keys()):
items.append(values[key]['text'])
actions.append(values[key]['action'])
for key, value in values.items():
items.append(value['text'])
actions.append(value['action'])
select_window = xbmcgui.Dialog()
title = oe._(32012)
result = select_window.select(title, items)
Expand Down

0 comments on commit 4308197

Please sign in to comment.