def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # class and root for all backends. self.backends = {} self.backends['sqlite'] = { 'class': LocalStatusSQLiteFolder, 'root': os.path.join(account.getaccountmeta(), 'LocalStatus-sqlite') } self.backends['plain'] = { 'class': LocalStatusFolder, 'root': os.path.join(account.getaccountmeta(), 'LocalStatus') } if self.account.getconf('status_backend', None) is not None: raise OfflineImapError( "the 'status_backend' configuration option is not supported" " anymore; please, remove this configuration option.", OfflineImapError.ERROR.REPO) # Set class and root for sqlite. self.setup_backend('sqlite') if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a dict of name:LocalStatusFolders(). self._folders = {}
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # class and root for all backends. self.backends = {} self.backends['sqlite'] = { 'class': LocalStatusSQLiteFolder, 'root': os.path.join(account.getaccountmeta(), 'LocalStatus-sqlite') } self.backends['plain'] = { 'class': LocalStatusFolder, 'root': os.path.join(account.getaccountmeta(), 'LocalStatus') } if self.account.getconf('status_backend', None) is not None: raise OfflineImapError( "the 'status_backend' configuration option is not supported" " anymore; please, remove this configuration option.", OfflineImapError.ERROR.REPO ) # Set class and root for sqlite. self.setup_backend('sqlite') if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a dict of name:LocalStatusFolders(). self._folders = {}
def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None self.imapserver = imapserver.IMAPServer(self) self.folders = None
def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None self.imapserver = imapserver.IMAPServer(self) self.folders = None if self.getconf('sep', None): self.ui.info("The 'sep' setting is being ignored for IMAP " "repository '%s' (it's autodetected)"% self)
def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None self.imapserver = imapserver.IMAPServer(self) self.folders = None if self.getconf('sep', None): self.ui.info("The 'sep' setting is being ignored for IMAP " "repository '%s' (it's autodetected)" % self)
def __init__(self, reposname, account): """Initialize a MaildirRepository object. Takes a path name to the directory holding all the Maildir directories.""" BaseRepository.__init__(self, reposname, account) self.mailpath = self.getconf("mailpath", reposname) self.db_url = self.getconf("database") self.folders = None self.ui = getglobalui() self.connect()
def __init__(self, reposname, account): """Initialize a MaildirRepository object. Takes a path name to the directory holding all the Maildir directories.""" BaseRepository.__init__(self, reposname, account) self.root = self.getlocalroot() self.folders = None self.ui = getglobalui() self.debug("MaildirRepository initialized, sep is " + repr(self.getsep())) self.folder_atimes = [] # Create the top-level folder if it doesn't exist if not os.path.isdir(self.root): os.mkdir(self.root, 0o700)
def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None self.imapserver = imapserver.IMAPServer(self) self.folders = None # Only set the newmail_hook in an IMAP repository. if self.config.has_option(self.getsection(), 'newmail_hook'): self.newmail_hook = self.localeval.eval( self.getconf('newmail_hook')) if self.getconf('sep', None): self.ui.info("The 'sep' setting is being ignored for IMAP " "repository '%s' (it's autodetected)"% self)
def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None self._oauth2_request_url = None self.imapserver = imapserver.IMAPServer(self) self.folders = None # Only set the newmail_hook in an IMAP repository. if self.config.has_option(self.getsection(), 'newmail_hook'): self.newmail_hook = self.localeval.eval( self.getconf('newmail_hook')) if self.getconf('sep', None): self.ui.info("The 'sep' setting is being ignored for IMAP " "repository '%s' (it's autodetected)" % self)
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None # Must be set before calling imapserver.IMAPServer(self) self.oauth2_request_url = None self.imapserver = imapserver.IMAPServer(self) self.folders = None self.copy_ignore_eval = None # Keep alive. self.kaevent = None self.kathread = None # Only set the newmail_hook in an IMAP repository. if self.config.has_option(self.getsection(), "newmail_hook"): self.newmail_hook = self.localeval.eval(self.getconf("newmail_hook")) if self.getconf("sep", None): self.ui.info("The 'sep' setting is being ignored for IMAP " "repository '%s' (it's autodetected)" % self)
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # class and root for all backends self.backends = {} self.backends['sqlite'] = {'class': LocalStatusSQLiteFolder, 'root' : os.path.join(account.getaccountmeta(), 'LocalStatus-sqlite')} self.backends['plain'] = {'class': LocalStatusFolder, 'root' : os.path.join(account.getaccountmeta(), 'LocalStatus')} # Set class and root for the configured backend self.setup_backend(self.account.getconf('status_backend', 'plain')) if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a dict of name:LocalStatusFolders() self._folders = {}
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # Root directory in which the LocalStatus folders reside self.root = os.path.join(account.getaccountmeta(), "LocalStatus") # statusbackend can be 'plain' or 'sqlite' backend = self.account.getconf("status_backend", "plain") if backend == "sqlite": self._backend = "sqlite" self.LocalStatusFolderClass = LocalStatusSQLiteFolder self.root += "-sqlite" elif backend == "plain": self._backend = "plain" self.LocalStatusFolderClass = LocalStatusFolder else: raise SyntaxWarning("Unknown status_backend '%s' for account '%s'" % (backend, account.name)) if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a dict of name:LocalStatusFolders() self._folders = {}
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self._host = None # Must be set before calling imapserver.IMAPServer(self) self.oauth2_request_url = None self.imapserver = imapserver.IMAPServer(self) self.folders = None self.copy_ignore_eval = None # Keep alive. self.kaevent = None self.kathread = None # Only set the newmail_hook in an IMAP repository. if self.config.has_option(self.getsection(), 'newmail_hook'): self.newmail_hook = self.localeval.eval( self.getconf('newmail_hook')) if self.getconf('sep', None): self.ui.info("The 'sep' setting is being ignored for IMAP " "repository '%s' (it's autodetected)" % self)
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # Root directory in which the LocalStatus folders reside self.root = os.path.join(account.getaccountmeta(), 'LocalStatus') # statusbackend can be 'plain' or 'sqlite' backend = self.account.getconf('status_backend', 'plain') if backend == 'sqlite': self._backend = 'sqlite' self.LocalStatusFolderClass = LocalStatusSQLiteFolder self.root += '-sqlite' elif backend == 'plain': self._backend = 'plain' self.LocalStatusFolderClass = LocalStatusFolder else: raise SyntaxWarning("Unknown status_backend '%s' for account '%s'" \ % (backend, account.name)) if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a list of LocalStatusFolders() self._folders = None
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # Root directory in which the LocalStatus folders reside self.root = os.path.join(account.getaccountmeta(), 'LocalStatus') # statusbackend can be 'plain' or 'sqlite' backend = self.account.getconf('status_backend', 'plain') if backend == 'sqlite': self._backend = 'sqlite' self.LocalStatusFolderClass = LocalStatusSQLiteFolder self.root += '-sqlite' elif backend == 'plain': self._backend = 'plain' self.LocalStatusFolderClass = LocalStatusFolder else: raise SyntaxWarning("Unknown status_backend '%s' for account '%s'" \ % (backend, account.name)) if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a dict of name:LocalStatusFolders() self._folders = {}
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # class and root for all backends self.backends = {} self.backends["sqlite"] = { "class": LocalStatusSQLiteFolder, "root": os.path.join(account.getaccountmeta(), "LocalStatus-sqlite"), } self.backends["plain"] = { "class": LocalStatusFolder, "root": os.path.join(account.getaccountmeta(), "LocalStatus"), } # Set class and root for the configured backend self.setup_backend(self.account.getconf("status_backend", "plain")) if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a dict of name:LocalStatusFolders() self._folders = {}
def __init__(self, reposname, account): BaseRepository.__init__(self, reposname, account) # class and root for all backends self.backends = {} self.backends['sqlite'] = { 'class': LocalStatusSQLiteFolder, 'root': os.path.join(account.getaccountmeta(), 'LocalStatus-sqlite') } self.backends['plain'] = { 'class': LocalStatusFolder, 'root': os.path.join(account.getaccountmeta(), 'LocalStatus') } # Set class and root for the configured backend self.setup_backend(self.account.getconf('status_backend', 'plain')) if not os.path.exists(self.root): os.mkdir(self.root, 0o700) # self._folders is a dict of name:LocalStatusFolders() self._folders = {}
def __init__(self, reposname, account): """Initialize a MaildirRepository object. Takes a path name to the directory holding all the Maildir directories.""" BaseRepository.__init__(self, reposname, account) self.root = self.getlocalroot() self.folders = None self.ui = getglobalui() self.debug("MaildirRepository initialized, sep is %s"% repr(self.getsep())) self.folder_atimes = [] # Create the top-level folder if it doesn't exist if not os.path.isdir(self.root): os.makedirs(self.root, 0o700) # Create the keyword->char mapping self.keyword2char = dict() for c in 'abcdefghijklmnopqrstuvwxyz': confkey = 'customflag_' + c keyword = self.getconf(confkey, None) if keyword is not None: self.keyword2char[keyword] = c
def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self.imapserver = imapserver.ConfigedIMAPServer(self) self.folders = None self.nametrans = lambda foldername: foldername self.folderfilter = lambda foldername: 1 self.folderincludes = [] self.foldersort = cmp localeval = self.localeval if self.config.has_option(self.getsection(), 'nametrans'): self.nametrans = localeval.eval(self.getconf('nametrans'), {'re': re}) if self.config.has_option(self.getsection(), 'folderfilter'): self.folderfilter = localeval.eval(self.getconf('folderfilter'), {'re': re}) if self.config.has_option(self.getsection(), 'folderincludes'): self.folderincludes = localeval.eval(self.getconf('folderincludes'), {'re': re}) if self.config.has_option(self.getsection(), 'foldersort'): self.foldersort = localeval.eval(self.getconf('foldersort'), {'re': re})
def __init__(self, reposname, account): """Initialize an IMAPRepository object.""" BaseRepository.__init__(self, reposname, account) # self.ui is being set by the BaseRepository self.imapserver = imapserver.ConfigedIMAPServer(self) self.folders = None self.nametrans = lambda foldername: foldername self.folderfilter = lambda foldername: 1 self.folderincludes = [] self.foldersort = cmp localeval = self.localeval if self.config.has_option(self.getsection(), 'nametrans'): self.nametrans = localeval.eval(self.getconf('nametrans'), {'re': re}) if self.config.has_option(self.getsection(), 'folderfilter'): self.folderfilter = localeval.eval(self.getconf('folderfilter'), {'re': re}) if self.config.has_option(self.getsection(), 'folderincludes'): self.folderincludes = localeval.eval( self.getconf('folderincludes'), {'re': re}) if self.config.has_option(self.getsection(), 'foldersort'): self.foldersort = localeval.eval(self.getconf('foldersort'), {'re': re})
def __init__(self, reposname, account): """Initialize a MaildirRepository object. Takes a path name to the directory holding all the Maildir directories.""" BaseRepository.__init__(self, reposname, account) self.root = self.getlocalroot() self.folders = None self.ui = getglobalui() self.debug("MaildirRepository initialized, sep is %s" % repr(self.getsep())) self.folder_atimes = [] # Create the top-level folder if it doesn't exist if not os.path.isdir(self.root): os.makedirs(self.root, 0o700) # Create the keyword->char mapping self.keyword2char = dict() for c in 'abcdefghijklmnopqrstuvwxyz': confkey = 'customflag_' + c keyword = self.getconf(confkey, None) if keyword is not None: self.keyword2char[keyword] = c