docsting update, clean up

This commit is contained in:
Blacktwin 2019-01-05 01:05:30 -05:00
parent 1409209e58
commit 8ef3e5fc82

View File

@ -174,25 +174,23 @@ def exclusions(all_true, select, all_items):
Returns Returns
------- -------
output: list output: list or dict
List of what was included/excluded List of what was included/excluded
""" """
output = '' output = ''
if isinstance(all_items, list): if isinstance(all_items, list):
output = [] output = []
# Defining users
if all_true and not select: if all_true and not select:
output = all_items output = all_items
elif not all_true and select: elif not all_true and select:
output = select output = select
elif all_true and select: elif all_true and select:
# If allUsers is used then any users listed will be excluded
for x in select: for x in select:
all_items.remove(x) all_items.remove(x)
output = all_items output = all_items
elif isinstance(all_items, dict): elif isinstance(all_items, dict):
output = {} output = {}
# Defining libraries
if all_true and not select: if all_true and not select:
output = all_items output = all_items
elif not all_true and select: elif not all_true and select:
@ -200,7 +198,6 @@ def exclusions(all_true, select, all_items):
if value in select: if value in select:
output[key] = value output[key] = value
elif all_true and select: elif all_true and select:
# If allLibraries is used then any libraries listed will be excluded
for key, value in all_items.items(): for key, value in all_items.items():
if value not in select: if value not in select:
output[key] = value output[key] = value
@ -434,15 +431,12 @@ def build_playlist(jbop, libraries=None, days=None, top=None, filters=None, sear
def share_playlists(playlist_titles, users): def share_playlists(playlist_titles, users):
""" """
Parameters Parameters
---------- ----------
playlist_titles playlist_titles: list
users list of playlist titles
users: list
Returns list of user names
-------
""" """
for user in users: for user in users:
for title in playlist_titles: for title in playlist_titles:
@ -456,7 +450,10 @@ def show_playlist(playlist_title, playlist_keys):
""" """
Parameters Parameters
---------- ----------
playlist_keys playlist_title: str
playlist's title
playlist_keys: list
list of rating keys for playlist
""" """
playlist_list = [] playlist_list = []
for key in playlist_keys: for key in playlist_keys:
@ -481,10 +478,14 @@ def create_playlist(playlist_title, playlist_keys, server, user):
""" """
Parameters Parameters
---------- ----------
playlist_title playlist_title: str
playlist_keys playlist title
server playlist_keys: list
user list of rating keys for playlist
server: class
server instance
user: str
users name
""" """
playlist_list = [] playlist_list = []
for key in playlist_keys: for key in playlist_keys:
@ -608,11 +609,9 @@ if __name__ == "__main__":
opts = parser.parse_args() opts = parser.parse_args()
users = ''
title = '' title = ''
search = '' search = ''
filters = '' filters = ''
libraries = {}
playlists = [] playlists = []
keys_list = [] keys_list = []
plex_servers = [] plex_servers = []