From d728d44b55541f45b0b1a5d33650c20d260da37a Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 18 Jan 2005 15:28:34 -0500 Subject: More configuration fixes sim/pyconfig/m5config.py: put panic, AddToPath, and Import here so they're always available. --HG-- extra : convert_revision : 104dba5ccac0d64479b4109d477b5192c4b07a6e --- sim/pyconfig/m5config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sim') diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py index d7c0c6507..4e2a377b0 100644 --- a/sim/pyconfig/m5config.py +++ b/sim/pyconfig/m5config.py @@ -35,6 +35,19 @@ def defined(key): def define(key, value = True): env[key] = value +def panic(*args, **kwargs): + sys.exit(*args, **kwargs) + +def AddToPath(path): + path = os.path.realpath(path) + if os.path.isdir(path): + sys.path.append(path) + +def Import(path): + AddToPath(os.path.dirname(path)) + exec('from m5config import *') + mpy_exec(file(path, 'r')) + def issequence(value): return isinstance(value, tuple) or isinstance(value, list) -- cgit v1.2.3