diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-17 22:12:14 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-17 22:12:14 (GMT) |
commit | 72cf705dd6b93a405c90c3f904c224ac2b122eb0 (patch) | |
tree | cb57e5e72b791b83ecb0aaef99d6d5ca63b75b96 /devbot | |
parent | 818833eb3b5ec8dc5eeae7aa9c12435501d5c486 (diff) |
Move packages json to a separate dir
Diffstat (limited to 'devbot')
-rw-r--r-- | devbot/config.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/devbot/config.py b/devbot/config.py index 70f9180..abd3e94 100644 --- a/devbot/config.py +++ b/devbot/config.py @@ -84,22 +84,23 @@ def get_module_build_dir(module): def load_packages(): packages = {} - for package_file in package_files: - deps = _load_deps_json(package_file) - for key, value in deps.items(): - packages[key] = value + for file in package_files: + path = os.path.join(config_dir, "packages", "%s.json" % file) + packages.update(json.load(open(path))) return packages def load_prerequisites(): - return _load_deps_json("prerequisites") + path = os.path.join(config_dir, "deps", "prerequisites.json") + return json.load(open(path)) def load_checks(): version = distro.get_system_version() checks = [] - for check_file in dep_files: - checks.extend(_load_deps_json(check_file)) + for file in dep_files: + path = os.path.join(config_dir, "deps", "%s.json" % file) + checks.extend(json.load(open(path))) return checks @@ -112,12 +113,8 @@ def load_modules(): modules = [] - for module_file in module_files: - path = os.path.join(config_dir, "modules", module_file) + for file in module_files: + path = os.path.join(config_dir, "modules", file) modules.extend(json.load(open(path))) return modules - -def _load_deps_json(name): - path = os.path.join(config_dir, "deps", "%s.json" % name) - return json.load(open(path)) |