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.installation.DirectoryInstaller Class Reference

SCons Action callable to recursively install a directory. More...

Public Member Functions

def __init__ (self, ignoreRegex, recursive)
 
def __call__ (self, target, source, env)
 

Public Attributes

 ignoreRegex
 
 recursive
 

Detailed Description

SCons Action callable to recursively install a directory.

This is separate from the InstallDir function to allow the directory-walking to happen when installation is actually invoked, rather than when the SConscripts are parsed. This still does not ensure that all necessary files are built as prerequisites to installing, but if one explicitly marks the install targets as dependent on the build targets, that should be enough.

Definition at line 231 of file installation.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.sconsUtils.installation.DirectoryInstaller.__init__ (   self,
  ignoreRegex,
  recursive 
)

Definition at line 233 of file installation.py.

233  def __init__(self, ignoreRegex, recursive):
234  self.ignoreRegex = re.compile(ignoreRegex)
235  self.recursive = recursive
236 
def __init__(self, minimum, dataRange, Q)

Member Function Documentation

◆ __call__()

def lsst.sconsUtils.installation.DirectoryInstaller.__call__ (   self,
  target,
  source,
  env 
)

Definition at line 237 of file installation.py.

237  def __call__(self, target, source, env):
238  prefix = os.path.abspath(os.path.join(target[0].abspath, ".."))
239  destpath = os.path.join(target[0].abspath)
240  if not os.path.isdir(destpath):
241  state.log.info("Creating directory %s" % destpath)
242  os.makedirs(destpath)
243  for root, dirnames, filenames in os.walk(source[0].path):
244  if not self.recursive:
245  dirnames[:] = []
246  else:
247  dirnames[:] = [d for d in dirnames if d != ".svn"] # ignore .svn tree
248  for dirname in dirnames:
249  destpath = os.path.join(prefix, root, dirname)
250  if not os.path.isdir(destpath):
251  state.log.info("Creating directory %s" % destpath)
252  os.makedirs(destpath)
253  for filename in filenames:
254  if self.ignoreRegex.search(filename):
255  continue
256  destpath = os.path.join(prefix, root)
257  srcpath = os.path.join(root, filename)
258  state.log.info("Copying %s to %s" % (srcpath, destpath))
259  shutil.copy(srcpath, destpath)
260  return 0
261 
262 

Member Data Documentation

◆ ignoreRegex

lsst.sconsUtils.installation.DirectoryInstaller.ignoreRegex

Definition at line 234 of file installation.py.

◆ recursive

lsst.sconsUtils.installation.DirectoryInstaller.recursive

Definition at line 235 of file installation.py.


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