def load(self, db):
"""Load the application from the specified database
db: a ravel.db.RavelDb instance into which the application will be loaded"""
if self.sqlfile is None:
logger.debug("loaded application %s with no SQL file", self.name)
return
with open(self.sqlfile) as f:
try:
db.cursor.execute(f.read())
except psycopg2.ProgrammingError, e:
print "Error loading app {0}: {1}".format(self.name, e)
logger.debug("loaded application %s", self.name)
评论列表
文章目录