From 0ca63c9c963e0991415a26d88769587a355b99af Mon Sep 17 00:00:00 2001 From: khamidou Date: Thu, 18 Feb 2010 17:15:30 +0100 Subject: [PATCH] polished liszt-setup --- liszt-setup | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/liszt-setup b/liszt-setup index 9fc6046..2eed113 100755 --- a/liszt-setup +++ b/liszt-setup @@ -2,11 +2,20 @@ # This program setups the ~/.liszt directory. import os +import shutil import ConfigParser path = os.path.expanduser('~/.liszt/') if os.access(path, os.F_OK): + # Get rid of the previously created directory. + try: + shutil.rmtre(path) + except OSError: + print "Error : Unable to remove " + path + sys.exit(-1) + + os.mkdir(path) os.chdir(path) else: os.mkdir(path) -- 2.43.0