diff --git a/default.py b/default.py index 1aaee286..210d6476 100644 --- a/default.py +++ b/default.py @@ -112,10 +112,10 @@ class Main(): reset() elif mode == 'togglePlexTV': - entrypoint.togglePlexTV() + entrypoint.toggle_plex_tv_sign_in() elif mode == 'resetauth': - entrypoint.resetAuth() + entrypoint.reset_authorization() elif mode == 'passwords': passwords_xml() @@ -141,7 +141,7 @@ class Main(): plex_command('RUN_LIB_SCAN', 'textures') elif mode == 'chooseServer': - entrypoint.chooseServer() + entrypoint.choose_pms_server() elif mode == 'refreshplaylist': log.info('Requesting playlist/nodes refresh') diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index f2f727e5..0fe3ba4b 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -36,7 +36,7 @@ except IndexError: ############################################################################### -def chooseServer(): +def choose_pms_server(): """ Lets user choose from list of PMS """ @@ -73,7 +73,11 @@ def chooseServer(): sound=False) -def togglePlexTV(): +def toggle_plex_tv_sign_in(): + """ + Signs out of Plex.tv if there was a token saved and thus deletes the token. + Or signs in to plex.tv if the user was not logged in before. + """ if settings('plexToken'): LOG.info('Reseting plex.tv credentials in settings') settings('plexLogin', value="") @@ -98,9 +102,10 @@ def togglePlexTV(): sound=False) -##### DO RESET AUTH ##### -def resetAuth(): - # User tried login and failed too many times +def reset_authorization(): + """ + User tried login and failed too many times. Reset # of logins + """ resp = dialog('yesno', heading="{plex}", line1=lang(39206)) if resp == 1: LOG.info("Reset login attempts.")