summaryrefslogtreecommitdiffstats
path: root/layman/overlays
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-02-23 23:05:45 -0800
committerBrian Dolbec <brian.dolbec@gmail.com>2011-03-26 19:39:13 -0700
commita160cc7323338779f8f96e4b63da3e22742d9063 (patch)
treee8259a68447dc98bd48c78a9fe073ae8676a18ad /layman/overlays
parentbc8019e52ba29b30b528d31aa46180576e7d9dcb (diff)
downloadlayman-a160cc7323338779f8f96e4b63da3e22742d9063.tar.gz
layman-a160cc7323338779f8f96e4b63da3e22742d9063.tar.bz2
layman-a160cc7323338779f8f96e4b63da3e22742d9063.zip
remove unused import.
change an exception into an output.error message. set more functions to return True/False
Diffstat (limited to 'layman/overlays')
-rw-r--r--layman/overlays/source.py8
1 files 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?'''