subparser import
This commit is contained in:
parent
8384dcb2b6
commit
b3f623cbd5
@ -7,14 +7,19 @@ import WPImport
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
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("--debug", help="Verbosity", action="store_true")
|
||||||
parser.add_argument("--logfile", help="Log file", default="")
|
parser.add_argument("--logfile", help="Log file", default="")
|
||||||
parser.add_argument("--quiet", help="No console output", action="store_true")
|
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()
|
args = parser.parse_args()
|
||||||
logger = logging.getLogger('insert wordpress')
|
logger = logging.getLogger('insert wordpress')
|
||||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user