1# Copyright (c) 2016 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license 9# terms below provided that you ensure that this notice is replicated 10# unmodified and in its entirety in all distributions of the software, 11# modified or unmodified, in source code or in binary form. 12# |
13# Copyright (c) 2008-2009 The Hewlett-Packard Development Company 14# Copyright (c) 2004-2006 The Regents of The University of Michigan 15# All rights reserved. 16# 17# Redistribution and use in source and binary forms, with or without 18# modification, are permitted provided that the following conditions are 19# met: redistributions of source code must retain the above copyright 20# notice, this list of conditions and the following disclaimer; --- 181 unchanged lines hidden (view full) --- 202def makeDir(path): 203 """Make a directory if it doesn't exist. If the path does exist, 204 ensure that it is a directory""" 205 if os.path.exists(path): 206 if not os.path.isdir(path): 207 raise AttributeError, "%s exists but is not directory" % path 208 else: 209 os.mkdir(path) |
210 211def isInteractive(): 212 """Check if the simulator is run interactively or in a batch environment""" 213 214 return sys.__stdin__.isatty() |