From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-commits+bounces-369476-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1QpwPr-0005hT-AX
	for garchives@archives.gentoo.org; Sun, 07 Aug 2011 06:00:51 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 7CC8E21C0BD;
	Sun,  7 Aug 2011 06:00:42 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 2F27421C0BD
	for <gentoo-commits@lists.gentoo.org>; Sun,  7 Aug 2011 06:00:41 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7B0C51B4045
	for <gentoo-commits@lists.gentoo.org>; Sun,  7 Aug 2011 06:00:41 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id CAFE580040
	for <gentoo-commits@lists.gentoo.org>; Sun,  7 Aug 2011 06:00:40 +0000 (UTC)
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" <brian.dolbec@gmail.com>
Message-ID: <4a856960773b513a6dd821b4dac2c5aa87ccc929.dol-sen@gentoo>
Subject: [gentoo-commits] proj/layman:master commit in: layman/
X-VCS-Repository: proj/layman
X-VCS-Files: layman/argsparser.py layman/config.py
X-VCS-Directories: layman/
X-VCS-Committer: dol-sen
X-VCS-Committer-Name: Brian Dolbec
X-VCS-Revision: 4a856960773b513a6dd821b4dac2c5aa87ccc929
Date: Sun,  7 Aug 2011 06:00:40 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: f2a6aea26a6d6db1ad27103f9cd91209

commit:     4a856960773b513a6dd821b4dac2c5aa87ccc929
Author:     dol-sen <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Sun Aug  7 02:27:30 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Aug  7 05:59:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D=
commit;h=3D4a856960

fix a bug causing it to not get the correct config path.
improve debug messages, set levels to 9

---
 layman/argsparser.py |   30 +++++++++++++++++-------------
 layman/config.py     |   10 +++++-----
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/layman/argsparser.py b/layman/argsparser.py
index fd255d7..93f11d6 100644
--- a/layman/argsparser.py
+++ b/layman/argsparser.py
@@ -269,12 +269,19 @@ class ArgsParser(BareConfig):
         # Set only alternate config settings from the options
         if self.options.__dict__['config'] is not None:
             self.defaults['config'] =3D self.options.__dict__['config']
-            self.output.debug('Got config file at ' + self.defaults['con=
fig'], 8)
+            self.output.debug('ARGSPARSER: Got config file at ' + \
+                self.defaults['config'], 8)
+        else: # fix the config path
+            self.defaults['config'] =3D self.defaults['config'] \
+                % {'configdir': self.defaults['configdir']}
         if self.options.__dict__['overlay_defs'] is not None:
             self.defaults['overlay_defs'] =3D self.options.__dict__['ove=
rlay_defs']
-            self.output.debug('Got overlay_defs location at ' + self.def=
aults['overlay_defs'], 8)
+            self.output.debug('ARGSPARSER: Got overlay_defs location at =
' + \
+                self.defaults['overlay_defs'], 8)
=20
         # Now parse the config file
+        self.output.debug('ARGSPARSER: Reading config file at ' + \
+            self.defaults['config'], 8)
         self.read_config(self.defaults)
=20
         # handle quietness
@@ -283,9 +290,6 @@ class ArgsParser(BareConfig):
         elif self.options.__dict__['quietness']:
             self.set_option('quietness', self.options.__dict__['quietnes=
s'])
=20
-        #self.output.debug('Reading config file at ' + self.defaults['co=
nfig'], 8)
-
-        self.read_config(self.defaults)
=20
     def __getitem__(self, key):
=20
@@ -299,20 +303,20 @@ class ArgsParser(BareConfig):
             if len(overlays):
                 return  overlays
=20
-        self.output.debug('Retrieving option', 8)
+        self.output.debug('ARGSPARSER: Retrieving options option: %s' % =
key, 9)
=20
         if (key in self.options.__dict__.keys()
             and not self.options.__dict__[key] is None):
             return self.options.__dict__[key]
=20
-        self.output.debug('Retrieving option', 8)
+        self.output.debug('ARGSPARSER: Retrieving config option: %s' % k=
ey, 9)
=20
         if self.config.has_option('MAIN', key):
             if key in self._defaults['t/f_options']:
                 return self.t_f_check(self.config.get('MAIN', key))
             return self.config.get('MAIN', key)
=20
-        self.output.debug('Retrieving option', 8)
+        self.output.debug('ARGSPARSER: Retrieving option: %s' % key, 9)
=20
         if key in self._options.keys():
             return self._options[key]
@@ -320,7 +324,7 @@ class ArgsParser(BareConfig):
         if key in self.defaults.keys():
             return self.defaults[key]
=20
-        self.output.debug('Retrieving option', 8)
+        self.output.debug('ARGSPARSER: Retrieving option failed. returni=
ng None', 9)
=20
         return None
=20
@@ -328,22 +332,22 @@ class ArgsParser(BareConfig):
     def keys(self):
         '''Special handler for the configuration keys.'''
=20
-        self.output.debug('Retrieving keys', 8)
+        self.output.debug('ARGSPARSER: Retrieving keys', 9)
=20
         keys =3D [i for i in self.options.__dict__.keys()
                 if not self.options.__dict__[i] is None]
=20
-        self.output.debug('Retrieving keys', 8)
+        self.output.debug('ARGSPARSER: Retrieving keys 2', 9)
=20
         keys +=3D [name for name, _ in self.config.items('MAIN')
                  if not name in keys]
=20
-        self.output.debug('Retrieving keys', 8)
+        self.output.debug('ARGSPARSER: Retrieving keys 3', 9)
=20
         keys +=3D [i for i in self.defaults.keys()
                  if not i in keys]
=20
-        self.output.debug('Retrieving keys', 8)
+        self.output.debug('ARGSPARSER: Returning keys', 9)
=20
         return keys
=20

diff --git a/layman/config.py b/layman/config.py
index 644a63a..3873eef 100644
--- a/layman/config.py
+++ b/layman/config.py
@@ -150,14 +150,14 @@ class BareConfig(object):
         '''Special handler for the configuration keys.
         '''
         self._options['output'].debug(
-            'Retrieving %s options' % self.__class__.__name__, 8)
+            'Retrieving %s options' % self.__class__.__name__, 9)
         keys =3D [i for i in self._options]
         self._options['output'].debug(
-            'Retrieving %s defaults' % self.__class__.__name__, 8)
+            'Retrieving %s defaults' % self.__class__.__name__, 9)
         keys +=3D [i for i in self._defaults
                  if not i in keys]
         self._options['output'].debug(
-            'Retrieving %s done...' % self.__class__.__name__, 8)
+            'Retrieving %s done...' % self.__class__.__name__, 9)
         return keys
=20
=20
@@ -195,7 +195,7 @@ class BareConfig(object):
=20
     def _get_(self, key):
         self._options['output'].debug(
-            'Retrieving %s option: %s' % (self.__class__.__name__, key),=
 8)
+            'Retrieving %s option: %s' % (self.__class__.__name__, key),=
 9)
         if key =3D=3D 'overlays':
             overlays =3D ''
             if (key in self._options
@@ -212,7 +212,7 @@ class BareConfig(object):
             if key in self._defaults['t/f_options']:
                 return self.t_f_check(self.config.get('MAIN', key))
             return self.config.get('MAIN', key)
-        self._options['output'].debug('Retrieving BareConfig default', 8=
)
+        self._options['output'].debug('Retrieving BareConfig default', 9=
)
         if key in self._defaults['t/f_options']:
             return self.t_f_check(self._defaults[key])
         if key in self._defaults: