Move confdefaults out of main.py
authorBrian Dolbec <dolsen@gentoo.org>
Sat, 19 Jan 2013 05:51:35 +0000 (21:51 -0800)
committerW. Trevor King <wking@tremily.us>
Sun, 15 Dec 2013 04:25:05 +0000 (20:25 -0800)
catalyst/defaults.py
catalyst/main.py

index 50d1d1859753c4c695c31514452022c8dbc20107..9398d6410e8f13158793d339a25f7d4342385a6d 100644 (file)
@@ -66,3 +66,17 @@ 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",
+       "options": "",
+       "packagedir": "/usr/portage/packages",
+       "portdir": "/usr/portage",
+       "repo_name": "portage",
+       "sharedir": "/usr/share/catalyst",
+       "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
+       "snapshot_name": "portage-",
+       "storedir": "/var/tmp/catalyst",
+       }
index a8770dae76eb3c0b2a53056399baad9f5d9673d1..77e6f73d64736697a5015fc730e1c63144180bc7 100755 (executable)
@@ -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",
-               "options": "",
-               "packagedir": "/usr/portage/packages",
-               "portdir": "/usr/portage",
-               "repo_name": "portage",
-               "sharedir": "/usr/share/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):
@@ -121,7 +108,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]