Move confdefaults out of main.py
authorBrian Dolbec <dolsen@gentoo.org>
Sat, 19 Jan 2013 05:51:35 +0000 (21:51 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Thu, 28 Feb 2013 01:38:12 +0000 (17:38 -0800)
catalyst/defaults.py
catalyst/main.py

index 50d1d1859753c4c695c31514452022c8dbc20107..6eff39ed848231b2c24e8f91a80ab239d374079e 100644 (file)
@@ -66,3 +66,19 @@ contents_definitions = {
        # isoinfo_f should be a last resort only
        "isoinfo_f":["calc_contents","isoinfo -f -i %(file)s"],
 }
+
+
+confdefaults={
+       "storedir": "/var/tmp/catalyst",
+       "sharedir": "/usr/lib/catalyst",
+       "distdir": "/usr/portage/distfiles",
+       "repo_name": "portage",
+       "portdir": "/usr/portage",
+       "packagedir": "/usr/portage/packages",
+       "port_tmpdir": "/var/tmp/portage",
+       "options": "",
+       "snapshot_name": "portage-",
+       "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
+       "hash_function": "crc32",
+       }
+
index 2bf7565970469bda10c9b6fe88a3484321c49899..d5f68cc2597d13071be3e38841765fb6eaf0f75f 100644 (file)
@@ -18,8 +18,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
@@ -72,20 +72,6 @@ def parse_config(myconfig):
        myconf={}
        config_file=""
 
-       confdefaults={
-               "storedir": "/var/tmp/catalyst",
-               "sharedir": "/usr/lib/catalyst",
-               "distdir": "/usr/portage/distfiles",
-               "repo_name": "portage",
-               "portdir": "/usr/portage",
-               "packagedir": "/usr/portage/packages",
-               "port_tmpdir": "/var/tmp/portage",
-               "options": "",
-               "snapshot_name": "portage-",
-               "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
-               "hash_function": "crc32",
-               }
-
        # first, try the one passed (presumably from the cmdline)
        if myconfig:
                if os.path.exists(myconfig):
@@ -120,7 +106,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]