Organisation class in a folder

This commit is contained in:
Valentin CZERYBA 2023-04-11 22:15:36 +02:00
parent 05a3a28c6f
commit 7848968fa1
5 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
backup/
backup1/
web_scrap.log
__pycache__/

View File

@ -3,7 +3,8 @@ from requests.auth import HTTPBasicAuth
from getpass import getpass
from urllib.parse import urlparse
import argparse, logging
import WPImport, WPExport
from lib.WPImport import WPimport
from lib.WPExport import WPExport
if __name__ == '__main__':
@ -71,7 +72,7 @@ if __name__ == '__main__':
basic = HTTPBasicAuth(args.user, password)
wordpress = args.wordpress.split(",")
importWp = WPImport.WPimport(basic, "", logger, args.parser)
importWp = WPimport(basic, "", logger, args.parser)
if len(args.file) > 0:
for i in wordpress:
importWp.setUrl(i)
@ -93,11 +94,11 @@ if __name__ == '__main__':
importWp.fromDirectory(directory[i])
exit(0)
if len(args.canalblog) > 0:
exportWp = WPExport.WPExport("", logger, args.parser, args.directory)
exportWp = WPExport("", logger, args.parser, args.directory)
canalblog = args.canalblog.split(",")
wordpress = args.wordpress.split(",")
if serial is False:
if args.serial is False:
for canal in canalblog:
try:
o = urlparse(canal)
@ -132,7 +133,7 @@ if __name__ == '__main__':
if args.command == "export":
canalblog = args.url.split(",")
exportWp = WPExport.WPExport("", logger, args.parser, args.directory)
exportWp = WPExport("", logger, args.parser, args.directory)
for canal in canalblog:
try:
o = urlparse(canal)

0
lib/__init__.py Normal file
View File