util.format.aslist() for layout
This commit is contained in:
parent
4b54d1981c
commit
6a8d830281
1 changed files with 3 additions and 2 deletions
|
@ -5,6 +5,7 @@ import core.module
|
||||||
import core.widget
|
import core.widget
|
||||||
import core.input
|
import core.input
|
||||||
import core.decorators
|
import core.decorators
|
||||||
|
import util.format
|
||||||
|
|
||||||
"""Displays the current song being played and allows pausing, skipping ahead, and skipping back.
|
"""Displays the current song being played and allows pausing, skipping ahead, and skipping back.
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ class Module(core.module.Module):
|
||||||
|
|
||||||
self.__layout = self.parameter(
|
self.__layout = self.parameter(
|
||||||
"layout",
|
"layout",
|
||||||
"spotify-buttons.song spotify-buttons.prev spotify-buttons.pause spotify-buttons.next",
|
util.format.aslist("spotify-buttons.song,spotify-buttons.prev,spotify-buttons.pause,spotify-buttons.next"),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.__song = ""
|
self.__song = ""
|
||||||
|
@ -63,7 +64,7 @@ class Module(core.module.Module):
|
||||||
|
|
||||||
#add widgets
|
#add widgets
|
||||||
widget_map = {}
|
widget_map = {}
|
||||||
for widget_name in self.__layout.split():
|
for widget_name in self.__layout:
|
||||||
widget = self.add_widget(name=widget_name)
|
widget = self.add_widget(name=widget_name)
|
||||||
if widget_name == "spotify-buttons.prev":
|
if widget_name == "spotify-buttons.prev":
|
||||||
widget_map[widget] = {
|
widget_map[widget] = {
|
||||||
|
|
Loading…
Reference in a new issue