# Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
# Distributed under the GPL v2
+ 11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+ modules/catalyst/arch/__init__.py, modules/catalyst/arch/arm.py:
+ Remove hard-coded arch list now that find_arch_modules() is known to work
+
11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
modules/catalyst/arch/__init__.py, modules/catalyst/arch/alpha.py,
modules/catalyst/arch/amd64.py, modules/catalyst/arch/arm.py,
import imp
import catalyst.util
-# This hard-coded list of arch is here until I find a good way to get a list of
-# other modules contained in the same dir as this file
-__arch_module_list = (
- "alpha",
- "amd64",
- "arm",
- "hppa",
- "ia64",
- "mips",
- "powerpc",
- "s390",
- "sh",
- "sparc",
- "x86"
-)
+# This is only until we move all the output stuff into catalyst.output
+from catalyst_support import msg
class arches:
- __arch_modules = None
-
def __init__(self):
- self.__arch_modules = {}
+ self._arch_modules = {}
def find_arch_modules(self):
search_dir = os.path.abspath(os.path.dirname(__file__))
return arch_module_list
def get_arches(self):
- # We don't know if this works yet
-# for x in self.find_arch_modules():
- for x in __arch_module_list:
- self.__arch_modules[x] = catalyst.util.load_module("catalyst.arch." + x)
- if self.__arch_modules[x] is None:
+ for x in self.find_arch_modules():
+ self._arch_modules[x] = catalyst.util.load_module("catalyst.arch." + x)
+ if self._arch_modules[x] is None:
msg("Cannot import catalyst.arch." + x + ". This usually only " + \
"happens due to a syntax error, which should be reported as " \
"a bug.")
- return self.__arch_modules
+ return self._arch_modules