comparison profilemanager/manager.py @ 70:6e282cacd5f0

split the string
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 May 2010 16:06:05 -0700
parents 86b137d49467
children 494ea3c2f578
comparison
equal deleted inserted replaced
69:86b137d49467 70:6e282cacd5f0
279 shutil.rmtree(backup_path) 279 shutil.rmtree(backup_path)
280 280
281 # delete the entry from ``profiles.ini`` 281 # delete the entry from ``profiles.ini``
282 parser = self.parser() 282 parser = self.parser()
283 section = self.section(profile) 283 section = self.section(profile)
284 backups = parser.get(section, 'Backups') 284 backups = parser.get(section, 'Backups').split(':')
285 backups = [ i for i in backups if i != backup[0] ] 285 backups = [ i for i in backups if i != backup[0] ]
286 parser.set(section, 'Backups', ':'.join(backups)) 286 parser.set(section, 'Backups', ':'.join(backups))
287 287
288 # if there are no backups, delete the ``backups`` line 288 # if there are no backups, delete the ``backups`` line
289 # and the backups directory 289 # and the backups directory
290 import pdb; pdb.set_trace()
290 if not backups: 291 if not backups:
291 parser.remove(section, 'Backups') 292 parser.remove(section, 'Backups')
292 backups_dir = os.path.join(self.profile_dir, self.backups_dir) 293 backups_dir = os.path.join(self.profile_dir, self.backups_dir)
293 if not os.listdir(backups_dir): 294 if not os.listdir(backups_dir):
294 shutil.rmtree(backups_dir) 295 shutil.rmtree(backups_dir)