Changes between Version 1 and Version 2 of WritingYumPlugins

Show
Ignore:
Author:
skvidal (IP: 24.211.246.61)
Timestamp:
10/23/08 07:02:16 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WritingYumPlugins

    v1 v2  
    44Plugins were created partially as a place to put functionality that was seen as either less common or undesirable for the main yum package.  Functionality in plugins will generally not be moved or included in the core yum package. 
    55 
    6 This document explains how to create plugins for Yum. See the {{{yum(8)}}} and {{{yum.conf(5)}}} man pages for information on how to install and configure pre-existing plugins. 
     6This document explains how to create plugins for Yum. See the {{{ yum(8) }}} and {{{ yum.conf(5) }}} man pages for information on how to install and configure pre-existing plugins. 
    77 
    88 
    99== A Basic Plugin == 
    1010The following example shows a minimal Yum plugin:: 
    11 {{{#!python numbering=off 
     11{{{ 
     12#!python numbering=off 
    1213from yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE 
    1314 
    2728Plugins integrate with Yum by registering a 'hook' function that corresponds to a given 'slot'. A slot is simply a point in Yum's execution. All plugin hook functions for a given slot are called as Yum reaches that slot. 
    2829 
    29 Registration of hook functions is automatic. The plugin module is inspected for functions named {{{<slotname>_hook}}}. If a function matching a valid slot name is found then that function is automatically registered as a hook function. 
     30Registration of hook functions is automatic. The plugin module is inspected for functions named {{{ <slotname>_hook }}}. If a function matching a valid slot name is found then that function is automatically registered as a hook function. 
    3031 
    3132Hook functions all take one argument, for a {{{conduit}}} instance. Conduits are explained below. 
    174175def init_hook(conduit): 
    175176    conf = conduit.getConf() 
     177 
    176178 
    177179    # Display the options from the [main] section