Creation of a new defaults.py
authorBrian Dolbec <dolsen@gentoo.org>
Sat, 4 Jan 2014 01:02:09 +0000 (17:02 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Wed, 2 Apr 2014 20:04:24 +0000 (13:04 -0700)
catalyst/support.py: Move some defaults to a new defaults file.

catalyst/defaults.py [new file with mode: 0644]
catalyst/main.py
catalyst/support.py

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
new file mode 100644 (file)
index 0000000..b1dbda4
--- /dev/null
@@ -0,0 +1,23 @@
+
+
+# these should never be touched
+required_build_targets = ["generic_target", "generic_stage_target"]
+
+# new build types should be added here
+valid_build_targets = ["stage1_target", "stage2_target", "stage3_target",
+       "stage4_target", "grp_target", "livecd_stage1_target", "livecd_stage2_target",
+       "embedded_target", "tinderbox_target", "snapshot_target", "netboot_target",
+       "netboot2_target"
+       ]
+
+required_config_file_values = ["storedir", "sharedir", "distdir", "portdir"]
+
+valid_config_file_values = required_config_file_values[:]
+valid_config_file_values.extend(["PKGCACHE", "KERNCACHE", "CCACHE", "DISTCC",
+       "ICECREAM", "ENVSCRIPT", "AUTORESUME", "FETCH", "CLEAR_AUTORESUME",
+       "options", "DEBUG", "VERBOSE", "PURGE", "PURGEONLY", "SNAPCACHE",
+       "snapshot_cache", "hash_function", "digests", "contents", "SEEDCACHE"
+       ])
+
+verbosity = 1
+
index bba3cbab2dbbb12a444ffbec11fdc2d2ff71f9fc..e2ef9762f95b8364d7fdc0c29f248a7d4ccee666 100644 (file)
@@ -21,9 +21,8 @@ sys.path.append(__selfpath__ + "/modules")
 from . import __version__
 import catalyst.config
 import catalyst.util
-from catalyst.support import (required_build_targets,
-       valid_build_targets, CatalystError, find_binary, LockInUse)
-
+from catalyst.support import CatalystError, find_binary, LockInUse
+from catalyst.defaults import required_build_targets, valid_build_targets
 from hash_utils import HashMap, HASH_DEFINITIONS
 from contents import ContentsMap, CONTENTS_DEFINITIONS
 
index 5abf614f79ee1e60d7bce92b45a200e2e77be4c0..4fe46034d6d900cb4a8905fb07f00918e0f373ec 100644 (file)
@@ -1,6 +1,9 @@
 
 import sys,string,os,types,re,signal,traceback,time
 #import md5,sha
+
+from catalyst.defaults import verbosity, valid_config_file_values
+
 selinux_capable = False
 #userpriv_capable = (os.getuid() == 0)
 #fakeroot_capable = False
@@ -80,38 +83,6 @@ def read_from_clst(file):
        return myline
 # read_from_clst
 
-# these should never be touched
-required_build_targets=["generic_target","generic_stage_target"]
-
-# new build types should be added here
-valid_build_targets=["stage1_target","stage2_target","stage3_target","stage4_target","grp_target",
-                       "livecd_stage1_target","livecd_stage2_target","embedded_target",
-                       "tinderbox_target","snapshot_target","netboot_target","netboot2_target"]
-
-required_config_file_values=["storedir","sharedir","distdir","portdir"]
-valid_config_file_values=required_config_file_values[:]
-valid_config_file_values.append("PKGCACHE")
-valid_config_file_values.append("KERNCACHE")
-valid_config_file_values.append("CCACHE")
-valid_config_file_values.append("DISTCC")
-valid_config_file_values.append("ICECREAM")
-valid_config_file_values.append("ENVSCRIPT")
-valid_config_file_values.append("AUTORESUME")
-valid_config_file_values.append("FETCH")
-valid_config_file_values.append("CLEAR_AUTORESUME")
-valid_config_file_values.append("options")
-valid_config_file_values.append("DEBUG")
-valid_config_file_values.append("VERBOSE")
-valid_config_file_values.append("PURGE")
-valid_config_file_values.append("PURGEONLY")
-valid_config_file_values.append("SNAPCACHE")
-valid_config_file_values.append("snapshot_cache")
-valid_config_file_values.append("hash_function")
-valid_config_file_values.append("digests")
-valid_config_file_values.append("contents")
-valid_config_file_values.append("SEEDCACHE")
-
-verbosity=1
 
 def list_bashify(mylist):
        if type(mylist)==types.StringType: