[yum-cvs] yum cli.py,1.215,1.216
Menno Smits
mjs at linux.duke.edu
Thu Jun 15 09:59:16 UTC 2006
- Previous message: [yum-cvs] yum-utils/plugins/fastestmirror ChangeLog, 1.2, 1.3 fastestmirror.py, 1.4, 1.5
- Next message: [yum-cvs] yum/yum __init__.py, 1.208, 1.209 config.py, 1.98, 1.99 plugins.py, 1.26, 1.27
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/groups/yum/cvs/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv24269
Modified Files:
cli.py
Log Message:
Clean up recent changes to config setup API:
- removed doStartupConfig()
- doConfigSetup() now sets up plugins and logging at the right time via
external (overridable) methods
- don't keep startupconf hanging around in base object (removed all references)
Index: cli.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/cli.py,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -r1.215 -r1.216
--- cli.py 14 Jun 2006 18:07:09 -0000 1.215
+++ cli.py 15 Jun 2006 09:59:14 -0000 1.216
@@ -171,38 +171,13 @@
else:
root = '/'
- # Do read of config options required during initialisation
+ # Read up configuration options and initialise plugins
try:
- self.doStartupConfig(opts.conffile, root)
- except yum.Errors.ConfigError, e:
- self.errorlog(0, _('Config Error: %s') % e)
- sys.exit(1)
- except ValueError, e:
- self.errorlog(0, _('Options Error: %s') % e)
- self.usage()
- sys.exit(1)
-
- # Initialise logger object
- self.log = Logger(threshold=self.startupconf.debuglevel,
- file_object=sys.stdout)
-
- # Setup debug and error levels
- if opts.debuglevel is not None:
- self.log.threshold = opts.debuglevel
- self.startupconf.debuglevel = opts.debuglevel
- if opts.errorlevel is not None:
- self.errorlog.threshold = opts.errorlevel
- self.startupconf.errorlevel = opts.errorlevel
-
- # Initialise plugins if cmd line and config file say they should be in
- # use. In this step plugins may add extra command line options or
- # configuration file options.
- if not opts.noplugins and self.startupconf.plugins:
- self.doPluginSetup(self.optparser)
-
- # Parse the configuration file
- try:
- self.doConfigSetup()
+ self.doConfigSetup(opts.conffile, root,
+ init_plugins=not opts.noplugins,
+ optparser=self.optparser,
+ debuglevel=opts.debuglevel,
+ errorlevel=opts.errorlevel)
except yum.Errors.ConfigError, e:
self.errorlog(0, _('Config Error: %s') % e)
sys.exit(1)
@@ -331,6 +306,9 @@
# run the sleep - if it's unchanged then it won't matter
time.sleep(sleeptime)
+ def doLoggingSetup(self, debuglevel, errorlevel):
+ self.log = Logger(threshold=debuglevel, file_object=sys.stdout)
+ self.errorlog.threshold = errorlevel
def parseCommands(self, mycommands=[]):
"""reads self.cmds and parses them out to make sure that the requested
- Previous message: [yum-cvs] yum-utils/plugins/fastestmirror ChangeLog, 1.2, 1.3 fastestmirror.py, 1.4, 1.5
- Next message: [yum-cvs] yum/yum __init__.py, 1.208, 1.209 config.py, 1.98, 1.99 plugins.py, 1.26, 1.27
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Yum-cvs-commits
mailing list