From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2EB6F1381FA for ; Thu, 5 Jun 2014 22:09:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A499E0999; Thu, 5 Jun 2014 22:09:15 +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 EC651E0983 for ; Thu, 5 Jun 2014 22:09:14 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [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 8B54933FE42 for ; Thu, 5 Jun 2014 22:09:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id E7C73182D7 for ; Thu, 5 Jun 2014 22:09:10 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1399425474.9be2a6aaaac4f0377e3895787aef47ad0d8a93f3.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/core.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 9be2a6aaaac4f0377e3895787aef47ad0d8a93f3 X-VCS-Branch: master Date: Thu, 5 Jun 2014 22:09:10 +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: baf29066-3045-43f1-b43b-2b93081dcc55 X-Archives-Hash: 93ccd8a9f6acd7999c0912e4382922ac commit: 9be2a6aaaac4f0377e3895787aef47ad0d8a93f3 Author: André Erdmann mailerd de> AuthorDate: Wed May 7 01:17:54 2014 +0000 Commit: André Erdmann mailerd de> CommitDate: Wed May 7 01:17:54 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=9be2a6aa not-installed: search for config file in PRJROOT This allows to run roverlay.load_locate_config_file(False,load_main_only=True) from "any" location if ROVERLAY_PRJROOT and PYTHONPATH are set properly. --- roverlay/core.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roverlay/core.py b/roverlay/core.py index d462f0f..2f4215b 100644 --- a/roverlay/core.py +++ b/roverlay/core.py @@ -155,11 +155,13 @@ def locate_config_file ( if os.path.isfile ( cfg ): return cfg - elif os.path.exists ( CONFIG_FILE_NAME + '.local' ): - return CONFIG_FILE_NAME + '.local' + else: + config_dir = os.environ.get ( 'ROVERLAY_PRJROOT', os.getcwd() ) - elif os.path.exists ( CONFIG_FILE_NAME ): - return CONFIG_FILE_NAME + for fname in ( CONFIG_FILE_NAME + '.local', CONFIG_FILE_NAME ): + fpath = config_dir + os.sep + fname + if os.path.exists ( fpath ): + return fpath return None # --- end of locate_config_file (...) ---