From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/
Date: Thu, 26 Feb 2015 04:12:03 +0000 (UTC) [thread overview]
Message-ID: <1420091886.fa577bb409c36c3b38a90f65cb7a665c5474d2c9.dolsen@gentoo> (raw)
Message-ID: <20150226041203.8Xj2st7uRuuP5mAEh2qtTbNZ53bQCVO_Kx2eAtA60aY@z> (raw)
commit: fa577bb409c36c3b38a90f65cb7a665c5474d2c9
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 25 04:00:24 2013 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan 1 05:58:06 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=fa577bb4
Extend ParserBase to do variable substitution.
Also add embedded variable substitiution to default settings.
Why are we not using python's built-in ConfigParser?
We'll migrate it later.
---
catalyst/config.py | 3 +++
catalyst/main.py | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/catalyst/config.py b/catalyst/config.py
index 8b23342..bf3c7c6 100644
--- a/catalyst/config.py
+++ b/catalyst/config.py
@@ -66,6 +66,9 @@ class ParserBase:
# Start a new array using the first element of mobjs
cur_array = [mobjs[0]]
if mobjs[1]:
+ # do any variable substitiution embeded in it with
+ # the values already obtained
+ mobjs[1] = mobjs[1] % values
if self.multiple_values:
# split on white space creating additional array elements
# subarray = white_space.split(mobjs[1])
diff --git a/catalyst/main.py b/catalyst/main.py
index 1446cf9..5fa3f1b 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -116,7 +116,6 @@ def parse_config(myconfig):
# add our python base directory to use for loading target arch's
conf_values["PythonDir"] = __selfpath__
-
# print out any options messages
for opt in conf_values['options']:
if opt in option_messages:
@@ -133,6 +132,11 @@ def parse_config(myconfig):
if "envscript" in myconf:
print "Envscript support enabled."
+ # take care of any variable substitutions that may be left
+ for x in list(conf_values):
+ if isinstance(conf_values[x], str):
+ conf_values[x] = conf_values[x] % conf_values
+
def import_module(target):
"""
next reply other threads:[~2015-02-26 4:12 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-01 5:59 Brian Dolbec [this message]
2015-02-26 4:12 ` [gentoo-commits] proj/catalyst:master commit in: catalyst/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2017-11-22 15:52 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2017-03-16 22:57 Brian Dolbec
2017-03-16 22:57 Brian Dolbec
2017-03-11 9:35 Brian Dolbec
2017-03-11 7:07 Brian Dolbec
2017-03-10 18:38 Brian Dolbec
2017-03-09 10:02 Brian Dolbec
2017-03-09 9:39 Brian Dolbec
2015-11-21 1:33 Brian Dolbec
2015-11-21 1:33 Brian Dolbec
2015-11-21 1:33 Brian Dolbec
2015-11-21 1:33 Brian Dolbec
2015-11-21 1:33 Brian Dolbec
2015-11-21 1:33 Brian Dolbec
2015-09-08 14:14 Brian Dolbec
2015-09-06 21:21 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-09-06 21:18 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-09-06 21:18 Brian Dolbec
2015-09-06 20:33 Brian Dolbec
2015-09-05 16:24 Brian Dolbec
2015-09-04 15:20 Brian Dolbec
2015-09-03 15:14 Brian Dolbec
2015-09-01 5:58 Brian Dolbec
2015-09-01 5:58 Brian Dolbec
2015-09-01 5:58 Brian Dolbec
2015-09-01 5:58 Brian Dolbec
2015-09-01 4:50 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-09-01 5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-08-30 20:58 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-09-01 5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-06-15 20:25 Brian Dolbec
2015-05-24 0:08 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-05-21 23:53 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-02-26 20:44 Brian Dolbec
2015-02-26 20:44 Brian Dolbec
2015-02-26 19:25 Brian Dolbec
2015-02-26 4:12 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-01-01 5:59 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-01-01 5:59 Brian Dolbec
2015-01-01 5:59 Brian Dolbec
2015-01-01 5:59 Brian Dolbec
2015-01-01 5:59 Brian Dolbec
2014-09-11 3:26 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-06-14 5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-09-11 3:26 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-06-14 5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-09-11 3:08 Brian Dolbec
2014-09-11 3:08 Brian Dolbec
2014-09-11 3:08 Brian Dolbec
2014-09-11 3:08 Brian Dolbec
2014-09-11 3:08 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 7:12 Brian Dolbec
2014-09-02 7:12 Brian Dolbec
2014-09-02 7:12 Brian Dolbec
2014-09-02 7:12 Brian Dolbec
2014-09-02 5:54 Brian Dolbec
2014-09-02 5:54 Brian Dolbec
2014-09-02 5:54 Brian Dolbec
2014-09-02 5:54 Brian Dolbec
2014-09-02 5:54 Brian Dolbec
2014-09-02 2:43 Brian Dolbec
2014-09-02 2:43 Brian Dolbec
2014-09-02 2:43 Brian Dolbec
2014-09-02 2:43 Brian Dolbec
2014-09-02 2:43 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-14 5:58 Brian Dolbec
2014-06-14 5:58 Brian Dolbec
2014-06-14 5:58 Brian Dolbec
2014-06-14 5:58 Brian Dolbec
2014-06-14 5:58 Brian Dolbec
2014-06-14 5:58 Brian Dolbec
2014-05-05 19:17 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-04-02 20:09 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-04-02 20:09 Brian Dolbec
2014-04-02 20:09 Brian Dolbec
2014-04-02 20:09 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420091886.fa577bb409c36c3b38a90f65cb7a665c5474d2c9.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox