From 5916cbff00ac9c778f02a3a7dee3d43f18ff334e Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 26 May 2023 10:04:36 +0200 Subject: [PATCH] fix parameter --- import_export_canalblog.py | 2 +- lib/WPExport.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/import_export_canalblog.py b/import_export_canalblog.py index defac75..0b17753 100644 --- a/import_export_canalblog.py +++ b/import_export_canalblog.py @@ -126,7 +126,7 @@ if __name__ == '__main__': parser.add_argument("--quiet", help="No console output", action="store_true") parser.add_argument("--parser", help="Parser content", default="html.parser") parser.add_argument("--parallel", help="Define number thread (default : 1)", default=1) - parser.add_argument("--no-ssl", help="No ssl for canalblog and/or wordpress (example wordpress,canalblog)", dest=ssl, default="") + parser.add_argument("--no-ssl", help="No ssl for canalblog and/or wordpress (example wordpress,canalblog)", dest="ssl", default="") subparsers = parser.add_subparsers(dest="command") diff --git a/lib/WPExport.py b/lib/WPExport.py index 8ff0100..cbdc1bc 100644 --- a/lib/WPExport.py +++ b/lib/WPExport.py @@ -270,9 +270,11 @@ class WPExport: self._mkdirPath("{0}/{1}/{2}".format(backup_dir, o.netloc, dir_page_web)) try: r = self._request.get(webpage[i]) - except Exception as err: - self._logger.error("Connection error : {0}".format(err)) + except ConnectionError as err: + self._logger.error("{0} : Connection error : {1}".format(self._name, err)) exit(1) + except Exception as err: + self._logger.error("{0} Exception error : {1}".format(self._name, err)) if r.status_code == 200: fileDownload = "{0}/{1}/index.html".format(backup_dir, o.netloc) if len(dir_page_web) > 0 and len(filePageWeb) > 0: