Google Mail: added the forgotten files.

Sat, 02 Mar 2019 18:10:57 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 02 Mar 2019 18:10:57 +0100
changeset 6829
3a6133fe99a8
parent 6828
bb6667ea9ae7
child 6830
54e687924d0f

Google Mail: added the forgotten files.

Documentation/Source/eric6.E5Network.E5GoogleMailHelpers.html file | annotate | diff | comparison | revisions
E5Network/E5GoogleMailHelpers.py file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Documentation/Source/eric6.E5Network.E5GoogleMailHelpers.html	Sat Mar 02 18:10:57 2019 +0100
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric6.E5Network.E5GoogleMailHelpers</title>
+<meta charset="UTF-8">
+<style>
+body {
+    background: #EDECE6;
+    margin: 0em 1em 10em 1em;
+    color: black;
+}
+
+h1 { color: white; background: #85774A; }
+h2 { color: white; background: #85774A; }
+h3 { color: white; background: #9D936E; }
+h4 { color: white; background: #9D936E; }
+    
+a { color: #BA6D36; }
+
+</style>
+</head>
+<body><a NAME="top" ID="top"></a>
+<h1>eric6.E5Network.E5GoogleMailHelpers</h1>
+<p>
+Module implementing some helpers for Google mail.
+</p>
+<h3>Global Attributes</h3>
+<table>
+<tr><td>APPLICATION_NAME</td></tr><tr><td>CLIENT_SECRET_FILE</td></tr><tr><td>RequiredPackages</td></tr><tr><td>SCOPES</td></tr><tr><td>TOKEN_FILE</td></tr>
+</table>
+<h3>Classes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Functions</h3>
+<table>
+<tr>
+<td><a href="#getInstallCommand">getInstallCommand</a></td>
+<td>Module function to get the install command to get the Google mail support activated.</td>
+</tr><tr>
+<td><a href="#isClientSecretFileAvailable">isClientSecretFileAvailable</a></td>
+<td>Module function to check, if the client secret file has been installed.</td>
+</tr>
+</table>
+<hr /><hr />
+<a NAME="getInstallCommand" ID="getInstallCommand"></a>
+<h2>getInstallCommand</h2>
+<b>getInstallCommand</b>(<i></i>)
+<p>
+    Module function to get the install command to get the Google mail support
+    activated.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+install command
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr /><hr />
+<a NAME="isClientSecretFileAvailable" ID="isClientSecretFileAvailable"></a>
+<h2>isClientSecretFileAvailable</h2>
+<b>isClientSecretFileAvailable</b>(<i></i>)
+<p>
+    Module function to check, if the client secret file has been installed.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating, that the credentials file is there
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/E5Network/E5GoogleMailHelpers.py	Sat Mar 02 18:10:57 2019 +0100
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing some helpers for Google mail.
+"""
+
+from __future__ import unicode_literals
+
+import os
+
+import Globals
+
+SCOPES = 'https://www.googleapis.com/auth/gmail.send'
+CLIENT_SECRET_FILE = 'eric_client_secret.json'
+TOKEN_FILE = 'eric_python_email_send_token.json'
+APPLICATION_NAME = 'Eric Python Send Email'
+
+RequiredPackages = (
+    "google-api-python-client",
+    "requests-oauthlib",
+)
+
+
+def isClientSecretFileAvailable():
+    """
+    Module function to check, if the client secret file has been installed.
+    
+    @return flag indicating, that the credentials file is there
+    @rtype bool
+    """
+    return os.path.exists(
+        os.path.join(Globals.getConfigDir(), CLIENT_SECRET_FILE))
+
+
+def getInstallCommand():
+    """
+    Module function to get the install command to get the Google mail support
+    activated.
+    
+    @return install command
+    @rtype str
+    """
+    pipCommand = "pip install --upgrade {0}".format(
+        " ".join(RequiredPackages))
+    
+    return pipCommand

eric ide

mercurial