Config cleanups

sim/pyconfig/m5config.py:
    Remove unused code
    remove the defined() function that was masking the one
    that I really wanted
test/genini.py:
    Add the directory that a script was executed from to the
    path

--HG--
extra : convert_revision : a1861065b2de46d77c94691d0c5a7865cdce0f09
This commit is contained in:
Nathan Binkert 2005-01-17 23:41:35 -05:00
parent cc4e4ab7e1
commit 82df189bad
2 changed files with 3 additions and 26 deletions

View file

@ -46,30 +46,6 @@ class Singleton(type):
cls._instance = super(Singleton, cls).__call__(*args, **kwargs) cls._instance = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instance return cls._instance
#class MetaTempObject(type):
# classes = {}
# def __new__(mcls, name, bases, dict):
# _bases = []
# for base in bases:
# if base.__name__ is 'TempObject':
# _bases.append('SimObject')
# else:
# _bases.append(base.__name__)
# newdict = { '_bases' : _bases, '_name' : name, '_params' : dict }
# cls = type.__new__(mcls, name, bases, newdict)
# mcls.classes[name] = cls
# return cls
#
#class TempObject(object):
# __metaclass__ = MetaTempObject
def defined(s):
try:
eval(s)
return True
except NameError:
return False
if os.environ.has_key('FULL_SYSTEM'): if os.environ.has_key('FULL_SYSTEM'):
FULL_SYSTEM = True FULL_SYSTEM = True

View file

@ -25,13 +25,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import getopt, os, sys import getopt, os, os.path, sys
sys.path.append('..') sys.path.append('..')
sys.path.append('../configs/kernel') sys.path.append('../configs/kernel')
sys.path.append('../sim/pyconfig') sys.path.append('../sim/pyconfig')
from importer import mpy_exec from importer import mpy_exec, AddToPath
from m5config import * from m5config import *
try: try:
@ -50,6 +50,7 @@ except getopt.GetoptError:
sys.exit('Improper Usage') sys.exit('Improper Usage')
for arg in args: for arg in args:
AddToPath(os.path.dirname(arg))
mpy_exec(file(arg, 'r'), globals()) mpy_exec(file(arg, 'r'), globals())
if globals().has_key('root') and isinstance(root, type) \ if globals().has_key('root') and isinstance(root, type) \