Skip to content

Commit

Permalink
FINALLY FINISHED 1st iteration of documenting all the non-GUI, lower …
Browse files Browse the repository at this point in the history
…level APIs, and all CLI tools.

1. changed LaTeX to point to https://www.latex-project.org

2. plexcore/__init__.py: included QPixmap in import, otherwise screen shot not working.

3. plexcore/plexcore.py: cosmetic changes.

4. plexemail/__init__.py: cosmetic changes.

5. plexemail/plexemail.py, plexemail/plexemail_gui.py, resources/plexstuff_body_template.tex:

   a. finished documentation.

   b. removed newsletter references to Fresh Air and This American Life.

   c. fixed up plexemail.plexemail.get_summary_html method to use token, fullURL arguments like all other similar methods.

   d. Changed plexstuff_body_template.tex to no longer look for Fresh Air and This American Life summaries of Plex libraries.

Changes to be committed:
	modified:   docs/source/index.rst
	modified:   docs/source/plex-email/plex_email_api.rst
	modified:   docs/source/plex_prereqs.rst
	modified:   plexcore/__init__.py
	modified:   plexcore/plexcore.py
	modified:   plexemail/__init__.py
	modified:   plexemail/plexemail.py
	modified:   plexemail/plexemail_gui.py
	modified:   plextvdb/plextvdb.py
	modified:   resources/plexstuff_body_template.tex
  • Loading branch information
tanimislam committed Nov 6, 2019
1 parent dfb8c46 commit 69742cb
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 94 deletions.
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Here are some things I would like to finish.
.. _sshpass: https://linux.die.net/man/1/sshpass
.. _pandoc: https://pandoc.org
.. _sudo: https://en.wikipedia.org/wiki/Sudo
.. _LaTeX: https://en.wikipedia.org/wiki/LaTeX
.. _LaTeX: https://www.latex-project.org
.. _ghc: https://www.haskell.org/ghc
.. _stack: https://docs.haskellstack.org/en/stable/README
.. _cabal: http://hackage.haskell.org/package/cabal-install
Expand Down
9 changes: 8 additions & 1 deletion docs/source/plex-email/plex_email_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ This document describes the lower level Plex emailing API, upon which the :ref:`

plexemail module
------------------
This contains the lowest level methods to send email using either the `Google Contacts API`_ or through Python's :py:class:`SMTP <smtplib.SMTP>` functionality, and to find the Google contact names of friend emails on the Plex_ server. :py:class:`PlexIMGClient <plexstuff.plexemail.PlexIMGClient>` and :py:class:`PNGPicObject <plexstuff.plexemail.PNGPicObject>` allow one to add or remove images from one's Imgur_ acount.
This contains the lowest level methods to send email using either the `Google Contacts API`_ or through Python's :py:class:`SMTP <smtplib.SMTP>` functionality, and to find the Google contact names of friend emails on the Plex_ server. :py:class:`PlexIMGClient <plexemail.PlexIMGClient>` and :py:class:`PNGPicObject <plexemail.PNGPicObject>` allow one to add or remove images from one's Imgur_ acount.

.. automodule:: plexemail
:members:

plexemail.plexemail module
---------------------------
This implements the following functionality: sending emails of torrent files and magnet links; sending :py:class:`MIMEMultiPart <email.mime.multipart.MIMEMultiPart>` newsletter or more general style emails to friends of the Plex_ server; and sending general emails with attachments.

.. automodule:: plexemail.plexemail
:members:

.. _`Google Contacts API`: https://developers.google.com/contacts/v3
.. _Plex: https://plex.tv
.. _Imgur: https://imgur.com
2 changes: 1 addition & 1 deletion docs/source/plex_prereqs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Functionality CLI
.. _sshpass: https://linux.die.net/man/1/sshpass
.. _pandoc: https://pandoc.org
.. _sudo: https://en.wikipedia.org/wiki/Sudo
.. _LaTeX: https://en.wikipedia.org/wiki/LaTeX
.. _LaTeX: https://www.latex-project.org
.. _ghc: https://www.haskell.org/ghc
.. _stack: https://docs.haskellstack.org/en/stable/README
.. _cabal: http://hackage.haskell.org/package/cabal-install
Expand Down
2 changes: 1 addition & 1 deletion plexcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def signal_handler( signal, frame ):
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine, Column, String, JSON, Date, Boolean
from fuzzywuzzy.fuzz import partial_ratio
from PyQt4.QtGui import QLabel, QDialog, QAction, QMenu, QVBoxLayout, QTextEdit, QApplication, QColor, QFileDialog
from PyQt4.QtGui import QLabel, QDialog, QAction, QMenu, QVBoxLayout, QTextEdit, QApplication, QColor, QFileDialog, QPixmap
from PyQt4.QtCore import pyqtSignal, QTimer

# resource file and stuff
Expand Down
6 changes: 3 additions & 3 deletions plexcore/plexcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ def processValidHTMLWithPNG( html, pngDataDict, doEmbed = False ):
:param str html: the initial HTML document into which images are to be embedded.
:param dict pngDataDict: dictionary of PNG data. Key is the name of the PNG file (must end in .png). Value is a tuple of type ``(b64data, widthInCM, url)``. ``b64data`` is the `Base 64 encoded`_ binary representation of the PNG image. ``widthInCm`` is the image width in cm. ``url`` is thje URL address of the image.
:param dict pngDataDict: dictionary of PNG data. Key is the name of the PNG file (must end in .png). Value is a tuple of type ``(b64data, widthInCM, url)``. ``b64data`` is the `Base 64 encoded`_ binary representation of the PNG image. ``widthInCm`` is the image width in cm. ``url`` is the URL address of the image.
:param bool doEmbed: If ``True``, then the image source tag uses the `Base 64 encoded` data. If ``False``, the image source tag is the URL.
:returns: prettified HTML document with the images located in it.
:rtype: str
.. _Base 64 encoded: https://en.wikipedia.org/wiki/Base64
.. _`Base 64 encoded`: https://en.wikipedia.org/wiki/Base64
"""
htmlData = BeautifulSoup( html, 'lxml' )
pngNames = set(filter(
Expand Down Expand Up @@ -288,7 +288,7 @@ def pushCredentials( username, password ):
def get_all_servers( token, verify = True ):
"""Find all the Plex_ servers for which you have access.
:param str token: the Plex str access token, returned by :py:meth:`checkServerCredentials <plexcore.checkServerCredentials>`.
:param str token: the Plex :py:class:`str` access token, returned by :py:meth:`checkServerCredentials <plexcore.checkServerCredentials>`.
:param bool verify: optional bool argument, whether to verify SSL connections. Default is ``True``.
:returns: a dictionary of servers accessible to you. Each key is the Plex_ server's name, and the value is a :py:class:`dict` that looks like this.
Expand Down
2 changes: 1 addition & 1 deletion plexemail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def upload_image( self, b64img, name, imgMD5 = None ):
* :py:meth:`refreshImages <plexemail.PlexIMGClient.refreshImages>`
* :py:meth:`delete_image <plexemail.PlexIMGClient.delete_image>`
* :py:meth:`change_name <plexemail.PlexIMGClient.change_name>`
.. _Base64: https://en.wikipedia.org/wiki/Base64
"""
if imgMD5 is None:
Expand Down
Loading

0 comments on commit 69742cb

Please sign in to comment.