[PATCH 1/4] Replaced tabs with spaces to unify python sources
Vladimir.Marek at oracle.com
Vladimir.Marek at oracle.com
Tue Aug 16 09:55:13 BST 2011
From: Vladimir Marek <vlmarek at volny.cz>
Signed-off-by: Vladimir Marek <vlmarek at volny.cz>
---
offlineimap/folder/UIDMaps.py | 2 +-
offlineimap/repository/Base.py | 12 ++++++------
offlineimap/repository/Gmail.py | 2 +-
offlineimap/repository/Maildir.py | 34 +++++++++++++++++-----------------
4 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/offlineimap/folder/UIDMaps.py b/offlineimap/folder/UIDMaps.py
index 9233662..fa1924d 100644
--- a/offlineimap/folder/UIDMaps.py
+++ b/offlineimap/folder/UIDMaps.py
@@ -34,7 +34,7 @@ class MappedIMAPFolder(IMAPFolder):
diskl2r: dict mapping message uids: self.r2l[localuid]=remoteuid"""
def __init__(self, *args, **kwargs):
- IMAPFolder.__init__(self, *args, **kwargs)
+ IMAPFolder.__init__(self, *args, **kwargs)
self.maplock = Lock()
(self.diskr2l, self.diskl2r) = self._loadmaps()
self._mb = IMAPFolder(*args, **kwargs)
diff --git a/offlineimap/repository/Base.py b/offlineimap/repository/Base.py
index 34f2f4a..ae4d32c 100644
--- a/offlineimap/repository/Base.py
+++ b/offlineimap/repository/Base.py
@@ -42,14 +42,14 @@ class BaseRepository(object, CustomConfig.ConfigHelperMixin):
# The 'restoreatime' config parameter only applies to local Maildir
# mailboxes.
def restore_atime(self):
- if self.config.get('Repository ' + self.name, 'type').strip() != \
- 'Maildir':
- return
+ if self.config.get('Repository ' + self.name, 'type').strip() != \
+ 'Maildir':
+ return
- if not self.config.has_option('Repository ' + self.name, 'restoreatime') or not self.config.getboolean('Repository ' + self.name, 'restoreatime'):
- return
+ if not self.config.has_option('Repository ' + self.name, 'restoreatime') or not self.config.getboolean('Repository ' + self.name, 'restoreatime'):
+ return
- return self.restore_folder_atimes()
+ return self.restore_folder_atimes()
def connect(self):
"""Establish a connection to the remote, if necessary. This exists
diff --git a/offlineimap/repository/Gmail.py b/offlineimap/repository/Gmail.py
index fd95361..20ed1f1 100644
--- a/offlineimap/repository/Gmail.py
+++ b/offlineimap/repository/Gmail.py
@@ -73,7 +73,7 @@ class GmailRepository(IMAPRepository):
def gettrashfolder(self, foldername):
#: Where deleted mail should be moved
return self.getconf('trashfolder','[Gmail]/Trash')
-
+
def getspamfolder(self):
#: Gmail also deletes messages upon EXPUNGE in the Spam folder
return self.getconf('spamfolder','[Gmail]/Spam')
diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py
index 069748a..ef3a723 100644
--- a/offlineimap/repository/Maildir.py
+++ b/offlineimap/repository/Maildir.py
@@ -32,28 +32,28 @@ class MaildirRepository(BaseRepository):
self.folders = None
self.ui = getglobalui()
self.debug("MaildirRepository initialized, sep is " + repr(self.getsep()))
- self.folder_atimes = []
+ self.folder_atimes = []
# Create the top-level folder if it doesn't exist
if not os.path.isdir(self.root):
os.mkdir(self.root, 0700)
def _append_folder_atimes(self, foldername):
- p = os.path.join(self.root, foldername)
- new = os.path.join(p, 'new')
- cur = os.path.join(p, 'cur')
- f = p, os.stat(new)[ST_ATIME], os.stat(cur)[ST_ATIME]
- self.folder_atimes.append(f)
+ p = os.path.join(self.root, foldername)
+ new = os.path.join(p, 'new')
+ cur = os.path.join(p, 'cur')
+ f = p, os.stat(new)[ST_ATIME], os.stat(cur)[ST_ATIME]
+ self.folder_atimes.append(f)
def restore_folder_atimes(self):
- if not self.folder_atimes:
- return
+ if not self.folder_atimes:
+ return
- for f in self.folder_atimes:
- t = f[1], os.stat(os.path.join(f[0], 'new'))[ST_MTIME]
- os.utime(os.path.join(f[0], 'new'), t)
- t = f[2], os.stat(os.path.join(f[0], 'cur'))[ST_MTIME]
- os.utime(os.path.join(f[0], 'cur'), t)
+ for f in self.folder_atimes:
+ t = f[1], os.stat(os.path.join(f[0], 'new'))[ST_MTIME]
+ os.utime(os.path.join(f[0], 'new'), t)
+ t = f[2], os.stat(os.path.join(f[0], 'cur'))[ST_MTIME]
+ os.utime(os.path.join(f[0], 'cur'), t)
def getlocalroot(self):
return os.path.expanduser(self.getconf('localfolders'))
@@ -110,8 +110,8 @@ class MaildirRepository(BaseRepository):
self.ui.warn("NOT YET IMPLEMENTED: DELETE FOLDER %s" % foldername)
def getfolder(self, foldername):
- if self.config.has_option('Repository ' + self.name, 'restoreatime') and self.config.getboolean('Repository ' + self.name, 'restoreatime'):
- self._append_folder_atimes(foldername)
+ if self.config.has_option('Repository ' + self.name, 'restoreatime') and self.config.getboolean('Repository ' + self.name, 'restoreatime'):
+ self._append_folder_atimes(foldername)
return folder.Maildir.MaildirFolder(self.root, foldername,
self.getsep(), self,
self.accountname, self.config)
@@ -155,11 +155,11 @@ class MaildirRepository(BaseRepository):
# This directory has maildir stuff -- process
self.debug(" This is maildir folder '%s'." % foldername)
- if self.config.has_option('Repository %s' % self,
+ if self.config.has_option('Repository %s' % self,
'restoreatime') and \
self.config.getboolean('Repository %s' % self,
'restoreatime'):
- self._append_folder_atimes(foldername)
+ self._append_folder_atimes(foldername)
retval.append(folder.Maildir.MaildirFolder(self.root,
foldername,
self.getsep(),
--
Vlad
More information about the OfflineIMAP-project
mailing list