pkgcore.fs.contents module¶
contents set- container of fs objects
- class pkgcore.fs.contents.OrderedContentsSet(initial=None, mutable=False, add_missing_directories=False)[source]¶
Bases:
contentsSet
- class pkgcore.fs.contents.contentsSet(initial=None, mutable=True)[source]¶
Bases:
object
set of
pkgcore.fs.fs.fsBase
objects- add(obj)[source]¶
add a new fs obj to the set
- Parameters:
obj – must be a derivative of
pkgcore.fs.fs.fsBase
- add_missing_directories(mode=509, uid=0, gid=0, mtime=None)[source]¶
Ensure that a directory node exists for each path; add if missing.
- child_nodes(start_point)[source]¶
Return a clone of this instance, w/ just the child nodes returned from iter_child_nodes.
- Parameters:
start_point – fs filepath all yielded nodes must be within.
- devs(invert=False)[source]¶
Returns a list of just
pkgcore.fs.fs.fsDev
instances.- Parameters:
invert – if True, yield everything that isn’t a fsDev instance, else yields just fsDev.
- dirs(invert=False)[source]¶
Returns a list of just
pkgcore.fs.fs.fsDir
instances.- Parameters:
invert – if True, yield everything that isn’t a fsDir instance, else yields just fsDir.
- fifos(invert=False)[source]¶
Returns a list of just
pkgcore.fs.fs.fsFifo
instances.- Parameters:
invert – if True, yield everything that isn’t a fsFifo instance, else yields just fsFifo.
- files(invert=False)[source]¶
Returns a list of just
pkgcore.fs.fs.fsFile
instances.- Parameters:
invert – if True, yield everything that isn’t a fsFile instance, else yields just fsFile.
- iter_child_nodes(start_point)[source]¶
Yield a stream of nodes that are fs entries contained within the passed in start point.
- Parameters:
start_point – fs filepath all yielded nodes must be within.
- iterdevs(invert=False)[source]¶
A generator yielding just
pkgcore.fs.fs.fsDev
instances.- Parameters:
invert – if True, yield everything that isn’t a fsDev instance, else yields just fsDev instances.
- iterdirs(invert=False)[source]¶
A generator yielding just
pkgcore.fs.fs.fsDir
instances.- Parameters:
invert – if True, yield everything that isn’t a fsDir instance, else yields just fsDir instances.
- iterfifos(invert=False)[source]¶
A generator yielding just
pkgcore.fs.fs.fsFifo
instances.- Parameters:
invert – if True, yield everything that isn’t a fsFifo instance, else yields just fsFifo instances.
- iterfiles(invert=False)[source]¶
A generator yielding just
pkgcore.fs.fs.fsFile
instances.- Parameters:
invert – if True, yield everything that isn’t a fsFile instance, else yields just fsFile instances.
- iterlinks(*a, **kw)¶
Method alias to invoke
itersymlinks()
.
- itersymlinks(invert=False)[source]¶
A generator yielding just
pkgcore.fs.fs.fsSymlink
instances.- Parameters:
invert – if True, yield everything that isn’t a fsSymlink instance, else yields just fsSymlink instances.
- links(*a, **kw)¶
Method alias to invoke
symlinks()
.
- map_directory_structure(other, add_conflicting_sym=True)[source]¶
Resolve the directory structure between this instance, and another contentset, collapsing syms of self into directories of other.
- symlinks(invert=False)[source]¶
Returns a list of just
pkgcore.fs.fs.fsSymlink
instances.- Parameters:
invert – if True, yield everything that isn’t a fsSymlink instance, else yields just fsSymlink.
- pkgcore.fs.contents.offset_rewriter(new_offset, iterable)¶