[yum-cvs] yum/yum __init__.py,1.125,1.126 plugins.py,1.15,1.16

Menno Smits mjs at login.linux.duke.edu
Tue Jun 21 12:22:29 UTC 2005


Update of /home/groups/yum/cvs/yum/yum
In directory login:/tmp/cvs-serv15880/yum

Modified Files:
	__init__.py plugins.py 
Log Message:
Renamed the plugin "typefilter" argument to just "types" (sorry, couldn't stand it)


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- __init__.py	19 Jun 2005 14:42:18 -0000	1.125
+++ __init__.py	21 Jun 2005 12:22:27 -0000	1.126
@@ -139,21 +139,21 @@
         '''
         self.plugins = plugins.DummyYumPlugins()
     
-    def doPluginSetup(self, optparser=None, typefilter=None):
+    def doPluginSetup(self, optparser=None, types=None):
         '''Initialise and enable yum plugins. 
 
         If plugins are going to be used, this should be called soon after
         doConfigSetup() has been called.
 
         @param optparser: The OptionParser instance for this run (optional)
-        @param typefilter: A sequence specifying the types of plugins to load.
+        @param types: A sequence specifying the types of plugins to load.
             This should be sequnce containing one or more of the
             yum.plugins.TYPE_...  constants. If None (the default), all plugins
             will be loaded.
         '''
         # Load plugins first as they make affect available config options
         self.plugins = plugins.YumPlugins(self, self.conf.pluginpath,
-                optparser, typefilter)
+                optparser, types)
 
         # Process options registered by plugins
         self.plugins.parseopts(self.conf, self.repos.findRepos('*'))

Index: plugins.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/plugins.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- plugins.py	7 Jun 2005 13:47:32 -0000	1.15
+++ plugins.py	21 Jun 2005 12:22:27 -0000	1.16
@@ -105,14 +105,14 @@
     Manager class for Yum plugins.
     '''
 
-    def __init__(self, base, searchpath, optparser=None, typefilter=None):
+    def __init__(self, base, searchpath, optparser=None, types=None):
         '''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 typefilter: A sequence specifying the types of plugins to load.
+        @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.
         '''
@@ -121,10 +121,10 @@
         self.base = base
         self.optparser = optparser
         self.cmdline = (None, None)
-        if not typefilter:
-            typefilter = ALL_TYPES
+        if not types:
+            types = ALL_TYPES
 
-        self._importplugins(typefilter)
+        self._importplugins(types)
 
         self.opts = {}
         self.cmdlines = {}
@@ -166,7 +166,7 @@
             _, conf = self._plugins[modname]
             func(conduitcls(self, self.base, conf, **kwargs))
 
-    def _importplugins(self, typefilter):
+    def _importplugins(self, types):
         '''Load plugins matching the given types.
         '''
 
@@ -181,9 +181,9 @@
             if not os.path.isdir(dir):
                 continue
             for modulefile in glob.glob('%s/*.py' % dir):
-                self._loadplugin(modulefile, typefilter)
+                self._loadplugin(modulefile, types)
 
-    def _loadplugin(self, modulefile, typefilter):
+    def _loadplugin(self, modulefile, types):
         '''Attempt to import a plugin module and register the hook methods it
         uses.
         '''
@@ -219,7 +219,7 @@
         if len(plugintypes) < 1:
             return
         for plugintype in plugintypes:
-            if plugintype not in typefilter:
+            if plugintype not in types:
                 return
 
         self.base.log(2, 'Loading "%s" plugin' % modname)




More information about the Yum-cvs-commits mailing list