diff options
author | Mike Crute <mike@crute.us> | 2018-02-27 03:08:48 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2020-06-16 00:15:18 +0000 |
commit | cc6ac9555e25536e0ce4a71834a16e872c3eb4da (patch) | |
tree | f2555e03edf78a926df7130a9b9882b769c2e5ba | |
parent | 95b3f19c042b8dd582a46c1b58e2b0c5e81f4d5b (diff) | |
download | pydora-editor.tar.bz2 pydora-editor.tar.xz pydora-editor.zip |
WIP: Stub in editorpydora-editor
-rw-r--r-- | pydora/editor.py | 52 | ||||
-rw-r--r-- | setup.cfg | 1 |
2 files changed, 53 insertions, 0 deletions
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 @@ | |||
1 | import os | ||
2 | import sys | ||
3 | from pandora import clientbuilder | ||
4 | |||
5 | from .utils import Screen | ||
6 | |||
7 | |||
8 | class EditorApp(object): | ||
9 | def __init__(self): | ||
10 | self.client = None | ||
11 | self.screen = Screen() | ||
12 | |||
13 | def get_client(self): | ||
14 | cfg_file = os.environ.get("PYDORA_CFG", "") | ||
15 | builder = clientbuilder.PydoraConfigFileBuilder(cfg_file) | ||
16 | if builder.file_exists: | ||
17 | return builder.build() | ||
18 | |||
19 | builder = clientbuilder.PianobarConfigFileBuilder() | ||
20 | if builder.file_exists: | ||
21 | return builder.build() | ||
22 | |||
23 | if not self.client: | ||
24 | self.screen.print_error("No valid config found") | ||
25 | sys.exit(1) | ||
26 | |||
27 | # Search (music.search) | ||
28 | # Create Station (station.createStation) | ||
29 | # List Stations (user.getStationList) | ||
30 | # Describe Station (station.getStation) | ||
31 | # - View Info | ||
32 | # - View Feedback | ||
33 | # - View Seeds | ||
34 | # - Get Share Link | ||
35 | # Modify Station | ||
36 | # - Change Name (station.renameStation) | ||
37 | # - Change Description (???) | ||
38 | # - Remove Feedback (station.deleteFeedback) | ||
39 | # - Add Seed (station.addMusic) | ||
40 | # - Remove Seed (station.deleteMusic) | ||
41 | # - Enable/Disable Artist Messages (???) | ||
42 | # Delete Station | ||
43 | # List Feedback | ||
44 | # List Bookmarks (Album, Track, Artist) (user.getBookmarks) | ||
45 | # Delete Bookmarks | ||
46 | # (bookmark.deleteArtistBookmark, bookmark.deleteSongBookmark) | ||
47 | def run(self): | ||
48 | self.client = self.get_client() | ||
49 | |||
50 | |||
51 | def main(): | ||
52 | EditorApp().run() | ||
@@ -39,6 +39,7 @@ exclude = | |||
39 | console_scripts = | 39 | console_scripts = |
40 | pydora = pydora.player:main | 40 | pydora = pydora.player:main |
41 | pydora-configure = pydora.configure:main | 41 | pydora-configure = pydora.configure:main |
42 | pydora-edit = pydora.editor:main | ||
42 | 43 | ||
43 | [testenv:format] | 44 | [testenv:format] |
44 | deps = | 45 | deps = |