diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2010-02-18 05:12:43 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2010-02-18 05:24:02 +0100 |
commit | 8990dad4eb192d342545589c66555faae88e8301 (patch) | |
tree | 54b84012f2e80537434f38328b07a987b68c003a /layman/config.py | |
parent | f32f4851f604ff3e96d47f58a2044d3ca71a21b2 (diff) | |
download | layman-8990dad4eb192d342545589c66555faae88e8301.tar.gz layman-8990dad4eb192d342545589c66555faae88e8301.tar.bz2 layman-8990dad4eb192d342545589c66555faae88e8301.zip |
Resolve Actions class, allow custom sys.argv for Config class
Diffstat (limited to 'layman/config.py')
-rw-r--r-- | layman/config.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/layman/config.py b/layman/config.py index bbafba3..0a48c5d 100644 --- a/layman/config.py +++ b/layman/config.py @@ -47,7 +47,7 @@ layman (-l|-L|-S)""" class Config(object): '''Handles the configuration.''' - def __init__(self): + def __init__(self, args=None): ''' Creates and describes all possible polymeraZe options and creates a debugging object. @@ -62,6 +62,8 @@ class Config(object): >>> sorted(a.keys()) ['bzr_command', 'cache', 'config', 'cvs_command', 'darcs_command', 'git_command', 'local_list', 'make_conf', 'mercurial_command', 'nocheck', 'overlays', 'proxy', 'quietness', 'rsync_command', 'storage', 'svn_command', 'tar_command', 'umask', 'width'] ''' + if args == None: + args = sys.argv self.defaults = {'config' : '/etc/layman/layman.cfg', 'storage' : '/var/lib/layman', @@ -236,7 +238,7 @@ class Config(object): # Parse the command line first since we need to get the config # file option. - self.options = self.parser.parse_args()[0] + self.options = self.parser.parse_args(args)[0] # handle debugging OUT.cli_handle(self.options) |