7 Module implementing some helpers for Google mail. |
7 Module implementing some helpers for Google mail. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from eric7 import Globals |
12 from eric7 import EricUtilities |
13 from eric7.EricWidgets.EricApplication import ericApp |
13 from eric7.EricWidgets.EricApplication import ericApp |
14 from eric7.SystemUtilities import PythonUtilities |
14 from eric7.SystemUtilities import PythonUtilities |
15 |
15 |
16 SCOPES = ["https://www.googleapis.com/auth/gmail.send"] |
16 SCOPES = ["https://www.googleapis.com/auth/gmail.send"] |
17 CLIENT_SECRET_FILE = "eric_client_secret.json" # secok |
17 CLIENT_SECRET_FILE = "eric_client_secret.json" # secok |
30 Module function to check, if the client secret file has been installed. |
30 Module function to check, if the client secret file has been installed. |
31 |
31 |
32 @return flag indicating, that the credentials file is there |
32 @return flag indicating, that the credentials file is there |
33 @rtype bool |
33 @rtype bool |
34 """ |
34 """ |
35 return os.path.exists(os.path.join(Globals.getConfigDir(), CLIENT_SECRET_FILE)) |
35 return os.path.exists( |
|
36 os.path.join(EricUtilities.getConfigDir(), CLIENT_SECRET_FILE) |
|
37 ) |
36 |
38 |
37 |
39 |
38 def installGoogleAPIPackages(): |
40 def installGoogleAPIPackages(): |
39 """ |
41 """ |
40 Module function to install the required packages to support Google mail. |
42 Module function to install the required packages to support Google mail. |