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

pkgcore.fs.contents.change_offset_rewriter(orig_offset, new_offset, iterable)[source]
pkgcore.fs.contents.check_instance(obj)[source]
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.

change_offset(old_offset, new_offset)[source]
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.

clear()[source]

clear the set :raise ttributeError: if the instance is frozen

clone(empty=False)[source]
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.

difference(other)[source]
difference_update(other)[source]
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.

discard(obj)[source]
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.

inode_map()[source]
insert_offset(offset)[source]
intersection(other)[source]
intersection_update(other)[source]
isdisjoint(other)[source]
issubset(other)[source]
issuperset(other)[source]
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.

Method alias to invoke itersymlinks().

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.

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.

remove(obj)[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.

symmetric_difference(other)[source]
symmetric_difference_update(other)[source]
union(other)[source]
update(iterable)[source]
pkgcore.fs.contents.offset_rewriter(new_offset, iterable)