I am writing a music player in python, with a Kli using urwid. I intend to have the current playlist in simpleListWalker wrapped in a list, then columns, a bunch, and finally a frame.
How to replace all contents of this list (or simpleListWalker) with something else?
Relevant Code:
class mainDisplay(object): ... def renderList(self): songList = db.getListOfSongs() songDictList = [item for item in songList if item['location'] in commandSh.currentPlaylists[commandSh.plyr.currentList]] self.currentSongWidgets = self.createList(songDictList) self.mainListContent = urwid.SimpleListWalker([urwid.AttrMap(w, None, 'reveal focus') for w in self.currentSongWidgets]) def initFace(self):
Full code: http://github.com/ripdog/PyPlayer/tree/cli - Check the main.py file for the interface code.
The code is currently in pretty bad shape, and I only programmed for two months. Any suggestions for code style, layout, or any other tips you may have are greatly appreciated.
python urwid
Ripdog
source share