#!/usr/bin/python
#
# Fixes the metamodel python files so that it is imported correctly
#

import re
import sys

f = file(sys.argv[1], "r")

while 1:
	l = f.readline()
	if not l:
		break

	if re.search("^import", l):
		print "import coral"
		l = re.sub("^import _(.*)", "import lib\\1 as _\\1", l)
	l = re.sub("from coral.*", "", l)
        sys.stdout.write(l)
