|
|
|
@ -2,7 +2,7 @@ import os, json, sys, urllib
|
|
|
|
|
from mwclient import Site
|
|
|
|
|
from pprint import pprint
|
|
|
|
|
from jinja2 import Template
|
|
|
|
|
from functions import pandoc, page_props, unpack_response
|
|
|
|
|
from functions import pandoc, page_props, unpack_response, clean_dir
|
|
|
|
|
|
|
|
|
|
from functions import Colors
|
|
|
|
|
import argparse
|
|
|
|
@ -48,13 +48,14 @@ if args.dry is True:
|
|
|
|
|
|
|
|
|
|
site = Site(host=args.host, path=args.path)
|
|
|
|
|
|
|
|
|
|
wd = os.path.dirname(os.path.abspath(__file__)) # working directory
|
|
|
|
|
wd = os.path.dirname(os.path.abspath(__file__)) # working directory
|
|
|
|
|
imgdir = os.path.join(wd, 'images')
|
|
|
|
|
imgsjson_fn = os.path.join(wd, 'images.json')
|
|
|
|
|
with open(imgsjson_fn, 'r') as imgsjson_file:
|
|
|
|
|
images_info = json.load(imgsjson_file)
|
|
|
|
|
static_html = os.path.join(wd, 'static_html')
|
|
|
|
|
os.makedirs(static_html, exist_ok=True) # create images/ dir
|
|
|
|
|
os.makedirs(static_html, exist_ok=True) # create static_html/ dir
|
|
|
|
|
clean_dir(static_html) # if static_html exists and has files or dirs: clean it
|
|
|
|
|
|
|
|
|
|
with open(os.path.join(wd, 'login.txt'), 'r') as login: # read login user & pwd
|
|
|
|
|
loginlines = login.read()
|
|
|
|
@ -104,7 +105,6 @@ for answer in site.ask(query):
|
|
|
|
|
# print(pub_html, '\n')
|
|
|
|
|
pub_parts_html = '' # Reset pub_parts_html
|
|
|
|
|
|
|
|
|
|
# TODO: queries without Part?
|
|
|
|
|
# TODO: include Creator Property value
|
|
|
|
|
|
|
|
|
|
# TODO: address Dates:
|
|
|
|
|