Improved behavior when tmp directory exists

This commit is contained in:
Michael Schmatz 2014-01-04 17:14:18 -05:00
parent c0a9ebe548
commit c366945d89

View file

@ -31,19 +31,13 @@ class DirectoryController(object):
os.mkdir(full_path)
def create_base_directories(self):
#first create the directory for the development environment to be installed in
try:
#os.mkdir(self.root_install_directory)
#then the tmp directory for file downloads and the like
if os.path.exists(self.tmp_directory):
shutil.rmtree(self.tmp_directory)
os.mkdir(self.tmp_directory)
#then the bin directory for binaries(also includes binaries for dependencies?
#os.mkdir(self.bin_directory)
except:
#cleanup whatever we created
#self.remove_directories()
raise errors.CoCoError(u"There was an error creating the directory structure, do you have correct permissions? Please remove all and start over.")
def remove_directories(self):
print u"Removed directories created!"
shutil.rmtree(self.tmp_directory)