more message debug

This commit is contained in:
Valentin CZERYBA 2023-05-21 21:14:36 +02:00
parent 75772ba7f0
commit 3718b807ba

View File

@ -511,7 +511,7 @@ class WPimport:
for index in range(1,10):
params = {"search": title, "per_page":100, "page": index}
try:
self._logger.info("{0} : Search post : {1}".format(self._name, title))
self._logger.info("{0} : Search post withi index {2} : {1}".format(self._name, title, index))
page = self._request.get("http://{0}/wp-json/wp/v2/posts".format(self._wordpress), auth=self._basic, params=params, headers=self._headers_json)
except ConnectionError as err:
self._logger.error("{0} : Connection error for search post : {1}".format(self._name, err))
@ -527,13 +527,13 @@ class WPimport:
self._logger.info("{0} : Number result posts : {1}".format(self._name, len(result)))
count = 0
for i in result:
self._logger.info("{0} : Search title posts for |{2}| : |{1}|".format(self._name, i["title"]["rendered"], title))
title_rendered = i["title"]["rendered"].replace('’', "'")
title_rendered = title_rendered.replace('–', '-')
title_rendered = title_rendered.replace('…', '...')
title_rendered = title_rendered.replace('« ', '"')
title_rendered = title_rendered.replace(' »', '"')
self._logger.debug("{0} : Search title posts for |{2}| : |{1}|".format(self._name, title_rendered, title))
self._logger.debug("{0} : SIze of title : {1} - {2}".format(self._name, len(title), len(title_rendered)))
if title_rendered == title:
page_is_exist = True