
N_c           @   sS  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Td  d l	 Z	 d  d l	 m
 Z
 m Z d  d l Z d  d l m Z d  d l m Z d  d l Z d  d l m Z d  d l m Z d  d l m Z d	 Z d
 e f d     YZ d Z d Z e d  Z e e f Z i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d" 6d! d# 6d! d$ 6d! d% 6d! d& 6d' d( 6d' d) 6d* d+ 6d* d, 6d- d. 6d/ d0 6Z e  e j!    Z" d1 e# f d2     YZ$ d3 dF d4     YZ% d5 dG d6     YZ& d dH d7     YZ' d e' f d8     YZ( d e( f d9     YZ) d e' f d:     YZ* d e* f d;     YZ+ d e* f d<     YZ, d e, f d=     YZ- d e- f d>     YZ. d! e- f d?     YZ/ d' e/ f d@     YZ0 d- e/ f dA     YZ1 d* e/ f dB     YZ2 d/ e/ f dC     YZ3 dD   Z4 dE   Z5 d S(I   iN(   t   *(   t   ParsingErrort   ConfigParser(   t   ConfigPreProcessor(   t   fill(   t   proxy(   t   _(   t
   utf8_widths   2.7t   DeprecatedIntc           B   s   e  Z d  Z RS(   sX   A simple int subclass that is used to check when a deprecated
    constant is used.
    (   t   __name__t
   __module__t   __doc__(    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   D   s   i    i   t   ConfigPluginConduitt   configt   PostConfigPluginConduitt
   postconfigt   InitPluginConduitt   initt   ArgsPluginConduitt   argst   DownloadPluginConduitt   predownloadt   postdownloadt   PreRepoSetupPluginConduitt   prelistenabledrepost   prereposetupt   PostRepoSetupPluginConduitt   postreposetupt   PluginConduitt   closet   cleant   MainPluginConduitt   pretranst	   posttranst   preverifytranst   postverifytranst   excludet   DepsolvePluginConduitt
   preresolvet   postresolvet   HistoryPluginConduitt   historybegint
   historyendt   CompareProvidersPluginConduitt   compare_providerst   VerifyPluginConduitt   verify_packaget   PluginYumExitc           B   s&   e  Z d  Z d d d  Z d   Z RS(   sG   Exception that can be raised by plugins to signal that yum should stop.t    c         C   s   | |  _  | |  _ d  S(   N(   t   valuet   translation_domain(   t   selfR1   R2   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   __init__o   s    	c         C   s*   |  j  r t j |  j  |  j  S|  j Sd  S(   N(   R2   t   gettextt   dgettextR1   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   __str__r   s    	(   R	   R
   R   R4   R7   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR/   l   s   t
   YumPluginsc           B   sb   e  Z d  Z d d d d d d  Z d   Z d   Z e d    Z d   Z	 d   Z
 d   Z RS(	   s   Manager class for Yum plugins.c   	      C   s  | s d g } n  | |  _  | |  _ t |  |  _ | |  _ d |  _ t j d  |  _	 | |  _
 | |  _ | d k r~ t } n  t | t t f  s | f } n  t t  g  | D] } t |  ^ q k r |  j	 j t j d  n  |  j |  i  |  _ t j |  j d  |  j d  d S(   sv  Initialise the instance.

        @param base: The
        @param searchpath: A list of paths to look for plugin modules.
        @param optparser: The OptionParser instance for this run (optional).
            Use to allow plugins to extend command line options.
        @param types: A sequence specifying the types of plugins to load.
            This should be sequnce containing one or more of the TYPE_...
            constants. If None (the default), all plugins will be loaded.
        @param pluginconfpath: A list of paths to look for plugin configuration
            files. Defaults to "/etc/yum/pluginconf.d".
        s   /etc/yum/pluginconf.ds   yum.verbose.YumPluginsse   Deprecated constant TYPE_INTERFACE during plugin initialization.
Please use TYPE_INTERACTIVE instead.R   R   N(   NN(   t
   searchpatht   pluginconfpatht   weakreft   baset	   optparsert   Nonet   cmdlinet   loggingt	   getLoggert   verbose_loggert   disabledPluginst   enabledPluginst	   ALL_TYPESt
   isinstancet   listt   tuplet   idt   TYPE_INTERFACEt   logt   logginglevelst   INFO_2t   _importpluginst   cmdlinest   atexitt   registert   run(	   R3   R<   R9   R=   t   typesR:   t   disabledt   enabledt   t(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4   {   s*    							+
	c         K   s   t  j | d  } | d k r1 t d |   n  t |  } xf |  j | D]W \ } } |  j j t j	 d | |  |  j
 | \ } } | | |  |  j | |   qK Wd S(   s   Run all plugin functions for the given slot.

        :param slotname: a string representing the name of the slot to
           run the plugins for
        :param kwargs: keyword arguments that will be simply passed on
           to the plugins
        s   unknown slot name "%s"s$   Running "%s" handler for "%s" pluginN(   t   SLOT_TO_CONDUITt   getR>   t
   ValueErrort   evalt   _pluginfuncsRB   RK   RL   t   DEBUG_4t   _pluginsR<   (   R3   t   slotnamet   kwargst
   conduitclst   modnamet   funcR   t   conf(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyRR      s    	
c   
      C   s  i  |  _  i  |  _ x t D] } g  |  j | <q Wt   |  _ t   |  _ x] |  j D]R } t j j	 |  sp qR n  x1 t
 t j d |   D] } |  j | |  q WqR W|  j  r^|  j j t j  r^t d  } d j t
 |  j    } d t |  d d } d } t |  j d  r-|  j j j } n  |  j j t j t | d	 | d
 | d |  n  |  j rxF |  j D]8 }	 |	 |  j k rq|  j j t j t d  |	  qqqqWn  |  ` |  j rxF |  j D]8 }	 |	 |  j k r|  j j t j t d  |	  qqWn  |  ` d S(   s/   Load plugins matching the given types.
        s   %s/*.pys   Loaded plugins: s   , t    i   s   : iP   t   termt   widtht   initial_indentt   subsequent_indents   No plugin match for: %sN(   R]   R[   t   SLOTSt   sett   _used_disable_plugint   _used_enable_pluginR9   t   ost   patht   isdirt   sortedt   globt   _loadpluginRB   t   isEnabledForRL   t   DEBUG_3R   t   joinR   t   hasattrR<   Re   t   columnsRK   RM   R   RC   RD   (
   R3   RS   t   slott   dirt
   modulefilet   keyt   valt   nxtRf   t   wc(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyRN      sD    		 			c         C   sH   | d k r t Sx1 | D]) } t j |  |  r | j |  t Sq Wt S(   s;    Check if this plugin has been temporary enabled/disabled. N(   R>   t   Falset   fnmatcht   addt   True(   Ra   t   pluginst   usedR~   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   _plugin_cmdline_match   s    c      	   C   s  t  j j |  \ } } | j d  d } |  j | |  j |  j  rf |  j | |  j |  j  rf d S|  j |  } | s t	 j
 | d d t	 j t   r |  j | |  j |  j  r |  j j t d  |  d SyL t j | | g  \ } } } z t j | | | |  }	 Wd | j   XWn= |  j j t j  rD  n  |  j j t d  |  d SXt |	 d  s|  j j t d	  |  d St t |	 j  s|  j j t d
  | |	 j t f  d St |	 d t  }
 t |
 t t  f  s|
 f }
 n  t! |
  d k  rd SxR |
 D]J } t" |  t" t#  k rV|  j j$ t j% d |  n  | | k rd SqW|  j j$ t j& t d  |  | |  j' k r|	 | f |  j' | <n t( j) t d  |   xM t* D]E } | d } t |	 |  r|  j+ | j, | t |	 |  f  qqWd S(   sY   Attempt to import a plugin module and register the hook methods it
        uses.
        s   .pyi    Nt   mainRU   s*   Not loading "%s" plugin, as it is disableds   Plugin "%s" can't be importedt   requires_api_versions0   Plugin "%s" doesn't specify required API versions1   Plugin "%s" requires API %s. Supported API is %s.t   plugin_typei   sY   Plugin "%s" uses deprecated constant TYPE_INTERFACE.
Please use TYPE_INTERACTIVE instead.s   Loading "%s" pluginsF   Two or more plugins with the name "%s" exist in the plugin search patht   _hook(-   Rm   Rn   t   splitR   RC   Rk   RD   Rl   t   _getpluginconfR   t	   getOptiont
   BoolOptionR   RB   t   debugR   t   impt   find_modulet   load_moduleR   Rs   RL   R\   t   errorRv   t   apiverokt   API_VERSIONR   t   getattrRE   RF   RG   RH   t   lenRI   RJ   RK   RM   Rt   R]   t   Errorst   ConfigErrorRi   R[   t   append(   R3   Rz   RS   Ry   Ra   Rc   t   fpt   pathnamet   descriptiont   modulet   plugintypest
   plugintypeRx   t   funcname(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyRr      sz    				


c         C   s   x |  j  D]X } t j j | | d  } t j | t j  rB Pn  |  j j t j	 t
 d  |  q
 W|  j j t j	 t
 d  |  d St   } t |  } y | j |  Wn2 t k
 r } t j d | t |  f   n X| S(   s   Parse the plugin specific configuration file and return a
        IncludingConfigParser instance representing it. Returns None if there
        was an error reading or parsing the configuration file.
        s   .confs   Configuration file %s not founds/   Unable to find configuration file for plugin %ss   Couldn't parse %s: %sN(   R:   Rm   Rn   Ru   t   accesst   R_OKRB   RK   RL   RM   R   R>   R   R   t   readfpR   R   R   t   str(   R3   Ra   Ry   t   conffilenamet   parsert
   confpp_objt   e(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   R  s     $	c         C   s   | | f |  _  d S(   s   Set the parsed command line options so that plugins can
        access them.

        :param opts: a dictionary containing the values of the command
           line options
        :param commands: a list of command line arguments passed to yum
        N(   R?   (   R3   t   optst   commands(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt
   setCmdLinek  s    N(   R	   R
   R   R>   R4   RR   RN   t   staticmethodR   Rr   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR8   x   s   ,		.	X	t   DummyYumPluginsc           B   s    e  Z d  Z d   Z d   Z RS(   s   This class provides basic emulation of the :class:`YumPlugins`
    class. It exists so that calls to plugins.run() don't fail if
    plugins aren't in use.
    c         O   s   d S(   s&   Do nothing.  All arguments are unused.N(    (   R3   R   R_   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyRR   {  s    c         O   s   d S(   s&   Do nothing.  All arguments are unused.N(    (   R3   R   R_   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s    (   R	   R
   R   RR   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   v  s   	c           B   s   e  Z d  Z d   Z d   Z d   Z d d  Z d   Z d   Z	 d d  Z
 d d  Z d d	  Z d d
  Z d d  Z d   Z RS(   sL   A conduit class to transfer information between yum and the
    plugin.
    c         C   sC   | |  _  | |  _ | |  _ t j d  |  _ t j d  |  _ d  S(   Ns
   yum.plugins   yum.verbose.plugin(   t   _parentt   _baset   _confR@   RA   t   loggerRB   (   R3   t   parentR<   Rc   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4     s
    			c         C   s&   t  j |  } |  j j | |  d S(   s   Send an info message to the logger.

        :param level: the level of the message to send
        :param msg: the message to send
        N(   RL   t   logLevelFromDebugLevelRB   RK   (   R3   t   levelt   msgt   converted_level(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   info  s    c         C   s&   t  j |  } |  j j | |  d S(   s   Send an error message to the logger.

        :param level: the level of the message to send
        :param msg: the message to send
        N(   RL   t   logLevelFromErrorLevelR   RK   (   R3   R   R   R   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s    c         C   si   |  j  d |  |  j j j r# t S|  j j j r6 t S| rI i | d 6n i  } t |  j j |    Sd S(   sO  Return a yes or no response, either from assumeyes already
        being set, or from prompting the user.

        :param msg: the message to show to the user
        :param prompt: the question to ask the user (optional); defaults to 'Is this ok [y/N]: '
        :return: 1 if the response is yes, and 0 if the response is no
        i   t   promptN(	   R   R   Rc   t   assumenoR   t	   assumeyesR   t   boolt   userconfirm(   R3   R   R   R_   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   promptYN  s    c         C   s   d d l  } | j S(   s8   Return a string representing the current version of yum.iN(   t   yumt   __version__(   R3   R   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getYumVersion  s    c         C   s
   |  j  j S(   s  Return the :class:`optparse.OptionParser` instance for this
        execution of Yum.  In the "config" and "init" slots a plugin
        may add extra options to this instance to extend the command
        line options that Yum exposes.  In all other slots a plugin
        may only read the :class:`OptionParser` instance.  Any
        modification of the instance at this point will have no
        effect.  See the
        :func:`PreRepoSetupPluginConduit.getCmdLine` method for
        details on how to retrieve the parsed values of command line
        options.

        :return: the global :class:`optparse.OptionParser` instance used by
           Yum. May be None if an OptionParser isn't in use
        (   R   R=   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getOptParser  s    c         C   s"   t  j |  j | | t  j |   S(   s5  Read a string value from the plugin's own configuration file.

        :param section: configuration file section to read
        :param opt: option name to read
        :param default: value to read if the option is missing
        :return: string option value read, or default if option was missing
        (   R   R   R   t   Option(   R3   t   sectiont   optt   default(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt
   confString  s    	c         C   s"   t  j |  j | | t  j |   S(   sf  Read an integer value from the plugin's own configuration file.

        :param section: configuration file section to read
        :param opt: option name to read
        :param default: value to read if the option is missing

        :return: the integer option value read, or *default* if the
            option was missing or could not be parsed
        (   R   R   R   t	   IntOption(   R3   R   R   R   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   confInt  s    
c         C   s"   t  j |  j | | t  j |   S(   s\  Read a float value from the plugin's own configuration file.

        :param section: configuration file section to read
        :param opt: option name to read
        :param default: value to read if the option is missing
        :return: float option value read, or *default* if the option was
            missing or could not be parsed
        (   R   R   R   t   FloatOption(   R3   R   R   R   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt	   confFloat  s    	c         C   s"   t  j |  j | | t  j |   S(   s_  Read a boolean value from the plugin's own configuration file

        :param section: configuration file section to read
        :param opt: option name to read
        :param default: value to read if the option is missing
        :return: boolean option value read, or *default* if the option
            was missing or could not be parsed
        (   R   R   R   R   (   R3   R   R   R   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   confBool  s    	c         C   s"   t  j |  j | | t  j |   S(   s_  Read a boolean value from the plugin's own configuration file

        :param section: configuration file section to read
        :param opt: option name to read
        :param default: value to read if the option is missing
        :return: boolean option value read, or *default* if the option
            was missing or could not be parsed
        (   R   R   R   t
   ListOption(   R3   R   R   R   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   confList  s    	c         C   s   |  j  j j |  d S(   si   Register the name of a package to use.

        :param name: the name of the package to register
        N(   R   t   run_with_package_namesR   (   R3   t   name(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   registerPackageName  s    N(   R	   R
   R   R4   R   R   R>   R   R   R   R   R   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s   							c           B   s    e  Z d  Z d   Z d   Z RS(   s%   A conduit for use in the config slot.c         C   s   t  j d t  i t j t 6t j t 6t j t	 6t j
 t 6} | t k rj t t j | | | |   nz | t k r t t j | | | |   nN | t k r | | |  } t t j | |  t t j | t j |   n  d S(   s  Deprecated.  Register a yum configuration file option.

        :param name: name of the new option
        :param valuetype: option type (PLUG_OPT_BOOL, PLUG_OPT_STRING, etc.)
        :param where: where the option should be available in the config file
            (PLUG_OPT_WHERE_MAIN, PLUG_OPT_WHERE_REPO, etc)
        :param default: default value for the option if it is not set by the user
        su   registerOpt() will go away in a future version of Yum.
Please manipulate config.YumConf and config.RepoConf directly.N(   t   warningst   warnt   DeprecationWarningR   R   t   PLUG_OPT_STRINGR   t   PLUG_OPT_INTR   t   PLUG_OPT_BOOLR   t   PLUG_OPT_FLOATt   PLUG_OPT_WHERE_MAINt   setattrt   YumConft   PLUG_OPT_WHERE_REPOt   RepoConft   PLUG_OPT_WHERE_ALLt   Inherit(   R3   R   t	   valuetypet   whereR   t   type2optt   option(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   registerOpt  s    		


  c         C   s>   t  |  j d  r% |  j j |  n t j t d    d S(   s   Register a new command.

        :param command: the command to register
        :raises: :class:`yum.Errors.ConfigError` if the registration
           of commands is not supported
        t   registerCommands&   registration of commands not supportedN(   Rv   R   R   R   R   R   (   R3   t   command(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   0  s    (   R	   R
   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s   	c           B   s   e  Z d  Z d   Z RS(   s'   Conduit for use in the postconfig slot.c         C   s
   |  j  j S(   s   Return a dictionary containing the values of the
        configuration options.

        :return: a dictionary containing the values of the
           configuration options
        (   R   Rc   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getConf?  s    (   R	   R
   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   <  s   c           B   s    e  Z d  Z d   Z d   Z RS(   s!   Conduit for use in the init slot.c         C   s
   |  j  j S(   s   Return a dictionary containing the values of the
        configuration options.

        :return: a dictionary containing the values of the
           configuration options
        (   R   Rc   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   K  s    c         C   s
   |  j  j S(   s   Return Yum's container object for all configured repositories.

        :return: Yum's :class:`yum.repos.RepoStorage` instance
        (   R   t   repos(   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getReposT  s    (   R	   R
   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   H  s   		c           B   s    e  Z d  Z d   Z d   Z RS(   s0   Conduit for dealing with command line arguments.c         C   s#   t  j |  | | |  | |  _ d  S(   N(   R   R4   t   _args(   R3   R   R<   Rc   R   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4   ^  s    c         C   s   |  j  S(   s   Return a list of the command line arguments passed to yum.

        :return: a list of the command line arguments passed to yum
        (   R   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getArgsb  s    (   R	   R
   R   R4   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   [  s   	c           B   s    e  Z d  Z d   Z d   Z RS(   s)   Conduit for use in the prererosetup slot.c         C   s
   |  j  j S(   s   Return parsed command line options.

        :return: (options, commands) as returned by :class:`OptionParser.parse_args()`
        (   R   R?   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt
   getCmdLinem  s    c         C   s
   |  j  j S(   s   Return a representation of the local RPM database. This
        allows querying of installed packages.

        :return: a :class:`yum.rpmUtils.RpmDBHolder` instance
        (   R   t   rpmdb(   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getRpmDBt  s    (   R	   R
   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   i  s   	c           B   s   e  Z d  Z d   Z RS(   s*   Conduit for use in the postreposetup slot.c         C   s
   |  j  j S(   sV   Return group information.

        :return: :class:`yum.comps.Comps` instance
        (   R   t   comps(   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt	   getGroups  s    (   R	   R
   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR   |  s   c           B   s,   e  Z d  Z d d  Z d   Z d   Z RS(   s&   Conduit for use in the download slots.c         C   s,   t  j |  | | |  | |  _ | |  _ d  S(   N(   R   R4   t   _pkglistt   _errors(   R3   R   R<   Rc   t   pkglistt   errors(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4     s    	c         C   s   |  j  S(   s   Return a list of package objects representing packages to be
        downloaded.

        :return: a list of package object representing packages to be
           downloaded
        (   R   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getDownloadPackages  s    c         C   s   |  j  s i  S|  j  S(   s   Return a dictionary of download errors. 
        
        :return: a dictionary of download errors. This dictionary is
           indexed by package object. Each element is a list of
           strings describing the error
        (   R   (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt	   getErrors  s    	N(   R	   R
   R   R>   R4   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s   		c           B   s5   e  Z d  Z d d  Z d   Z d   Z d   Z RS(   sb   Main conduit class for plugins.  Many other conduit classes
    will inherit from this class.
    c         C   s+   | r | j  } n d } |  j j j |  S(   s   Return a list of packages.

        :param repo: the repo to return a packages from
        :return: a list of package objects
        N(   RI   R>   R   t   pkgSackt   returnPackages(   R3   t   repot   arg(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getPackages  s    c         C   s   |  j  j |  S(   s   Retrieve a package object from the packages loaded by Yum using
        nevra information.
        
        :param nevra: a tuple holding (name, epoch, version, release, arch)
            for a package
        :return: a :class:`yum.packages.PackageObject` instance (or subclass)
        (   R   t   getPackageObject(   R3   t   nevra(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   getPackageByNevra  s    c         C   s   | j  j j |  d S(   si   Delete the given package from the package sack.

        :param po: the package object to delete
        N(   R   t   sackt
   delPackage(   R3   t   po(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s    c         C   s
   |  j  j S(   sF   Return transaction set.

        :return: the transaction set
        (   R   t   tsInfo(   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt	   getTsInfo  s    N(   R	   R
   R   R>   R   R   R   R  (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s
   	
	c           B   s5   e  Z d  Z d g  d  Z e d    Z d   Z RS(   s(   Conduit for use in solving dependencies.c         C   s,   t  j |  | | |  | |  _ | |  _ d  S(   N(   R   R4   t
   resultcodet   resultstring(   R3   R   R<   Rc   t   rescodet   restring(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4     s    	c         C   s
   |  j  j S(   sD   Boolean indicating if depsolving failed due to missing dependencies.(   R   t   _missing_requires(   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   missing_requires  s    c         C   s&   d j  d   |  j j |  j  D  S(   Ns   
c         s   s   |  ] \ } } | | Vq d  S(   N(    (   t   .0t   prefixR   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pys	   <genexpr>  s    (   Ru   R   t   pretty_output_restringR  (   R3   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR    s    N(   R	   R
   R   R>   R4   t   propertyR	  R  (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR%     s   c           B   s   e  Z d  Z i  d d  Z RS(   s3   Conduit to compare different providers of packages.c         C   s,   t  j |  | | |  | |  _ | |  _ d  S(   N(   R   R4   t   packagest   reqpo(   R3   R   R<   Rc   t   providers_dictR  (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4     s    	N(   R	   R
   R   R>   R4   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR+     s   c           B   s   e  Z d  Z d g  d  Z RS(   s4   Conduit to access information about the yum history.c         C   s)   t  j |  | | |  |  j j |  _ d  S(   N(   R   R4   R   t   history(   R3   R   R<   Rc   R  R  (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4     s    N(   R	   R
   R   R>   R4   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR(     s   c           B   s   e  Z d  Z d   Z RS(   s   Conduit to verify packages.c         C   s#   t  j |  | | |  | |  _ d  S(   N(   R   R4   R.   (   R3   R   R<   Rc   R.   (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR4     s    (   R	   R
   R   R4   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR-     s   c         C   s+   |  j  d  \ } } t |  t |  f S(   s   Parse a string representing an api version.

    :param apiver: a string representing an api version
    :return: a tuple containing the major and minor version numbers
    t   .(   R   t   int(   t   apivert   majt   min(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   parsever  s    c         C   sL   t  |   }  t  |  } |  d | d k r0 d S|  d | d k rH d Sd S(   s   Return true if API version "a" supports API version "b"

    :param a: a string representing an api version
    :param b: a string representing an api version

    :return: whether version *a* supports version *b*
    i    i   (   R  (   t   at   b(    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyR     s    (    (    (    (6   Rm   Rq   R   R   RP   R5   R@   RL   t	   constantsR   R   R   R   R   R   t   textwrapR   R   R;   R   R   R   t   yum.i18nR   R   R  R   t	   TYPE_COREt   TYPE_INTERACTIVERJ   RE   RW   Rp   t   keysRi   t	   ExceptionR/   R8   R   R   R   R   R   R   R   R   R   R   R%   R+   R(   R-   R  R   (    (    (    s/   /usr/lib/python2.7/site-packages/yum/plugins.pyt   <module>   s   

.
(		