Re_TGZ = re.compile('.tar.gz$') if not Re_TGZ.search(Download): Download = "No tar.gz:" + Download print Download sys.exit() ### Get the filename. Temp = string.split(Download, '/') self.mysql_file = Temp[-1] if len(self.mysql_file) < 1: print "ERROR: download file has bad name.", self.mysql_file sys.exit() self.download_type = "manual" self.mysql_compile_dir = Re_TGZ.sub('', self.mysql_file) ### Get the directories. Temp = string.split(Download[::-1], '/', 1) self.ftp_dir = Temp[1][::-1] self.prefix = "/usr/local/" + self.mysql_compile_dir