| |   |
| 30 | 30 | from gsentinel.plugin import PluginManager |
| 31 | 31 | from gsentinel.ui import GmailStatusIcon |
| 32 | 32 | |
| 33 | | class Message (dict): |
| 34 | | """Message struct""" |
| 35 | | def __init__ (self): |
| 36 | | self.update( {'id' : "", |
| 37 | | 'title' : "", |
| 38 | | 'summary' : "", |
| 39 | | 'author_name' : "", |
| 40 | | 'author_email' : "", |
| 41 | | 'link' : ""} ) |
| 42 | | |
| 43 | | def __cmp__ (self, msg): |
| 44 | | """Messages are compared by id""" |
| 45 | | return cmp(self['id'], msg['id']) |
| 46 | | |
| 47 | | def __hash__ (self): |
| 48 | | """Hash method""" |
| 49 | | return hash(self['id']) |
| 50 | | |
| 51 | 33 | class GmailSentinel(object): |
| 52 | 34 | """Main class.""" |
| 53 | 35 | |
| toggle raw diff |
--- a/src/__init__.py
+++ b/src/__init__.py
@@ -30,24 +30,6 @@ from gsentinel.atom import GmailAtom
from gsentinel.plugin import PluginManager
from gsentinel.ui import GmailStatusIcon
-class Message (dict):
- """Message struct"""
- def __init__ (self):
- self.update( {'id' : "",
- 'title' : "",
- 'summary' : "",
- 'author_name' : "",
- 'author_email' : "",
- 'link' : ""} )
-
- def __cmp__ (self, msg):
- """Messages are compared by id"""
- return cmp(self['id'], msg['id'])
-
- def __hash__ (self):
- """Hash method"""
- return hash(self['id'])
-
class GmailSentinel(object):
"""Main class."""
|
| |   |
| 1 | #! /usr/bin/env python |
| 2 | # -*- coding: utf-8 -*- |
| 3 | # |
| 4 | # Copyright (C) 2008 Rodrigo Lazo |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 2, or (at your option) |
| 9 | # any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | |
| 20 | """ |
| 21 | Gmail Sentinel Message class |
| 22 | |
| 23 | This file is only for the message class. Due some problems with |
| 24 | imports, I decided to put this class alone in its own. |
| 25 | """ |
| 26 | |
| 27 | class Message (dict): |
| 28 | """Message struct""" |
| 29 | def __init__ (self): |
| 30 | self.update( {'id' : "", |
| 31 | 'title' : "", |
| 32 | 'summary' : "", |
| 33 | 'author_name' : "", |
| 34 | 'author_email' : "", |
| 35 | 'link' : ""} ) |
| 36 | |
| 37 | def __cmp__ (self, msg): |
| 38 | """Messages are compared by id""" |
| 39 | return cmp(self['id'], msg['id']) |
| 40 | |
| 41 | def __hash__ (self): |
| 42 | """Hash method""" |
| 43 | return hash(self['id']) |
| toggle raw diff |
--- /dev/null
+++ b/src/message.py
@@ -0,0 +1,43 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2008 Rodrigo Lazo
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+"""
+Gmail Sentinel Message class
+
+This file is only for the message class. Due some problems with
+imports, I decided to put this class alone in its own.
+"""
+
+class Message (dict):
+ """Message struct"""
+ def __init__ (self):
+ self.update( {'id' : "",
+ 'title' : "",
+ 'summary' : "",
+ 'author_name' : "",
+ 'author_email' : "",
+ 'link' : ""} )
+
+ def __cmp__ (self, msg):
+ """Messages are compared by id"""
+ return cmp(self['id'], msg['id'])
+
+ def __hash__ (self):
+ """Hash method"""
+ return hash(self['id']) |