LSSTApplications  16.0-10-g0ee56ad+4,16.0-11-ga33d1f2+4,16.0-12-g3ef5c14+2,16.0-12-g71e5ef5+17,16.0-12-gbdf3636+2,16.0-13-g118c103+2,16.0-13-g8f68b0a+2,16.0-15-gbf5c1cb+3,16.0-16-gfd17674+2,16.0-17-g7c01f5c+2,16.0-18-g0a50484,16.0-20-ga20f992+7,16.0-21-g0e05fd4+5,16.0-21-g15e2d33+3,16.0-22-g62d8060+3,16.0-22-g847a80f+3,16.0-25-gf00d9b8,16.0-28-g3990c221+3,16.0-3-gf928089+2,16.0-32-g88a4f23+4,16.0-34-gd7987ad+2,16.0-37-gc7333cb+1,16.0-4-g10fc685+1,16.0-4-g18f3627+25,16.0-4-g5f3a788+25,16.0-5-gaf5c3d7+3,16.0-5-gcc1f4bb,16.0-6-g3b92700+3,16.0-6-g4412fcd+2,16.0-6-g7235603+3,16.0-69-g2562ce1b+1,16.0-7-g0913a87,16.0-8-g14ebd58+3,16.0-8-g2df868b,16.0-8-g4cec79c+5,16.0-8-gadf6c7a,16.0-82-g59ec2a54a,16.0-9-g5400cdc+1,16.0-9-ge6233d7+4,master-g2880f2d8cf+2,v17.0.rc1
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst.sconsUtils.builders.DoxygenBuilder Class Reference

A callable to be used as an SCons Action to run Doxygen. More...

Public Member Functions

def __init__ (self, kw)
 
def __call__ (self, env, config)
 
def findSources (self)
 
def findTargets (self)
 
def buildConfig (self, target, source, env)
 

Public Attributes

 results
 
 sources
 
 targets
 
 useTags
 
 inputs
 
 excludes
 
 outputPaths
 
 makeTag
 

Detailed Description

A callable to be used as an SCons Action to run Doxygen.

This should only be used by the env.Doxygen pseudo-builder method.

Definition at line 249 of file builders.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.sconsUtils.builders.DoxygenBuilder.__init__ (   self,
  kw 
)

Definition at line 251 of file builders.py.

251  def __init__(self, **kw):
252  self.__dict__.update(kw)
253  self.results = []
254  self.sources = []
255  self.targets = []
256  self.useTags = list(SCons.Script.File(item).abspath for item in self.useTags)
257  self.inputs = list(SCons.Script.Entry(item).abspath for item in self.inputs)
258  self.excludes = list(SCons.Script.Entry(item).abspath for item in self.excludes)
259  self.outputPaths = list(SCons.Script.Dir(item) for item in self.outputs)
260 
def __init__(self, minimum, dataRange, Q)
daf::base::PropertyList * list
Definition: fits.cc:833

Member Function Documentation

◆ __call__()

def lsst.sconsUtils.builders.DoxygenBuilder.__call__ (   self,
  env,
  config 
)

Definition at line 261 of file builders.py.

261  def __call__(self, env, config):
262  self.findSources()
263  self.findTargets()
264  inConfigNode = SCons.Script.File(config)
265  outConfigName, ext = os.path.splitext(inConfigNode.abspath)
266  outConfigNode = SCons.Script.File(outConfigName)
267  if self.makeTag:
268  tagNode = SCons.Script.File(self.makeTag)
269  self.makeTag = tagNode.abspath
270  self.targets.append(tagNode)
271  config = env.Command(target=outConfigNode, source=inConfigNode if os.path.exists(config) else None,
272  action=self.buildConfig)
273  env.AlwaysBuild(config)
274  doc = env.Command(target=self.targets, source=self.sources,
275  action="doxygen %s" % pipes.quote(outConfigNode.abspath))
276  for path in self.outputPaths:
277  env.Clean(doc, path)
278  env.Depends(doc, config)
279  self.results.extend(config)
280  self.results.extend(doc)
281  return self.results
282 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33

◆ buildConfig()

def lsst.sconsUtils.builders.DoxygenBuilder.buildConfig (   self,
  target,
  source,
  env 
)

Definition at line 322 of file builders.py.

322  def buildConfig(self, target, source, env):
323  outConfigFile = open(target[0].abspath, "w")
324 
325  # Need a routine to quote paths that contain spaces
326  # but can not use pipes.quote because it has to be
327  # a double quote for doxygen.conf
328  # Do not quote a string if it is already quoted
329  # Also have a version that quotes each item in a sequence and generates the
330  # final quoted entry.
331  def _quote_path(path):
332  if " " in path and not path.startswith('"') and not path.endswith('"'):
333  return '"{}"'.format(path)
334  return path
335 
336  def _quote_paths(pathList):
337  return " ".join(_quote_path(p) for p in pathList)
338 
339  docPaths = []
340  incFiles = []
341  for incPath in self.includes:
342  docDir, incFile = os.path.split(incPath)
343  docPaths.append('"%s"' % docDir)
344  incFiles.append('"%s"' % incFile)
345  self.sources.append(SCons.Script.File(incPath))
346  if docPaths:
347  outConfigFile.write('@INCLUDE_PATH = %s\n' % _quote_paths(docPaths))
348  for incFile in incFiles:
349  outConfigFile.write('@INCLUDE = %s\n' % _quote_path(incFile))
350 
351  for tagPath in self.useTags:
352  docDir, tagFile = os.path.split(tagPath)
353  htmlDir = os.path.join(docDir, "html")
354  outConfigFile.write('TAGFILES += "%s=%s"\n' % (tagPath, htmlDir))
355  self.sources.append(SCons.Script.Dir(docDir))
356  if self.projectName is not None:
357  outConfigFile.write("PROJECT_NAME = %s\n" % self.projectName)
358  if self.projectNumber is not None:
359  outConfigFile.write("PROJECT_NUMBER = %s\n" % self.projectNumber)
360  outConfigFile.write("INPUT = %s\n" % _quote_paths(self.inputs))
361  outConfigFile.write("EXCLUDE = %s\n" % _quote_paths(self.excludes))
362  outConfigFile.write("FILE_PATTERNS = %s\n" % " ".join(self.patterns))
363  outConfigFile.write("RECURSIVE = YES\n" if self.recursive else "RECURSIVE = NO\n")
364  allOutputs = set(("html", "latex", "man", "rtf", "xml"))
365  for output, path in zip(self.outputs, self.outputPaths):
366  try:
367  allOutputs.remove(output.lower())
368  except Exception:
369  state.log.fail("Unknown Doxygen output format '%s'." % output)
370  state.log.finish()
371  outConfigFile.write("GENERATE_%s = YES\n" % output.upper())
372  outConfigFile.write("%s_OUTPUT = %s\n" % (output.upper(), _quote_path(path.abspath)))
373  for output in allOutputs:
374  outConfigFile.write("GENERATE_%s = NO\n" % output.upper())
375  if self.makeTag is not None:
376  outConfigFile.write("GENERATE_TAGFILE = %s\n" % _quote_path(self.makeTag))
377  #
378  # Append the local overrides (usually doxygen.conf.in)
379  #
380  if len(source) > 0:
381  with open(source[0].abspath, "r") as inConfigFile:
382  outConfigFile.write(inConfigFile.read())
383 
384  outConfigFile.close()
385 
386 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33
daf::base::PropertySet * set
Definition: fits.cc:832
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168

◆ findSources()

def lsst.sconsUtils.builders.DoxygenBuilder.findSources (   self)

Definition at line 283 of file builders.py.

283  def findSources(self):
284  for path in self.inputs:
285  if os.path.isdir(path):
286  for root, dirs, files in os.walk(path):
287  if os.path.abspath(root) in self.excludes:
288  dirs[:] = []
289  continue
290  if not self.recursive:
291  dirs[:] = []
292  else:
293  toKeep = []
294  for relDir in dirs:
295  if relDir.startswith("."):
296  continue
297  absDir = os.path.abspath(os.path.join(root, relDir))
298  if absDir not in self.excludes:
299  toKeep.append(relDir)
300  dirs[:] = toKeep
301  if self.excludeSwig:
302  for relFile in files:
303  base, ext = os.path.splitext(relFile)
304  if ext == ".i":
305  self.excludes.append(os.path.join(root, base + ".py"))
306  self.excludes.append(os.path.join(root, base + "_wrap.cc"))
307  for relFile in files:
308  absFile = os.path.abspath(os.path.join(root, relFile))
309  if absFile in self.excludes:
310  continue
311  for pattern in self.patterns:
312  if fnmatch.fnmatch(relFile, pattern):
313  self.sources.append(SCons.Script.File(absFile))
314  break
315  elif os.path.isfile(path):
316  self.sources.append(SCons.Script.File(path))
317 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33

◆ findTargets()

def lsst.sconsUtils.builders.DoxygenBuilder.findTargets (   self)

Definition at line 318 of file builders.py.

318  def findTargets(self):
319  for item in self.outputs:
320  self.targets.append(SCons.Script.Dir(item))
321 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33

Member Data Documentation

◆ excludes

lsst.sconsUtils.builders.DoxygenBuilder.excludes

Definition at line 258 of file builders.py.

◆ inputs

lsst.sconsUtils.builders.DoxygenBuilder.inputs

Definition at line 257 of file builders.py.

◆ makeTag

lsst.sconsUtils.builders.DoxygenBuilder.makeTag

Definition at line 269 of file builders.py.

◆ outputPaths

lsst.sconsUtils.builders.DoxygenBuilder.outputPaths

Definition at line 259 of file builders.py.

◆ results

lsst.sconsUtils.builders.DoxygenBuilder.results

Definition at line 253 of file builders.py.

◆ sources

lsst.sconsUtils.builders.DoxygenBuilder.sources

Definition at line 254 of file builders.py.

◆ targets

lsst.sconsUtils.builders.DoxygenBuilder.targets

Definition at line 255 of file builders.py.

◆ useTags

lsst.sconsUtils.builders.DoxygenBuilder.useTags

Definition at line 256 of file builders.py.


The documentation for this class was generated from the following file: