subparser import

This commit is contained in:
Valentin CZERYBA 2023-04-08 23:20:52 +02:00
parent 8384dcb2b6
commit b3f623cbd5

View File

@ -7,14 +7,19 @@ import WPImport
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--user", help="wordpress user", required=True)
parser.add_argument("--file", help="HTML file", default="")
parser.add_argument("--directory", help="HTML directory", default="")
parser.add_argument("--wordpress", help="URL Wordpress", required=True)
parser.add_argument("--debug", help="Verbosity", action="store_true")
parser.add_argument("--logfile", help="Log file", default="")
parser.add_argument("--quiet", help="No console output", action="store_true")
subparsers = parser.add_subparsers()
import_parser = subparsers.add_parser("import")
import_parser.add_argument("--user", help="wordpress user", required=True)
import_parser.add_argument("--file", help="HTML file", default="")
import_parser.add_argument("--directory", help="HTML directory", default="")
import_parser.add_argument("--wordpress", help="URL Wordpress", required=True)
args = parser.parse_args()
logger = logging.getLogger('insert wordpress')
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')