From a160cc7323338779f8f96e4b63da3e22742d9063 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Wed, 23 Feb 2011 23:05:45 -0800 Subject: remove unused import. change an exception into an output.error message. set more functions to return True/False --- layman/overlays/source.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layman/overlays/source.py b/layman/overlays/source.py index 586ec6c..be7b639 100644 --- a/layman/overlays/source.py +++ b/layman/overlays/source.py @@ -18,7 +18,6 @@ import copy import sys import shutil import subprocess -#from layman.debug import OUT from layman.utils import path @@ -75,10 +74,12 @@ class OverlaySource(object): mdir = path([base, self.parent.name]) if os.path.exists(mdir): - raise Exception('Directory ' + mdir + + self.output.error('Directory ' + mdir + ' already exists. Will not overwrite its contents!') + return False os.makedirs(mdir) + return True def sync(self, base, quiet = False): '''Sync the overlay.''' @@ -91,10 +92,11 @@ class OverlaySource(object): if not os.path.exists(mdir): self.output.warn('Directory ' + mdir + \ ' did not exist, no files deleted.') - return + return false self.output.info('Deleting directory "%s"' % mdir, 2) shutil.rmtree(mdir) + return True def supported(self): '''Is the overlay type supported?''' -- cgit v1.2.3-1-g7c22