pydevDAG._decorations._node_decorators module

pydevDAG._decorations._node_decorators

Tools to decorate networkx graphs in situ, i.e., as constructed rather than as read from a textual file.

class pydevDAG._decorations._node_decorators.DevlinkValues(args)

Bases: pydevDAG._decorations._node_decorators.PyudevDecorator

Add the informational part of device links to the graph.

decorate(device, attrdict)
class pydevDAG._decorations._node_decorators.Domain

Bases: object

A particular domain for decoration.

A domain is just a particular way of going about gathering the information to use to decorate.

All decoration objects in a particular domain require the same setup and will share the same interface.

decorate(node, attrdict)

Updates attributes on a node.

Parameters:
  • node (str) – the node
  • attrdict (dict) – dict of node attributes
classmethod name()

The name of the domain.

class pydevDAG._decorations._node_decorators.NodeDecorator(config)

Bases: object

A node decorator for a particular configuration.

decorate(node, attrdict)

Decorates attrdict with additional attributes.

Parameters:
  • context (Context) – a pyudev context
  • node (str) – the node
  • attrdict (dict) – dict of node attributes
get_decorator(config)

Get a decorator for one particular nodetype.

Parameters:config (dict (JSON)) – the configuration for a particular node type
Returns:a sequence of objects for decorating
Return type:list of Domain
class pydevDAG._decorations._node_decorators.Pyudev(objects)

Bases: pydevDAG._decorations._node_decorators.Domain

Construct functions for decorating using pyudev.

decorate(node, attrdict)
class pydevDAG._decorations._node_decorators.PyudevDecorator

Bases: object

Defines interface of objects that use pyudev to do their decorating.

DOMAIN

alias of Pyudev

decoratable(attrdict)

Whether attrdict represents a decoratable node.

Parameters:attrdict (dict) – dict of node attributes
Returns:True if the node can be decorated by this class, else False
Return type:bool
decorate(device, attrdict)

Decorate the attrdict belonging to device.

Parameters:
  • device (Device) – libudev device
  • attrdict (dict) – currently stored dict for attributes
class pydevDAG._decorations._node_decorators.SysfsAttributes(args)

Bases: pydevDAG._decorations._node_decorators.PyudevDecorator

Find sysfs attributes for the device nodes of a network graph.

Set a value for every name requested.

decorate(device, attrdict)
class pydevDAG._decorations._node_decorators.Sysname(args)

Bases: pydevDAG._decorations._node_decorators.PyudevDecorator

Get the sysname for the object.

decorate(device, attrdict)
class pydevDAG._decorations._node_decorators.UdevProperties(args)

Bases: pydevDAG._decorations._node_decorators.PyudevDecorator

Find udev properties for the device nodes of a network graph.

Set a value for every name requested.

decorate(device, attrdict)

Table Of Contents

Previous topic

pydevDAG._decorations._decorations module

Next topic

pydevDAG._readwrite package

This Page