Fix the gmail_notify plugin
This commit is contained in:
parent
5ef01ecdd1
commit
f8cea760b6
@ -23,13 +23,13 @@ class GmailQuery(ElementBase):
|
|||||||
plugin_attrib = 'gmail'
|
plugin_attrib = 'gmail'
|
||||||
interfaces = set(('newer-than-time', 'newer-than-tid', 'q', 'search'))
|
interfaces = set(('newer-than-time', 'newer-than-tid', 'q', 'search'))
|
||||||
|
|
||||||
def getSearch(self):
|
def get_search(self):
|
||||||
return self['q']
|
return self['q']
|
||||||
|
|
||||||
def setSearch(self, search):
|
def set_search(self, search):
|
||||||
self['q'] = search
|
self['q'] = search
|
||||||
|
|
||||||
def delSearch(self):
|
def del_search(self):
|
||||||
del self['q']
|
del self['q']
|
||||||
|
|
||||||
|
|
||||||
@ -40,17 +40,17 @@ class MailBox(ElementBase):
|
|||||||
interfaces = set(('result-time', 'total-matched', 'total-estimate',
|
interfaces = set(('result-time', 'total-matched', 'total-estimate',
|
||||||
'url', 'threads', 'matched', 'estimate'))
|
'url', 'threads', 'matched', 'estimate'))
|
||||||
|
|
||||||
def getThreads(self):
|
def get_threads(self):
|
||||||
threads = []
|
threads = []
|
||||||
for threadXML in self.xml.findall('{%s}%s' % (MailThread.namespace,
|
for threadXML in self.xml.findall('{%s}%s' % (MailThread.namespace,
|
||||||
MailThread.name)):
|
MailThread.name)):
|
||||||
threads.append(MailThread(xml=threadXML, parent=None))
|
threads.append(MailThread(xml=threadXML, parent=None))
|
||||||
return threads
|
return threads
|
||||||
|
|
||||||
def getMatched(self):
|
def get_matched(self):
|
||||||
return self['total-matched']
|
return self['total-matched']
|
||||||
|
|
||||||
def getEstimate(self):
|
def get_estimate(self):
|
||||||
return self['total-estimate'] == '1'
|
return self['total-estimate'] == '1'
|
||||||
|
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ class MailThread(ElementBase):
|
|||||||
'senders', 'url', 'labels', 'subject', 'snippet'))
|
'senders', 'url', 'labels', 'subject', 'snippet'))
|
||||||
sub_interfaces = set(('labels', 'subject', 'snippet'))
|
sub_interfaces = set(('labels', 'subject', 'snippet'))
|
||||||
|
|
||||||
def getSenders(self):
|
def get_senders(self):
|
||||||
senders = []
|
senders = []
|
||||||
sendersXML = self.xml.find('{%s}senders' % self.namespace)
|
sendersXML = self.xml.find('{%s}senders' % self.namespace)
|
||||||
if sendersXML is not None:
|
if sendersXML is not None:
|
||||||
@ -77,10 +77,10 @@ class MailSender(ElementBase):
|
|||||||
plugin_attrib = 'sender'
|
plugin_attrib = 'sender'
|
||||||
interfaces = set(('address', 'name', 'originator', 'unread'))
|
interfaces = set(('address', 'name', 'originator', 'unread'))
|
||||||
|
|
||||||
def getOriginator(self):
|
def get_originator(self):
|
||||||
return self.xml.attrib.get('originator', '0') == '1'
|
return self.xml.attrib.get('originator', '0') == '1'
|
||||||
|
|
||||||
def getUnread(self):
|
def get_unread(self):
|
||||||
return self.xml.attrib.get('unread', '0') == '1'
|
return self.xml.attrib.get('unread', '0') == '1'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user