pyjen.utils.xml_plugin module

Primitives common to all PyJen plugins that extend Jenkins config.xml

class pyjen.utils.xml_plugin.XMLPlugin(node)[source]

Bases: object

Base class for all PyJen plugins that extend Jenkins config.xml

Plugins derived from this base class are always instantiated with a sub-node within a primitive’s config.xml. The particulars of these sub-nodes including names, attributes, and children nodes, is unique to each Jenkins plugin. However, all such PyJen plugins must extend this base class to provide those plugin specific behaviors.

All derived classes are expected to implement the following public interfaces:

@classmethod def create(cls, …):

a factory method that takes 0 or more parameters (anything necessary to construct an instance of the derived class) and returns an instance of the class pre-constructed with relevant XML content. Used when adding an instance of the plugin to an existing Jenkins object.

@staticmethod def get_jenkins_plugin_name():

Helper method that returns a character string representation of the Jenkins plugin name the class is associated with. This is typically the Java class name of the Jenkins plugin the PyJen plugin is meant to work with.

Parameters

node (xml.etree.ElementTree.Element) – XML node with the decoded XML data associated with a plugin

property node

the encoded XML data associated with this plugin

Type

xml.etree.ElementTree.Element

property parent

Object that manages an outer XML code block containing the nodes managed by this object.

Type

XMLPlugin

update()[source]

Updates parent XML tree when one exists