import sys import shutil from diracdoctools.Config import Configuration from diracdoctools.Utilities import makeLogger from diraccfg import CFG # Try/except for python3 compatibility to ignore errors in ``import DIRAC`` while they last # ultimate protection against not having the symbols imported is also done in the ``run`` function try: from DIRAC import S_OK, S_ERROR except ImportError: pass LOG = makeLogger("ConcatCFG") class ConcatCFG(object): def __init__(self, configFile="docs.conf"): self.config = Configuration(configFile, sections=["CFG"]) self.retVal = 0 def prepareDiracCFG(self): """Copy dirac.cfg file to source dir.""" LOG.info("Copy %r to source directory", self.config.cfg_baseFile) shutil.copy(self.config.cfg_baseFile, "/".join([self.config.docsPath, "source/"])) def updateCompleteDiracCFG(self): """Read the dirac.cfg and update the Systems sections from the ConfigTemplate.cfg files.""" compCfg = CFG()
#!/usr/bin/env python """Module to create command references for DIRAC.""" import ast import logging import glob import os import shutil import textwrap from diracdoctools.Utilities import writeLinesToFile, mkdir, runCommand, makeLogger from diracdoctools.Config import Configuration LOG = makeLogger('CommandReference') TITLE = 'title' PATTERN = 'pattern' SCRIPTS = 'scripts' IGNORE = 'ignore' SECTION_PATH = 'sectionPath' INDEX_FILE = 'indexFile' PREFIX = 'prefix' class CommandReference(object): def __init__(self, configFile='docs.conf', debug=False): self.config = Configuration(configFile, sections=['Commands']) self.exitcode = 0 self.debug = debug
from collections import OrderedDict import logging import os import re import textwrap import sys from diracdoctools.Config import Configuration from diracdoctools.Utilities import makeLogger from DIRAC.Core.Utilities.CFG import CFG from DIRAC import S_OK, S_ERROR LOG = makeLogger('ConcatCFG') class ConcatCFG(object): def __init__(self, configFile='docs.conf'): self.config = Configuration(configFile, sections=['CFG']) self.retVal = 0 def updateCompleteDiracCFG(self): """Read the dirac.cfg and update the Systems sections from the ConfigTemplate.cfg files.""" compCfg = CFG() mainDiracCfgPath = self.config.cfg_baseFile if not os.path.exists(mainDiracCfgPath): LOG.error('Failed to find Main Dirac cfg at %r', mainDiracCfgPath)
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import socket import sys import logging import glob from diracdoctools.Utilities import writeLinesToFile, mkdir, makeLogger from diracdoctools.Config import Configuration, CLParser as clparser LOG = makeLogger('CodeReference') # global used inside the CustomizedDocs modules CUSTOMIZED_DOCSTRINGS = {} class CLParser(clparser): """Extension to CLParser to also parse buildType.""" def __init__(self): super(CLParser, self).__init__() self.log = LOG.getChild('CLParser') self.clean = False self.parser.add_argument( '--buildType', action='store',
#!/usr/bin/env python """Module to create command references for DIRAC.""" from concurrent.futures import ThreadPoolExecutor import logging import os import shutil import textwrap from collections import namedtuple from diracdoctools.Utilities import writeLinesToFile, runCommand, makeLogger from diracdoctools.Config import Configuration, CLParser as clparser LOG = makeLogger("CommandReference") TITLE = "title" PATTERN = "pattern" SCRIPTS = "scripts" EXCLUDE = "exclude" RST_PATH = "rstPath" PREFIX = "prefix" Script = namedtuple("Script", "name system description") class CLParser(clparser): """Extension to CLParser to also parse clean.""" def __init__(self): self.clean = False super(CLParser, self).__init__() self.log = LOG.getChild("CLParser") self.parser.add_argument("--clean",
#!/usr/bin/env python """ create rst files for documentation of DIRAC """ import os import shutil import socket import sys import logging import glob from diracdoctools.Utilities import writeLinesToFile, mkdir, makeLogger from diracdoctools.Config import Configuration, CLParser as clparser LOG = makeLogger("CodeReference") # global used inside the CustomizedDocs modules CUSTOMIZED_DOCSTRINGS = {} class CLParser(clparser): """Extension to CLParser to also parse buildType.""" def __init__(self): super(CLParser, self).__init__() self.log = LOG.getChild("CLParser") self.clean = False self.parser.add_argument( "--buildType", action="store", default="full", choices=["full", "limited"], help="Build full or limited code reference",