def setup_version(requiredVersion): """Knowing the required version of The AI Sandbox, check if it's there and perform and update if necessary.""" if not requiredVersion: return try: try: from aisbx import version if version.checkValid(requiredVersion): return else: version.doUpdate() except ImportError: print >> sys.stderr, "ERROR: Couldn't initialize The AI Sandbox version %s. Starting update..." % requiredVersion import subprocess import winshell subprocess.call(['update.exe'], cwd=os.path.join(winshell.folder('local_appdata'), 'AiGameDev.com', 'The AI Sandbox'), shell=True) except: print >> sys.stderr, "ERROR: Fatal problem initializing The AI Sandbox version %s! Please update.\n" % requiredVersion print >> sys.stderr, " ", os.path.join('%LocalAppData%', 'AiGameDev.com', 'The AI Sandbox'), "\n" sys.exit(-1)
def setup_version(requiredVersion): """Knowing the required version of The AI Sandbox, check if it's there and perform and update if necessary.""" if not requiredVersion: return try: from aisbx import version if version.checkValid(requiredVersion): return else: version.doUpdate() except ImportError: print >>sys.stderr, 'Error initializing The AI Sandbox version %s. Starting update...' % requiredVersion import subprocess subprocess.call(['update.exe'], cwd = os.path.join('%LocalAppData%', 'AiGameDev.com', 'The AI Sandbox'), shell = True) except: print >>sys.stderr, 'Fatal error initializing The AI Sandbox version %s! Please update.' % requiredVersion import traceback print >>sys.stderr, ' '.join(traceback.format_exception(*sys.exc_info())) sys.exit(-1)
def setup_version(requiredVersion): """Knowing the required version of The AI Sandbox, check if it's there and perform and update if necessary.""" if not requiredVersion: return try: try: from aisbx import version if version.checkValid(requiredVersion): return else: version.doUpdate() except ImportError: print >>sys.stderr, "ERROR: Couldn't initialize The AI Sandbox version %s. Starting update..." % requiredVersion import subprocess import winshell subprocess.call(['update.exe'], cwd = os.path.join(winshell.folder('local_appdata'), 'AiGameDev.com', 'The AI Sandbox'), shell = True) except: print >>sys.stderr, "ERROR: Fatal problem initializing The AI Sandbox version %s! Please update.\n" % requiredVersion print >>sys.stderr, " ", os.path.join('%LocalAppData%', 'AiGameDev.com', 'The AI Sandbox'), "\n" sys.exit(-1)