(self, ticket)
return True
method to clear the temp directory where files will be uploaded to
method to clear the temp directory where files will be uploaded to
method to clear the temp directory where files will be uploaded to
def clear_upload_dir(self, ticket):
        '''method to clear the temp directory where files will be uploaded to'''
        upload_dir = Environment.get_upload_dir()
        if not os.path.exists(upload_dir):
            return False

        if not os.path.isdir (upload_dir):
            return False

        # put in a failsafe
        tmp_dir = Environment.get_tmp_dir()
        assert upload_dir.startswith(tmp_dir)

        shutil.rmtree(upload_dir)
        return True
def clear_upload_dir ( self , ticket ) : upload_dir = Environment . get_upload_dir ( ) if not os . path . exists ( upload_dir ) : return False if not os . path . isdir ( upload_dir ) : return False # put in a failsafe tmp_dir = Environment . get_tmp_dir ( ) assert upload_dir . startswith ( tmp_dir ) shutil . rmtree ( upload_dir ) return True