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