import argparse import configparser import filecmp import fnmatch import logging import os import re import shutil import subprocess import sys import time import yaml from aura import cli cli.init_logging(False, True) has_errors = False CLONE_DIR = "." BASE_PORTAL_URL = "https://access.redhat.com/documentation/en-us/" # ID_RE = re.compile("^\[(?:\[|id=\'|#)(.*?)(\'?,.*?)?(?:\]|\')?\]", re.M | re.DOTALL) ID_RE = re.compile("^\[(?:\[|id=\'|#|id=\")(.*?)(\'?,.*?)?(?:\]|\'|\")?\]", re.M | re.DOTALL) LINKS_RE = re.compile( "(?:xref|link):([\./\w_-]*/?[\w_.-]*\.(?:html|adoc))?(#[\w_-]*)?(\[.*?\])", re.M | re.DOTALL) EXTERNAL_LINK_RE = re.compile( "[\./]*([\w_-]+)/[\w_/-]*?([\w_.-]*\.(?:html|adoc))", re.DOTALL) INCLUDE_RE = re.compile("include::(.*?)\[(.*?)\]", re.M) IFDEF_RE = re.compile(r"^if(n?)def::(.*?)\[\]", re.M) ENDIF_RE = re.compile(r"^endif::(.*?)\[\]\r?\n", re.M)
# update any old references for old_linkend in old_linkend_eles: if old_linkend.get("linkend") == id_val: old_linkend.set('linkend', new_id) for old_endterm in old_endterm_eles: if old_endterm.get("endterm") == id_val: old_endterm.set('endterm', new_id) # all validated? all_validated = True # Initialize logging cli.init_logging(False, False) for distro in os.listdir("drupal-build"): print("---------------------------------------") print("BUILDING " + distro + " BOOKS") print("---------------------------------------") for book in os.listdir(os.path.join("drupal-build", distro)): #print(os.getcwd() + "\n") #if not os.path.isdir("drupal-build/" + distro + "/" + book): #print("---------------------------------------") #print(">>> No Book " + book + " in this repo. Skipping <<<") #print("---------------------------------------")
# update any old references for old_linkend in old_linkend_eles: if old_linkend.get("linkend") == id_val: old_linkend.set('linkend', new_id) for old_endterm in old_endterm_eles: if old_endterm.get("endterm") == id_val: old_endterm.set('endterm', new_id) # all validated? all_validated = True # Initialize logging cli.init_logging(False, False) for distro in os.listdir("drupal-build"): print("---------------------------------------") print("BUILDING " + distro + " BOOKS") print("---------------------------------------") for book in os.listdir(os.path.join("drupal-build", distro)): #print(os.getcwd() + "\n") #if not os.path.isdir("drupal-build/" + distro + "/" + book): #print("---------------------------------------") #print(">>> No Book " + book + " in this repo. Skipping <<<") #print("---------------------------------------")
import argparse import ConfigParser import filecmp import fnmatch import logging import os import re import shutil import subprocess import sys import time import yaml from aura import cli cli.init_logging(False, True) has_errors = False CLONE_DIR = "." BASE_PORTAL_URL = "https://access.redhat.com/documentation/en-us/" ID_RE = re.compile("^\[(?:\[|id=\'|#)(.*?)(\'?,.*?)?(?:\]|\')?\]", re.M | re.DOTALL) LINKS_RE = re.compile("(?:xref|link):([\./\w_-]*/?[\w_.-]*\.(?:html|adoc))?(#[\w_-]*)?(\[.*?\])", re.M | re.DOTALL) EXTERNAL_LINK_RE = re.compile("[\./]*([\w_-]+)/[\w_/-]*?([\w_.-]*\.(?:html|adoc))", re.DOTALL) INCLUDE_RE = re.compile("include::(.*?)\[(.*?)\]", re.M) IFDEF_RE = re.compile(r"^if(n?)def::(.*?)\[\]", re.M) ENDIF_RE = re.compile(r"^endif::(.*?)\[\]\r?\n", re.M) COMMENT_CONTENT_RE = re.compile(r"^^////$.*?^////$", re.M | re.DOTALL) TAG_CONTENT_RE = re.compile(r"//\s+tag::(.*?)\[\].*?// end::(.*?)\[\]", re.M | re.DOTALL) CMP_IGNORE_FILES = [".git", ".gitignore", "README.md", "build.cfg"] DEVNULL = open(os.devnull, 'wb')