comparison tools/mira4/mira4.py @ 13:7fcabeeca5df draft

Uploaded v0.0.2 preview 5, fixes for MIRA 4.0 (final), more verbose error if $MIRA4 path wrong
author peterjc
date Sun, 16 Feb 2014 16:30:48 -0500
parents a6a56440567c
children 381aa262c8cb
comparison
equal deleted inserted replaced
12:a6a56440567c 13:7fcabeeca5df
38 mira_path = os.environ["MIRA4"] 38 mira_path = os.environ["MIRA4"]
39 except KeyError: 39 except KeyError:
40 stop_err("Environment variable $MIRA4 not set") 40 stop_err("Environment variable $MIRA4 not set")
41 mira_binary = os.path.join(mira_path, "mira") 41 mira_binary = os.path.join(mira_path, "mira")
42 if not os.path.isfile(mira_binary): 42 if not os.path.isfile(mira_binary):
43 stop_err("Missing mira under $MIRA4, %r" % mira_binary) 43 stop_err("Missing mira under $MIRA4, %r\nFolder contained: %s"
44 % (mira_binary, ", ".join(os.listdir(mira_path))))
44 mira_convert = os.path.join(mira_path, "miraconvert") 45 mira_convert = os.path.join(mira_path, "miraconvert")
45 if not os.path.isfile(mira_convert): 46 if not os.path.isfile(mira_convert):
46 stop_err("Missing miraconvert under $MIRA4, %r" % mira_convert) 47 stop_err("Missing miraconvert under $MIRA4, %r\nFolder contained: %s"
48 % (mira_convert, ", ".join(os.listdir(mira_path))))
47 49
48 mira_ver = get_version(mira_binary) 50 mira_ver = get_version(mira_binary)
49 if not mira_ver.strip().startswith("4.0"): 51 if not mira_ver.strip().startswith("4.0"):
50 stop_err("This wrapper is for MIRA V4.0, not:\n%s\n%s" % (mira_ver, mira_binary)) 52 stop_err("This wrapper is for MIRA V4.0, not:\n%s\n%s" % (mira_ver, mira_binary))
51 mira_convert_ver = get_version(mira_convert) 53 mira_convert_ver = get_version(mira_convert)