Exemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     if not self.my_config.name:
         self.my_config.name = _('Local mailboxes')
     self.my_config.protocol = 'local'  # We may be upgrading an old
                                        # mbox or maildir source.
     self.watching = -1
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     if not self.my_config.name:
         self.my_config.name = _('Local mail')
     self.my_config.protocol = 'local'  # We may be upgrading an old
     # mbox or maildir source.
     self.watching = -1
Exemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.timeout = self.DEFAULT_TIMEOUT
     self.watching = -1
     self.capabilities = set()
     self.conn = None
     self.conn_id = ""
Exemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.timeout = self.TIMEOUT_INITIAL
     self.watching = -1
     self.capabilities = set()
     self.conn = None
     self.conn_id = ''
Exemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.timeout = self.TIMEOUT_INITIAL
     self.watching = -1
     self.capabilities = set()
     self.conn = None
     self.conn_id = ''
Exemplo n.º 6
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.timeout = self.TIMEOUT_INITIAL
     self.last_op = 0
     self.watching = -1
     self.capabilities = set()
     self.namespaces = {'private': []}
     self.flag_cache = {}
     self.conn = None
     self.conn_id = ''
Exemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.timeout = self.TIMEOUT_INITIAL
     self.last_op = 0
     self.watching = -1
     self.capabilities = set()
     self.namespaces = {'private': []}
     self.flag_cache = {}
     self.conn = None
     self.conn_id = ''
Exemplo n.º 8
0
 def _sorted_mailboxes(self):
     # This allows changes to BLACKLISTED_MAILBOXES to have an effect
     # even if peoples' configs say otherwise.
     return [
         m for m in BaseMailSource._sorted_mailboxes(self)
         if m.name.lower() not in BLACKLISTED_MAILBOXES
     ]
Exemplo n.º 9
0
 def _create_tag(self, *args, **kwargs):
     ptag = kwargs.get('parent')
     try:
         if ptag:
             return self.session.config.get_tags(ptag)[0]._key
     except (IndexError, KeyError):
         pass
     return BaseMailSource._create_tag(self, *args, **kwargs)
Exemplo n.º 10
0
 def _mailbox_sort_key(self, mbx):
     # Sort mailboxes so the most recently modified get scanned first.
     mt = 0
     for p in self._data_paths(mbx):
         try:
             mt = max(mt, os.path.getmtime(p))
         except (OSError, IOError):
             pass
     if mt:
         return '%20.20d' % (0x10000000000 - long(mt))
     else:
         return BaseMailSource._mailbox_sort_key(self, mbx)
Exemplo n.º 11
0
 def _mailbox_sort_key(self, mbx):
     # Sort mailboxes so the most recently modified get scanned first.
     mt = 0
     for p in self._data_paths(mbx):
         try:
             mt = max(mt, os.path.getmtime(p))
         except (OSError, IOError):
             pass
     if mt:
         return "%20.20d" % (0x10000000000 - long(mt))
     else:
         return BaseMailSource._mailbox_sort_key(self, mbx)
Exemplo n.º 12
0
 def quit(self, *args, **kwargs):
     if self.conn:
         self.conn.quit()
     return BaseMailSource.quit(self, *args, **kwargs)
Exemplo n.º 13
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.watching = -1
Exemplo n.º 14
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.timeout = self.DEFAULT_TIMEOUT
     self.watching = -1
     self.capabilities = set()
     self.conn = None
Exemplo n.º 15
0
 def _sleep(self, seconds):
     # FIXME: While we are sleeping, we should switch to IDLE mode
     #        if it is available.
     if 'IDLE' in self.capabilities:
         pass
     return BaseMailSource._sleep(self, seconds)
Exemplo n.º 16
0
 def _sleep(self, seconds):
     # FIXME: While we are sleeping, we should switch to IDLE mode
     #        if it is available.
     if 'IDLE' in self.capabilities:
         pass
     return BaseMailSource._sleep(self, seconds)
Exemplo n.º 17
0
 def quit(self, *args, **kwargs):
     if self.conn:
         self.conn.quit()
     return BaseMailSource.quit(self, *args, **kwargs)
Exemplo n.º 18
0
 def _sleep(self, *args, **kwargs):
     self.close()
     return BaseMailSource._sleep(self, *args, **kwargs)
Exemplo n.º 19
0
 def _sorted_mailboxes(self):
     # This allows changes to BLACKLISTED_MAILBOXES to have an effect
     # even if peoples' configs say otherwise.
     return [
         m for m in BaseMailSource._sorted_mailboxes(self)
         if m.name.lower() not in BLACKLISTED_MAILBOXES]
Exemplo n.º 20
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.watching = -1
Exemplo n.º 21
0
 def _sleep(self, *args, **kwargs):
     self.close()
     return BaseMailSource._sleep(self, *args, **kwargs)
Exemplo n.º 22
0
 def __init__(self, *args, **kwargs):
     BaseMailSource.__init__(self, *args, **kwargs)
     self.watching = -1
     self.capabilities = None
     self.conn = None