Table Of Contents

Previous topic

node.ext.uml.utils

Next topic

node.ext.template

This Page

node.ext.directory

API

class node.ext.directory.Directory(*args, **kw)

Bases: object

Object mapping a file system directory.

Simple mapping interface

Mapping methods for changing data

Simplest readable mapping object

Basic mapping interface

Mapping objects whose items can be enumerated.

Provides defaults for IFullMapping

NotImplementedError is raised by defaults for:
  • __delitem__
  • __getitem__
  • __iter__
  • __setitem__
acquire(interface)
allow_non_node_childs = False
backup = True
clear()

works only if together with EnumerableMapping

copy(*args, **kw)
detach(*args, **kw)
filtereditems(interface)

Uses itervalues.

filtereditervalues(interface)

Uses itervalues.

filteredvalues(interface)

Uses values.

get(key, default=None)

Uses __getitem__.

has_key(key)

uses __iter__

index
items()

Uses __iter__ and __getitem__.

return items in key order

iteritems()

Uses __iter__ and __getitem__.

iter items in key order

iterkeys()

Uses __iter__.

itervalues()

Uses __iter__ and __getitem__.

iter values in key order

keys()

Uses __iter__.

name
node(uuid)
noderepr

noderepr is used in printtree.

Thus, we can overwrite it in subclass and return any debug information we need while __repr__ is an enhanced standard object representation, also used as __str__ on nodes.

XXX: do we really need the difference or can we just override __repr__ in subclasses and use __repr__ in printtree?

overwrite_recursiv_on_copy = True
parent
path
pop(key, default=<class 'node.utils.Unset'>)

works only if together with ReadMapping

popitem()

works only if together with IterableMapping

printtree(indent=0)

Uses values.

root
set_uuid_for(node, override=False, recursiv=False)
setdefault(*args, **kw)

works only if together with ReadMapping

storage
update(*args, **kw)
uuid
values()

Uses __iter__ and __getitem__.

return values in key order

interface node.ext.directory.interfaces.IDirectory

Extends: node.interfaces.ICallable

Directory target interface.

__setitem__(name, value)

Set item inside this directory.

@param name: name of the item (either a file name or a directory name)

@param value: either IFile implementation or None. If
value is None, create IDirectory child.

@raise ValueError: If child for name already set.

backup

Create backup files of handled files. Defaults to False

interface node.ext.directory.interfaces.IFile

Extends: node.interfaces.ICallable, node.interfaces.ILeaf

Marker interface for a file.