comparison profilemanager/manager.py @ 63:2f58555b3b28

correct variable names
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 May 2010 12:16:05 -0700
parents e29fed5097c3
children 18f16bd1ba6b
comparison
equal deleted inserted replaced
62:e29fed5097c3 63:2f58555b3b28
181 # single profile 181 # single profile
182 profile_dict = self.profile_dict(profile) 182 profile_dict = self.profile_dict(profile)
183 if 'Backups' not in profile_dict: 183 if 'Backups' not in profile_dict:
184 return [] 184 return []
185 backups = profile_dict['Backups'].split(':') 185 backups = profile_dict['Backups'].split(':')
186 backup_dirs = [] 186 backups_dirs = []
187 for backup in backups: 187 for backup in backups:
188 if os.path.isabs(backup): 188 if os.path.isabs(backup):
189 backup_dir = backup 189 backup_dir = backup
190 else: 190 else:
191 backup_dir = os.path.join(self.profile_dir, self.backups_dir, backup) 191 backup_dir = os.path.join(self.profile_dir, self.backups_dir, backup)
195 # sort by reverse datestamp 195 # sort by reverse datestamp
196 backups_dirs.sort(key=lambda x: x[1], reverse=True) 196 backups_dirs.sort(key=lambda x: x[1], reverse=True)
197 197
198 # format to datestamps, if applicable 198 # format to datestamps, if applicable
199 if datestamp: 199 if datestamp:
200 backup_dirs = [ (i[0], time.strftime(datestamp, 200 backups_dirs = [ (i[0], time.strftime(datestamp,
201 time.localtime(int(i[1])))) 201 time.localtime(int(i[1]))))
202 for i in backup_dirs ] 202 for i in backups_dirs ]
203 203
204 return backups_dirs 204 return backups_dirs
205 205
206 def restore(self, profile, date=None, delete=False): 206 def restore(self, profile, date=None, delete=False):
207 """ 207 """