diff --git a/README.rst b/README.rst index 1d138ea9..6909b8ef 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ ############################################################################# |howdy_icon| Howdy! - Yet Another Way to Manage Your Plex_ Server's Content ############################################################################# -Howdy! (previous Plexstuff) is a (hopefully) useful SDK_ that I have developed to manage the movies, television shows, and music in which I am interested. I hope that it is, or becomes, a worthy member of the rich community of services used to manage one's media. +Howdy! (previously Plexstuff) is a (hopefully) useful SDK_ that I have developed to manage the movies, television shows, and music in which I am interested. I hope that it is, or becomes, a worthy member of the rich community of services used to manage one's media. Here are a few of the best known high level media management services: diff --git a/docs/source/howdy-config/howdy_config_gui_usage.rst b/docs/source/howdy-config/howdy_config_gui_usage.rst index 7b669456..99b73b25 100644 --- a/docs/source/howdy-config/howdy_config_gui_usage.rst +++ b/docs/source/howdy-config/howdy_config_gui_usage.rst @@ -3,7 +3,7 @@ ===================================================================================== |howdy_config_gui_icon| Consolidating Howdy Configuration With ``howdy_config_gui`` ===================================================================================== -Although ``howdy_config_gui`` is part of ``core``, and naturally lives in :numref:`Howdy Core Functionality`, I suggest you use this configuration tool to naturally consolidate the services and settings. The final configuration data will live in an `sqlite version 3 `_ database that is located in ``~/.local/plexstuff/app.db`` and is readable only by the user (and root). +Although ``howdy_config_gui`` is part of ``core``, and naturally lives in :numref:`Howdy Core Functionality`, I suggest you use this configuration tool to naturally consolidate the services and settings. The final configuration data will live in an `sqlite version 3 `_ database that is located in ``~/.local/howdy/app.db`` and is readable only by the user (and root). Some of the ``howdy_config_gui`` screenshots are found in :numref:`Summary of Setting Up Google Credentials` (specifically :numref:`imgur_step04_credentials`, :numref:`google_step02_refreshcredentials`, and :numref:`google_step04_oauthtokenstring`) and in :numref:`Howdy Settings Configuration` (specifically :numref:`login_step01_login` and :numref:`login_step02_settings`). diff --git a/docs/source/howdy-core/cli_tools/howdy_core_cli.rst b/docs/source/howdy-core/cli_tools/howdy_core_cli.rst index dcb15dd0..4984fd87 100644 --- a/docs/source/howdy-core/cli_tools/howdy_core_cli.rst +++ b/docs/source/howdy-core/cli_tools/howdy_core_cli.rst @@ -62,7 +62,7 @@ Authentication happens in two ways. here, ``...`` refers to subsequent commands. One must give a valid *username* and *password*, otherwise the program exits. -* by implicitly using the Plex_ authorizations stored in ``~/.config/plexstuff/app.db``. Here, no extra authorization needs to be provided. +* by implicitly using the Plex_ authorizations stored in ``~/.config/howdy/app.db``. Here, no extra authorization needs to be provided. Here is how to do each of the three *operations*. diff --git a/howdy/__init__.py b/howdy/__init__.py index 291885c1..ef586782 100644 --- a/howdy/__init__.py +++ b/howdy/__init__.py @@ -6,7 +6,9 @@ _mainDir = os.path.dirname( os.path.abspath( __file__ ) ) resourceDir = os.path.join( _mainDir, 'resources' ) """ -the directory in which the Plexstuff resources are stored. +the directory in which the Howdy_ resources are stored. + +.. _Howdy: https://howdy.readthedocs.io """ assert( os.path.isdir( resourceDir ) ) @@ -16,7 +18,7 @@ # resource file and stuff baseConfDir = os.path.abspath( os.path.expanduser( '~/.config/howdy' ) ) """ -the directory where Plexstuff user data is stored -- ``~/.config/howdy``. +the directory where Howdy_ user data is stored -- ``~/.config/howdy``. """ # ## don't do anything if in READTHEDOCS @@ -35,10 +37,11 @@ def signal_handler( signal, frame ): This block of code at the top of the executable will capture ``Ctrl+C`` and then hard kill the executable by invoking ``sys.exit( 0 )``. - :param dict signal: the POSIX signal to capture. See `the Python 3 signal high level overview `_ to begin to understand what POSIX signals are, and how Python can expose functionality to interact with them. + :param dict signal: the POSIX_ signal to capture. See `the Python 3 signal high level overview `_ to begin to understand what POSIX_ signals are, and how Python can expose functionality to interact with them. :param frame: the stack frame. I don't know what it is, or why it's necessary in this context, when trying to capture a ``Ctrl+C`` and cleanly exit. It is of type :py:class:`frame`. .. _signal_high_level_overview: https://docs.python.org/3/library/signal.html + .. _POSIX: https://en.wikipedia.org/wiki/POSIX """ print( "You pressed Ctrl+C. Exiting...") sys.exit( 0 ) diff --git a/howdy/core/cli/howdy_core_cli.py b/howdy/core/cli/howdy_core_cli.py index 1aedfd4e..98b2a5c1 100644 --- a/howdy/core/cli/howdy_core_cli.py +++ b/howdy/core/cli/howdy_core_cli.py @@ -1,3 +1,6 @@ +import signal +from howdy import signal_handler +signal.signal( signal.SIGINT, signal_handler ) from argparse import ArgumentParser import requests, tabulate # diff --git a/howdy/core/core.py b/howdy/core/core.py index 7f6a5834..83d80d87 100644 --- a/howdy/core/core.py +++ b/howdy/core/core.py @@ -396,15 +396,14 @@ def get_email_contacts( token, verify = True ): myxml.find_all( 'user' ) ) ) ) ) def get_mapped_email_contacts( token, verify = True ): - """list of all email addresses (including Plex_ server friends and mapped emails) to send Plexstuff related emails. + """list of all email addresses (including Plex_ server friends and mapped emails) to send Howdy_ related emails. :param str token: Plex_ access token. :param bool verify: optional argument, whether to verify SSL connections. Default is ``True``. - :returns: a list of email addresses for Plexstuff emails. + :returns: a list of email addresses for Howdy_ emails. :rtype: list .. seealso: :py:method:`get_email_contacts ` - """ emails = get_email_contacts( token, verify = verify ) query = session.query( PlexGuestEmailMapping ) @@ -421,13 +420,12 @@ def get_mapped_email_contacts( token, verify = True ): return mapped_emails def get_current_date_newsletter( ): - """the last date and time at which the Plexstuff email newsletter was updated. + """the last date and time at which the Howdy_ email newsletter was updated. :returns: the date and time of the most recent previous email newsletter. :rtype: :py:class:`datetime `. .. seealso:: :py:meth:`set_date_newsletter ` - """ query = session.query( LastNewsletterDate ) backthen = datetime.datetime.strptime( '1900-01-01', '%Y-%m-%d' ).date( ) @@ -1447,7 +1445,7 @@ def oauthGetGoogleCredentials( verify = True ): def oauthGetOauth2ClientGoogleCredentials( ): """ - Gets the `Google Oauth2`_ credentials, stored in the SQLite3_ configuration database, in the form of a refreshed :py:class:`AccessTokenCredentials ` object. This OAuth2 authentication method IS used for all the services accessed by Plexstuff_. + Gets the `Google Oauth2`_ credentials, stored in the SQLite3_ configuration database, in the form of a refreshed :py:class:`AccessTokenCredentials ` object. This OAuth2 authentication method IS used for all the services accessed by Howdy_. :returns: a :py:class:`AccessTokenCredentials ` form of the `Google Oauth2`_ credentials for various Oauth2 services. :rtype: :py:class:`AccessTokenCredentials ` @@ -1459,7 +1457,7 @@ def oauthGetOauth2ClientGoogleCredentials( ): * :py:meth:`oauth_generate_google_permission_url `. * :py:meth:`oauth_store_google_credentials `. - .. _Plexstuff: https://howdy.readthedocs.io + .. _Howdy: https://howdy.readthedocs.io """ val = session.query( PlexConfig ).filter( PlexConfig.service == 'google' ).first( ) if val is None: return None @@ -1470,7 +1468,7 @@ def oauthGetOauth2ClientGoogleCredentials( ): def oauth_generate_google_permission_url( ): """ - Generates a `Google OAuth2`_ web-based flow for all the Google services used in Plexstuff_. Descriptions of OAuth2_ and different flows (web server app, client, etc.) is almost impossible for me to follow (see `this page on OAuth2 authentication flows `_), I have given up, and I can only understand the specific authentication work flow implemented in Plexstuff_. The authentication process that uses this method is described in :ref:`this subsection `. Here are the programmatic steps to finally generate an :py:class:`AccessTokenCredentials ` object. + Generates a `Google OAuth2`_ web-based flow for all the Google services used in Howdy_. Descriptions of OAuth2_ and different flows (web server app, client, etc.) is almost impossible for me to follow (see `this page on OAuth2 authentication flows `_), I have given up, and I can only understand the specific authentication work flow implemented in Howdy_. The authentication process that uses this method is described in :ref:`this subsection `. Here are the programmatic steps to finally generate an :py:class:`AccessTokenCredentials ` object. 1. Get the :py:class:`OAuth2WebServerFlow ` and authentication URI.