dir.py 436 B

1234567891011121314151617181920
  1. #!./bin/python3
  2. import os
  3. from handler.filelist import FileListHandler
  4. class DirectoryHandler(FileListHandler):
  5. def getPlaylistItems(self, item):
  6. path = item["path"]
  7. items = []
  8. items = sorted([{
  9. "name" : self.toDisplayName(f),
  10. "path" : os.path.join(path, f)
  11. } for f in os.listdir(path)], key=lambda i: i["name"])
  12. print("GOT items:", items)
  13. return items