From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (unknown [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F10351381FA for ; Wed, 14 May 2014 21:15:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 24D52E0A5F; Wed, 14 May 2014 21:15:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 87F1CE0A5F for ; Wed, 14 May 2014 21:15:09 +0000 (UTC) Received: from spoonbill.gentoo.org (unknown [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 76C3733F9EC for ; Wed, 14 May 2014 21:15:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 1ACF61818D for ; Wed, 14 May 2014 21:15:07 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1400100983.f3c9664657f2edf41e249cff378b7fb60e1262e2.twitch153@gentoo> Subject: [gentoo-commits] proj/layman:gsoc2014 commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/config.py X-VCS-Directories: layman/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: f3c9664657f2edf41e249cff378b7fb60e1262e2 X-VCS-Branch: gsoc2014 Date: Wed, 14 May 2014 21:15:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9f63677c-605b-4656-a1c5-a43b5d7574d6 X-Archives-Hash: 4f804022fcd9e5fdb6a5365ec2763659 commit: f3c9664657f2edf41e249cff378b7fb60e1262e2 Author: Devan Franchini gentoo org> AuthorDate: Wed May 14 20:56:23 2014 +0000 Commit: Devan Franchini gentoo org> CommitDate: Wed May 14 20:56:23 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=f3c96646 layman/config.py: Adds py3 compatibility for ConfigParser --- layman/config.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/layman/config.py b/layman/config.py index bf33f50..0827b71 100644 --- a/layman/config.py +++ b/layman/config.py @@ -28,7 +28,14 @@ __version__ = "0.2" import sys import os -import ConfigParser + +try: + # Import for Python3 + import configparser as ConfigParser + from configparser import BasicInterpolation +except: + # Import for Python2 + import ConfigParser from layman.output import Message from layman.utils import path @@ -247,6 +254,7 @@ class BareConfig(object): return overlays if (key in self._options and not self._options[key] is None): + self._options['config'] = '/etc/layman/layman.cfg' return self._options[key] if self.config and self.config.has_option('MAIN', key): if key in self._defaults['t/f_options']: