23 <p> |
23 <p> |
24 Module implementing a dialog to send bug reports. |
24 Module implementing a dialog to send bug reports. |
25 </p> |
25 </p> |
26 <h3>Global Attributes</h3> |
26 <h3>Global Attributes</h3> |
27 <table> |
27 <table> |
28 <tr><td>APPLICATION_NAME</td></tr><tr><td>CLIENT_SECRET_FILE</td></tr><tr><td>CREDENTIALS_FILE</td></tr><tr><td>SCOPES</td></tr> |
28 <tr><td>None</td></tr> |
29 </table> |
29 </table> |
30 <h3>Classes</h3> |
30 <h3>Classes</h3> |
31 <table> |
31 <table> |
32 <tr><td>None</td></tr> |
32 <tr> |
|
33 <td><a href="#E5GoogleMail">E5GoogleMail</a></td> |
|
34 <td>Class implementing the logic to send emails via Google Mail.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#E5GoogleMailAuthBrowser">E5GoogleMailAuthBrowser</a></td> |
|
37 <td>Module function to get the Google credentials.</td> |
|
38 </tr> |
33 </table> |
39 </table> |
34 <h3>Functions</h3> |
40 <h3>Functions</h3> |
35 <table> |
41 <table> |
36 <tr> |
42 <tr> |
37 <td><a href="#GoogleMailHelp">GoogleMailHelp</a></td> |
43 <td><a href="#GoogleMailHelp">GoogleMailHelp</a></td> |
38 <td>Module function to get some help about how to enable the Google Mail OAuth2 service.</td> |
44 <td>Module function to get some help about how to enable the Google Mail OAuth2 service.</td> |
39 </tr><tr> |
|
40 <td><a href="#GoogleMailSendMessage">GoogleMailSendMessage</a></td> |
|
41 <td>Module function to send an email message via Google Mail.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#_prepareMessage_v2">_prepareMessage_v2</a></td> |
|
44 <td>Module function to prepare the message for sending (Python2 Variant).</td> |
|
45 </tr><tr> |
|
46 <td><a href="#_prepareMessage_v3">_prepareMessage_v3</a></td> |
|
47 <td>Module function to prepare the message for sending (Python2 Variant).</td> |
|
48 </tr><tr> |
|
49 <td><a href="#getCredentials">getCredentials</a></td> |
|
50 <td>Module function to get the Google credentials.</td> |
|
51 </tr><tr> |
|
52 <td><a href="#isClientSecretFileAvailable">isClientSecretFileAvailable</a></td> |
|
53 <td>Module function to check, if the client secret file has been installed.</td> |
|
54 </tr> |
45 </tr> |
55 </table> |
46 </table> |
|
47 <hr /><hr /> |
|
48 <a NAME="E5GoogleMail" ID="E5GoogleMail"></a> |
|
49 <h2>E5GoogleMail</h2> |
|
50 <p> |
|
51 Class implementing the logic to send emails via Google Mail. |
|
52 </p><h3>Signals</h3> |
|
53 <dl> |
|
54 <dt>sendResult(bool, str)</dt> |
|
55 <dd> |
|
56 emitted to indicate the transmission result |
|
57 and a result message |
|
58 </dd> |
|
59 </dl> |
|
60 <h3>Derived from</h3> |
|
61 QObject |
|
62 <h3>Class Attributes</h3> |
|
63 <table> |
|
64 <tr><td>None</td></tr> |
|
65 </table> |
|
66 <h3>Class Methods</h3> |
|
67 <table> |
|
68 <tr><td>None</td></tr> |
|
69 </table> |
|
70 <h3>Methods</h3> |
|
71 <table> |
|
72 <tr> |
|
73 <td><a href="#E5GoogleMail.__init__">E5GoogleMail</a></td> |
|
74 <td>Constructor</td> |
|
75 </tr><tr> |
|
76 <td><a href="#E5GoogleMail.__credentialsFromSession">__credentialsFromSession</a></td> |
|
77 <td>Private method to create a credentials object.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#E5GoogleMail.__doSendMessages">__doSendMessages</a></td> |
|
80 <td>Private method to send all queued messages.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#E5GoogleMail.__loadToken">__loadToken</a></td> |
|
83 <td>Private method to load a token from the token file.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#E5GoogleMail.__prepareMessage_v2">__prepareMessage_v2</a></td> |
|
86 <td>Private method to prepare the message for sending (Python2 Variant).</td> |
|
87 </tr><tr> |
|
88 <td><a href="#E5GoogleMail.__prepareMessage_v3">__prepareMessage_v3</a></td> |
|
89 <td>Private method to prepare the message for sending (Python2 Variant).</td> |
|
90 </tr><tr> |
|
91 <td><a href="#E5GoogleMail.__processAuthorization">__processAuthorization</a></td> |
|
92 <td>Private slot to process the received authorization code.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#E5GoogleMail.__saveToken">__saveToken</a></td> |
|
95 <td>Private method to save a token to the token file.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#E5GoogleMail.__startSession">__startSession</a></td> |
|
98 <td>Private method to start an authorized session and optionally start the authorization flow.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#E5GoogleMail.sendMessage">sendMessage</a></td> |
|
101 <td>Public method to send a message via Google Mail.</td> |
|
102 </tr> |
|
103 </table> |
|
104 <h3>Static Methods</h3> |
|
105 <table> |
|
106 <tr><td>None</td></tr> |
|
107 </table> |
|
108 <a NAME="E5GoogleMail.__init__" ID="E5GoogleMail.__init__"></a> |
|
109 <h4>E5GoogleMail (Constructor)</h4> |
|
110 <b>E5GoogleMail</b>(<i>parent=None</i>) |
|
111 <p> |
|
112 Constructor |
|
113 </p><dl> |
|
114 <dt><i>parent</i> (QObject)</dt> |
|
115 <dd> |
|
116 reference to the parent object |
|
117 </dd> |
|
118 </dl><a NAME="E5GoogleMail.__credentialsFromSession" ID="E5GoogleMail.__credentialsFromSession"></a> |
|
119 <h4>E5GoogleMail.__credentialsFromSession</h4> |
|
120 <b>__credentialsFromSession</b>(<i></i>) |
|
121 <p> |
|
122 Private method to create a credentials object. |
|
123 </p><dl> |
|
124 <dt>Returns:</dt> |
|
125 <dd> |
|
126 created credentials object |
|
127 </dd> |
|
128 </dl><dl> |
|
129 <dt>Return Type:</dt> |
|
130 <dd> |
|
131 google.oauth2.credentials.Credentials |
|
132 </dd> |
|
133 </dl><a NAME="E5GoogleMail.__doSendMessages" ID="E5GoogleMail.__doSendMessages"></a> |
|
134 <h4>E5GoogleMail.__doSendMessages</h4> |
|
135 <b>__doSendMessages</b>(<i></i>) |
|
136 <p> |
|
137 Private method to send all queued messages. |
|
138 </p><a NAME="E5GoogleMail.__loadToken" ID="E5GoogleMail.__loadToken"></a> |
|
139 <h4>E5GoogleMail.__loadToken</h4> |
|
140 <b>__loadToken</b>(<i></i>) |
|
141 <p> |
|
142 Private method to load a token from the token file. |
|
143 </p><dl> |
|
144 <dt>Returns:</dt> |
|
145 <dd> |
|
146 loaded token |
|
147 </dd> |
|
148 </dl><dl> |
|
149 <dt>Return Type:</dt> |
|
150 <dd> |
|
151 dict or None |
|
152 </dd> |
|
153 </dl><a NAME="E5GoogleMail.__prepareMessage_v2" ID="E5GoogleMail.__prepareMessage_v2"></a> |
|
154 <h4>E5GoogleMail.__prepareMessage_v2</h4> |
|
155 <b>__prepareMessage_v2</b>(<i>message</i>) |
|
156 <p> |
|
157 Private method to prepare the message for sending (Python2 Variant). |
|
158 </p><dl> |
|
159 <dt><i>message</i> (email.mime.text.MIMEBase)</dt> |
|
160 <dd> |
|
161 message to be prepared |
|
162 </dd> |
|
163 </dl><dl> |
|
164 <dt>Returns:</dt> |
|
165 <dd> |
|
166 prepared message dictionary |
|
167 </dd> |
|
168 </dl><dl> |
|
169 <dt>Return Type:</dt> |
|
170 <dd> |
|
171 dict |
|
172 </dd> |
|
173 </dl><a NAME="E5GoogleMail.__prepareMessage_v3" ID="E5GoogleMail.__prepareMessage_v3"></a> |
|
174 <h4>E5GoogleMail.__prepareMessage_v3</h4> |
|
175 <b>__prepareMessage_v3</b>(<i>message</i>) |
|
176 <p> |
|
177 Private method to prepare the message for sending (Python2 Variant). |
|
178 </p><dl> |
|
179 <dt><i>message</i> (email.mime.text.MIMEBase)</dt> |
|
180 <dd> |
|
181 message to be prepared |
|
182 </dd> |
|
183 </dl><dl> |
|
184 <dt>Returns:</dt> |
|
185 <dd> |
|
186 prepared message dictionary |
|
187 </dd> |
|
188 </dl><dl> |
|
189 <dt>Return Type:</dt> |
|
190 <dd> |
|
191 dict |
|
192 </dd> |
|
193 </dl><a NAME="E5GoogleMail.__processAuthorization" ID="E5GoogleMail.__processAuthorization"></a> |
|
194 <h4>E5GoogleMail.__processAuthorization</h4> |
|
195 <b>__processAuthorization</b>(<i>authCode</i>) |
|
196 <p> |
|
197 Private slot to process the received authorization code. |
|
198 </p><dl> |
|
199 <dt><i>authCode</i> (str)</dt> |
|
200 <dd> |
|
201 received authorization code |
|
202 </dd> |
|
203 </dl><a NAME="E5GoogleMail.__saveToken" ID="E5GoogleMail.__saveToken"></a> |
|
204 <h4>E5GoogleMail.__saveToken</h4> |
|
205 <b>__saveToken</b>(<i>token</i>) |
|
206 <p> |
|
207 Private method to save a token to the token file. |
|
208 </p><dl> |
|
209 <dt><i>token</i> (dict)</dt> |
|
210 <dd> |
|
211 token to be saved |
|
212 </dd> |
|
213 </dl><a NAME="E5GoogleMail.__startSession" ID="E5GoogleMail.__startSession"></a> |
|
214 <h4>E5GoogleMail.__startSession</h4> |
|
215 <b>__startSession</b>(<i></i>) |
|
216 <p> |
|
217 Private method to start an authorized session and optionally start the |
|
218 authorization flow. |
|
219 </p><a NAME="E5GoogleMail.sendMessage" ID="E5GoogleMail.sendMessage"></a> |
|
220 <h4>E5GoogleMail.sendMessage</h4> |
|
221 <b>sendMessage</b>(<i>message</i>) |
|
222 <p> |
|
223 Public method to send a message via Google Mail. |
|
224 </p><dl> |
|
225 <dt><i>message</i> (email.mime.text.MIMEBase)</dt> |
|
226 <dd> |
|
227 email message to be sent |
|
228 </dd> |
|
229 </dl> |
|
230 <div align="right"><a href="#top">Up</a></div> |
|
231 <hr /><hr /> |
|
232 <a NAME="E5GoogleMailAuthBrowser" ID="E5GoogleMailAuthBrowser"></a> |
|
233 <h2>E5GoogleMailAuthBrowser</h2> |
|
234 <p> |
|
235 Module function to get the Google credentials. |
|
236 </p><p> |
|
237 Class implementing a simple web browser to perform the OAuth2 |
|
238 authentication process. |
|
239 </p><dl> |
|
240 <dt>Returns:</dt> |
|
241 <dd> |
|
242 Google Mail credentials |
|
243 </dd> |
|
244 </dl><h3>Signals</h3> |
|
245 <dl> |
|
246 <dt>approvalCodeReceived(str)</dt> |
|
247 <dd> |
|
248 emitted to indicate the receipt of the |
|
249 approval code |
|
250 </dd> |
|
251 </dl> |
|
252 <h3>Derived from</h3> |
|
253 QDialog |
|
254 <h3>Class Attributes</h3> |
|
255 <table> |
|
256 <tr><td>None</td></tr> |
|
257 </table> |
|
258 <h3>Class Methods</h3> |
|
259 <table> |
|
260 <tr><td>None</td></tr> |
|
261 </table> |
|
262 <h3>Methods</h3> |
|
263 <table> |
|
264 <tr> |
|
265 <td><a href="#E5GoogleMailAuthBrowser.__init__">E5GoogleMailAuthBrowser</a></td> |
|
266 <td>Constructor</td> |
|
267 </tr><tr> |
|
268 <td><a href="#E5GoogleMailAuthBrowser.__pageLoadFinished">__pageLoadFinished</a></td> |
|
269 <td>Private slot handling the loadFinished signal.</td> |
|
270 </tr><tr> |
|
271 <td><a href="#E5GoogleMailAuthBrowser.__titleChanged">__titleChanged</a></td> |
|
272 <td>Private slot handling changes of the web page title.</td> |
|
273 </tr><tr> |
|
274 <td><a href="#E5GoogleMailAuthBrowser.load">load</a></td> |
|
275 <td>Public method to start the authorization flow by loading the given URL.</td> |
|
276 </tr> |
|
277 </table> |
|
278 <h3>Static Methods</h3> |
|
279 <table> |
|
280 <tr><td>None</td></tr> |
|
281 </table> |
|
282 <a NAME="E5GoogleMailAuthBrowser.__init__" ID="E5GoogleMailAuthBrowser.__init__"></a> |
|
283 <h4>E5GoogleMailAuthBrowser (Constructor)</h4> |
|
284 <b>E5GoogleMailAuthBrowser</b>(<i>parent=None</i>) |
|
285 <p> |
|
286 Constructor |
|
287 </p><dl> |
|
288 <dt><i>parent</i> (QWidget)</dt> |
|
289 <dd> |
|
290 reference to the parent widget |
|
291 </dd> |
|
292 </dl><a NAME="E5GoogleMailAuthBrowser.__pageLoadFinished" ID="E5GoogleMailAuthBrowser.__pageLoadFinished"></a> |
|
293 <h4>E5GoogleMailAuthBrowser.__pageLoadFinished</h4> |
|
294 <b>__pageLoadFinished</b>(<i></i>) |
|
295 <p> |
|
296 Private slot handling the loadFinished signal. |
|
297 </p><a NAME="E5GoogleMailAuthBrowser.__titleChanged" ID="E5GoogleMailAuthBrowser.__titleChanged"></a> |
|
298 <h4>E5GoogleMailAuthBrowser.__titleChanged</h4> |
|
299 <b>__titleChanged</b>(<i>title</i>) |
|
300 <p> |
|
301 Private slot handling changes of the web page title. |
|
302 </p><dl> |
|
303 <dt><i>title</i> (str)</dt> |
|
304 <dd> |
|
305 web page title |
|
306 </dd> |
|
307 </dl><a NAME="E5GoogleMailAuthBrowser.load" ID="E5GoogleMailAuthBrowser.load"></a> |
|
308 <h4>E5GoogleMailAuthBrowser.load</h4> |
|
309 <b>load</b>(<i>url</i>) |
|
310 <p> |
|
311 Public method to start the authorization flow by loading the given URL. |
|
312 </p><dl> |
|
313 <dt><i>url</i> (str or QUrl)</dt> |
|
314 <dd> |
|
315 URL to be laoded |
|
316 </dd> |
|
317 </dl> |
|
318 <div align="right"><a href="#top">Up</a></div> |
56 <hr /><hr /> |
319 <hr /><hr /> |
57 <a NAME="GoogleMailHelp" ID="GoogleMailHelp"></a> |
320 <a NAME="GoogleMailHelp" ID="GoogleMailHelp"></a> |
58 <h2>GoogleMailHelp</h2> |
321 <h2>GoogleMailHelp</h2> |
59 <b>GoogleMailHelp</b>(<i></i>) |
322 <b>GoogleMailHelp</b>(<i></i>) |
60 <p> |
323 <p> |
70 <dd> |
333 <dd> |
71 str |
334 str |
72 </dd> |
335 </dd> |
73 </dl> |
336 </dl> |
74 <div align="right"><a href="#top">Up</a></div> |
337 <div align="right"><a href="#top">Up</a></div> |
75 <hr /><hr /> |
|
76 <a NAME="GoogleMailSendMessage" ID="GoogleMailSendMessage"></a> |
|
77 <h2>GoogleMailSendMessage</h2> |
|
78 <b>GoogleMailSendMessage</b>(<i>message</i>) |
|
79 <p> |
|
80 Module function to send an email message via Google Mail. |
|
81 </p><dl> |
|
82 <dt><i>message</i> (email.mime.text.MIMEBase)</dt> |
|
83 <dd> |
|
84 email message to be sent |
|
85 </dd> |
|
86 </dl><dl> |
|
87 <dt>Returns:</dt> |
|
88 <dd> |
|
89 tuple containing a success flag and a result or error message |
|
90 </dd> |
|
91 </dl><dl> |
|
92 <dt>Return Type:</dt> |
|
93 <dd> |
|
94 tuple of (bool, str) |
|
95 </dd> |
|
96 </dl> |
|
97 <div align="right"><a href="#top">Up</a></div> |
|
98 <hr /><hr /> |
|
99 <a NAME="_prepareMessage_v2" ID="_prepareMessage_v2"></a> |
|
100 <h2>_prepareMessage_v2</h2> |
|
101 <b>_prepareMessage_v2</b>(<i>message</i>) |
|
102 <p> |
|
103 Module function to prepare the message for sending (Python2 Variant). |
|
104 </p><dl> |
|
105 <dt><i>message</i> (email.mime.text.MIMEBase)</dt> |
|
106 <dd> |
|
107 message to be prepared |
|
108 </dd> |
|
109 </dl><dl> |
|
110 <dt>Returns:</dt> |
|
111 <dd> |
|
112 prepared message dictionary |
|
113 </dd> |
|
114 </dl><dl> |
|
115 <dt>Return Type:</dt> |
|
116 <dd> |
|
117 dict |
|
118 </dd> |
|
119 </dl> |
|
120 <div align="right"><a href="#top">Up</a></div> |
|
121 <hr /><hr /> |
|
122 <a NAME="_prepareMessage_v3" ID="_prepareMessage_v3"></a> |
|
123 <h2>_prepareMessage_v3</h2> |
|
124 <b>_prepareMessage_v3</b>(<i>message</i>) |
|
125 <p> |
|
126 Module function to prepare the message for sending (Python2 Variant). |
|
127 </p><dl> |
|
128 <dt><i>message</i> (email.mime.text.MIMEBase)</dt> |
|
129 <dd> |
|
130 message to be prepared |
|
131 </dd> |
|
132 </dl><dl> |
|
133 <dt>Returns:</dt> |
|
134 <dd> |
|
135 prepared message dictionary |
|
136 </dd> |
|
137 </dl><dl> |
|
138 <dt>Return Type:</dt> |
|
139 <dd> |
|
140 dict |
|
141 </dd> |
|
142 </dl> |
|
143 <div align="right"><a href="#top">Up</a></div> |
|
144 <hr /><hr /> |
|
145 <a NAME="getCredentials" ID="getCredentials"></a> |
|
146 <h2>getCredentials</h2> |
|
147 <b>getCredentials</b>(<i></i>) |
|
148 <p> |
|
149 Module function to get the Google credentials. |
|
150 </p><dl> |
|
151 <dt>Returns:</dt> |
|
152 <dd> |
|
153 Google Mail credentials |
|
154 </dd> |
|
155 </dl> |
|
156 <div align="right"><a href="#top">Up</a></div> |
|
157 <hr /><hr /> |
|
158 <a NAME="isClientSecretFileAvailable" ID="isClientSecretFileAvailable"></a> |
|
159 <h2>isClientSecretFileAvailable</h2> |
|
160 <b>isClientSecretFileAvailable</b>(<i></i>) |
|
161 <p> |
|
162 Module function to check, if the client secret file has been installed. |
|
163 </p><dl> |
|
164 <dt>Returns:</dt> |
|
165 <dd> |
|
166 flag indicating, that the credentials file is there |
|
167 </dd> |
|
168 </dl><dl> |
|
169 <dt>Return Type:</dt> |
|
170 <dd> |
|
171 bool |
|
172 </dd> |
|
173 </dl> |
|
174 <div align="right"><a href="#top">Up</a></div> |
|
175 <hr /> |
338 <hr /> |
176 </body></html> |
339 </body></html> |