public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: Brian Dolbec <dolsen@gentoo.org>
Subject: [gentoo-catalyst] [PATCH 2/3] Move confdefaults out of main.py
Date: Fri, 13 Dec 2013 19:36:56 -0800	[thread overview]
Message-ID: <1386992217-9464-3-git-send-email-dolsen@gentoo.org> (raw)
In-Reply-To: <1386992217-9464-1-git-send-email-dolsen@gentoo.org>

---
 catalyst/defaults.py | 15 +++++++++++++++
 catalyst/main.py     | 19 +++----------------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 50d1d18..aa1e9e8 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -66,3 +66,18 @@ contents_definitions = {
 	# isoinfo_f should be a last resort only
 	"isoinfo_f":["calc_contents","isoinfo -f -i %(file)s"],
 }
+
+
+confdefaults={
+	"distdir": "/usr/portage/distfiles",
+	"hash_function": "crc32",
+	"packagedir": "/usr/portage/packages",
+	"portdir": "/usr/portage",
+	"port_tmpdir": "/var/tmp/portage",
+	"repo_name": "portage",
+	"sharedir": "/usr/lib/catalyst",
+	"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
+	"snapshot_name": "portage-",
+	"storedir": "/var/tmp/catalyst",
+	}
+
diff --git a/catalyst/main.py b/catalyst/main.py
index be21970..e969896 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -22,8 +22,8 @@ sys.path.append(__selfpath__ + "/modules")
 import catalyst.config
 import catalyst.util
 from catalyst.support import CatalystError, find_binary, LockInUse
-from defaults import (required_build_targets, valid_build_targets,
-	hash_definitions
+from catalyst.defaults import (required_build_targets, valid_build_targets,
+	hash_definitions, confdefaults
 	)
 
 from hash_utils import HashMap
@@ -76,19 +76,6 @@ def parse_config(myconfig):
 	myconf={}
 	config_file=""
 
-	confdefaults={
-		"distdir": "/usr/portage/distfiles",
-		"hash_function": "crc32",
-		"packagedir": "/usr/portage/packages",
-		"portdir": "/usr/portage",
-		"port_tmpdir": "/var/tmp/portage",
-		"repo_name": "portage",
-		"sharedir": "/usr/lib/catalyst",
-		"snapshot_name": "portage-",
-		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
-		"storedir": "/var/tmp/catalyst",
-		}
-
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
 		if os.path.exists(myconfig):
@@ -123,7 +110,7 @@ def parse_config(myconfig):
 		sys.exit(1)
 
 	# now, load up the values into conf_values so that we can use them
-	for x in confdefaults.keys():
+	for x in list(confdefaults):
 		if x in myconf:
 			print "Setting",x,"to config file value \""+myconf[x]+"\""
 			conf_values[x]=myconf[x]
-- 
1.8.3.2



  parent reply	other threads:[~2013-12-14  3:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-14  3:36 [gentoo-catalyst] rewite-on-master patches round-4 Brian Dolbec
2013-12-14  3:36 ` [gentoo-catalyst] [PATCH 1/3] Initial creation of a defaults file and Split up support.py Brian Dolbec
2013-12-14  3:36 ` Brian Dolbec [this message]
2013-12-14  3:36 ` [gentoo-catalyst] [PATCH 3/3] Some options cleanup, unifying their use, reducing redundancy 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=1386992217-9464-3-git-send-email-dolsen@gentoo.org \
    --to=dolsen@gentoo.org \
    --cc=gentoo-catalyst@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