From cc6ac9555e25536e0ce4a71834a16e872c3eb4da Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Tue, 27 Feb 2018 03:08:48 +0000 Subject: WIP: Stub in editor --- pydora/editor.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 1 + 2 files changed, 53 insertions(+) create mode 100644 pydora/editor.py diff --git a/pydora/editor.py b/pydora/editor.py new file mode 100644 index 0000000..af3f59c --- /dev/null +++ b/pydora/editor.py @@ -0,0 +1,52 @@ +import os +import sys +from pandora import clientbuilder + +from .utils import Screen + + +class EditorApp(object): + def __init__(self): + self.client = None + self.screen = Screen() + + def get_client(self): + cfg_file = os.environ.get("PYDORA_CFG", "") + builder = clientbuilder.PydoraConfigFileBuilder(cfg_file) + if builder.file_exists: + return builder.build() + + builder = clientbuilder.PianobarConfigFileBuilder() + if builder.file_exists: + return builder.build() + + if not self.client: + self.screen.print_error("No valid config found") + sys.exit(1) + + # Search (music.search) + # Create Station (station.createStation) + # List Stations (user.getStationList) + # Describe Station (station.getStation) + # - View Info + # - View Feedback + # - View Seeds + # - Get Share Link + # Modify Station + # - Change Name (station.renameStation) + # - Change Description (???) + # - Remove Feedback (station.deleteFeedback) + # - Add Seed (station.addMusic) + # - Remove Seed (station.deleteMusic) + # - Enable/Disable Artist Messages (???) + # Delete Station + # List Feedback + # List Bookmarks (Album, Track, Artist) (user.getBookmarks) + # Delete Bookmarks + # (bookmark.deleteArtistBookmark, bookmark.deleteSongBookmark) + def run(self): + self.client = self.get_client() + + +def main(): + EditorApp().run() diff --git a/setup.cfg b/setup.cfg index c0735fc..a7fc2ea 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,6 +39,7 @@ exclude = console_scripts = pydora = pydora.player:main pydora-configure = pydora.configure:main + pydora-edit = pydora.editor:main [testenv:format] deps = -- cgit v1.2.3