(self, level, response)
save the response to related folder
save the response to related folder
save the response to related folder
def save_to_file_system(self, level, response):
        """
        save the response to related folder
        """
        if level in [1, 2, 3, 4, 5]:
            fileName = self.get_clean_file_name(level, response)
            if fileName is None:
                return

            fn = path.join(self.settings["DOWNLOAD_FILE_FOLDER"], str(level), fileName)
            self.create_path_if_not_exist(fn)
            if not path.exists(fn):
                with open(fn, "w") as f:
                    f.write(response.body)
def save_to_file_system ( self , level , response ) : if level in [ 1 , 2 , 3 , 4 , 5 ] : fileName = self . get_clean_file_name ( level , response ) if fileName is None : return fn = path . join ( self . settings [ "DOWNLOAD_FILE_FOLDER" ] , str ( level ) , fileName ) self . create_path_if_not_exist ( fn ) if not path . exists ( fn ) : with open ( fn , "w" ) as f : f . write ( response . body )