Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self._memo['rentry'] = result
return result
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
return []
# Dict that provides a simple backward compatibility
# layer for the Node attributes 'abspath', 'labspath',
# 'path', 'tpath' and 'path_elements'.
# @see Base.__getattr__ above
node_bwcomp = {'abspath' : Base.get_abspath,
'labspath' : Base.get_labspath,
'path' : Base.get_internal_path,
'tpath' : Base.get_tpath,
'path_elements' : Base.get_path_elements,
'suffix' : Base.get_suffix}
class Entry(Base):
"""This is the class for generic Node.FS entries--that is, things
that could be a File or a Dir, but we're just not sure yet.
Consequently, the methods in this class really exist just to
transform their associated object into the right class when the
time comes, and then call the same-named method in the transformed
class."""
__slots__ = ['scanner_paths',
'cachedir_csig',
'cachesig',
'repositories',
'srcdir',
'entries',
'searched',
result = dir.Entry(self.name)
break
self._memo['rentry'] = result
return result
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
return []
# Dict that provides a simple backward compatibility
# layer for the Node attributes 'abspath', 'labspath',
# 'path', 'tpath' and 'path_elements'.
# @see Base.__getattr__ above
node_bwcomp = {'abspath' : Base.get_abspath,
'labspath' : Base.get_labspath,
'path' : Base.get_internal_path,
'tpath' : Base.get_tpath,
'path_elements' : Base.get_path_elements,
'suffix' : Base.get_suffix}
class Entry(Base):
"""This is the class for generic Node.FS entries--that is, things
that could be a File or a Dir, but we're just not sure yet.
Consequently, the methods in this class really exist just to
transform their associated object into the right class when the
time comes, and then call the same-named method in the transformed
class."""
__slots__ = ['scanner_paths',
'cachedir_csig',
'cachesig',
'repositories',
'srcdir',
def must_be_same(self, klass):
if klass is Dir:
return
Base.must_be_same(self, klass)
except KeyError:
if dir.entry_exists_on_disk(self.name):
result = dir.Entry(self.name)
break
self._memo['rentry'] = result
return result
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
return []
# Dict that provides a simple backward compatibility
# layer for the Node attributes 'abspath', 'labspath',
# 'path', 'tpath' and 'path_elements'.
# @see Base.__getattr__ above
node_bwcomp = {'abspath' : Base.get_abspath,
'labspath' : Base.get_labspath,
'path' : Base.get_internal_path,
'tpath' : Base.get_tpath,
'path_elements' : Base.get_path_elements,
'suffix' : Base.get_suffix}
class Entry(Base):
"""This is the class for generic Node.FS entries--that is, things
that could be a File or a Dir, but we're just not sure yet.
Consequently, the methods in this class really exist just to
transform their associated object into the right class when the
time comes, and then call the same-named method in the transformed
class."""
__slots__ = ['scanner_paths',
'cachedir_csig',
'cachesig',
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
return []
# Dict that provides a simple backward compatibility
# layer for the Node attributes 'abspath', 'labspath',
# 'path', 'tpath' and 'path_elements'.
# @see Base.__getattr__ above
node_bwcomp = {'abspath' : Base.get_abspath,
'labspath' : Base.get_labspath,
'path' : Base.get_internal_path,
'tpath' : Base.get_tpath,
'path_elements' : Base.get_path_elements,
'suffix' : Base.get_suffix}
class Entry(Base):
"""This is the class for generic Node.FS entries--that is, things
that could be a File or a Dir, but we're just not sure yet.
Consequently, the methods in this class really exist just to
transform their associated object into the right class when the
time comes, and then call the same-named method in the transformed
class."""
__slots__ = ['scanner_paths',
'cachedir_csig',
'cachesig',
'repositories',
'srcdir',
'entries',
'searched',
'_sconsign',
'variant_dirs',
the root directory's lookup_abs() method for the heavy lifting.
If the path name begins with '#', it is unconditionally
interpreted relative to the top-level directory of this FS. '#'
is treated as a synonym for the top-level SConstruct directory,
much like '~' is treated as a synonym for the user's home
directory in a UNIX shell. So both '#foo' and '#/foo' refer
to the 'foo' subdirectory underneath the top-level SConstruct
directory.
If the path name is relative, then the path is looked up relative
to the specified directory, or the current directory (self._cwd,
typically the SConscript directory) if the specified directory
is None.
"""
if isinstance(p, Base):
# It's already a Node.FS object. Make sure it's the right
# class and return.
p.must_be_same(fsclass)
return p
# str(p) in case it's something like a proxy object
p = str(p)
if not os_sep_is_slash:
p = p.replace(OS_SEP, '/')
if p[0:1] == '#':
# There was an initial '#', so we strip it and override
# whatever directory they may have specified with the
# top-level SConstruct directory.
p = p[1:]
directory = self.Top
def srcnode(self):
"""Dir has a special need for srcnode()...if we
have a srcdir attribute set, then that *is* our srcnode."""
if self.srcdir:
return self.srcdir
return Base.srcnode(self)
result = dir.Entry(self.name)
break
self._memo['rentry'] = result
return result
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
return []
# Dict that provides a simple backward compatibility
# layer for the Node attributes 'abspath', 'labspath',
# 'path', 'tpath' and 'path_elements'.
# @see Base.__getattr__ above
node_bwcomp = {'abspath' : Base.get_abspath,
'labspath' : Base.get_labspath,
'path' : Base.get_internal_path,
'tpath' : Base.get_tpath,
'path_elements' : Base.get_path_elements,
'suffix' : Base.get_suffix}
class Entry(Base):
"""This is the class for generic Node.FS entries--that is, things
that could be a File or a Dir, but we're just not sure yet.
Consequently, the methods in this class really exist just to
transform their associated object into the right class when the
time comes, and then call the same-named method in the transformed
class."""
__slots__ = ['scanner_paths',
'cachedir_csig',
'cachesig',
'repositories',
'srcdir',
s = ni.str_to_node(s)
nodes.append(s)
setattr(self, nattr, nodes)
def format(self, names=0):
result = []
bkids = self.bsources + self.bdepends + self.bimplicit
bkidsigs = self.bsourcesigs + self.bdependsigs + self.bimplicitsigs
for bkid, bkidsig in zip(bkids, bkidsigs):
result.append(str(bkid) + ': ' +
' '.join(bkidsig.format(names=names)))
if not hasattr(self,'bact'):
self.bact = "none"
result.append('%s [%s]' % (self.bactsig, self.bact))
return '\n'.join(result)
class File(Base):
"""A class for files in a file system.
"""
__slots__ = ['scanner_paths',
'cachedir_csig',
'cachesig',
'repositories',
'srcdir',
'entries',
'searched',
'_sconsign',
'variant_dirs',
'root',
'dirname',
'on_disk_entries',
'sccs_dir',
if dir.entry_exists_on_disk(self.name):
result = dir.Entry(self.name)
break
self._memo['rentry'] = result
return result
def _glob1(self, pattern, ondisk=True, source=False, strings=False):
return []
# Dict that provides a simple backward compatibility
# layer for the Node attributes 'abspath', 'labspath',
# 'path', 'tpath' and 'path_elements'.
# @see Base.__getattr__ above
node_bwcomp = {'abspath' : Base.get_abspath,
'labspath' : Base.get_labspath,
'path' : Base.get_internal_path,
'tpath' : Base.get_tpath,
'path_elements' : Base.get_path_elements,
'suffix' : Base.get_suffix}
class Entry(Base):
"""This is the class for generic Node.FS entries--that is, things
that could be a File or a Dir, but we're just not sure yet.
Consequently, the methods in this class really exist just to
transform their associated object into the right class when the
time comes, and then call the same-named method in the transformed
class."""
__slots__ = ['scanner_paths',
'cachedir_csig',
'cachesig',
'repositories',