cls._instance = super(Singleton, cls).__call__(*args, **kwargs)
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'):
FULL_SYSTEM = True
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# 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('../configs/kernel')
sys.path.append('../sim/pyconfig')
-from importer import mpy_exec
+from importer import mpy_exec, AddToPath
from m5config import *
try:
sys.exit('Improper Usage')
for arg in args:
+ AddToPath(os.path.dirname(arg))
mpy_exec(file(arg, 'r'), globals())
if globals().has_key('root') and isinstance(root, type) \