00001 def getPlyModelsRoot(cur):
00002 try:
00003 cur.execute("""SELECT variable_value FROM variable WHERE variable_name = 'MODEL_ROOT'""")
00004 except:
00005 print "ERROR: Can't get the MODEL_ROOT location"
00006
00007 rows = cur.fetchall()
00008 if len(rows) > 1:
00009 print "WARNING: More than one root location in the DB"
00010 print "WARNING: Using one of them", rows[0][0]
00011
00012 return rows[0][0]
00013
00014 def checkViewsGenerated(cur, scaled_model_id, iteration):
00015 try:
00016 cur.execute("""SELECT scaled_model_id FROM view WHERE iteration = """ + str(iteration) + """ AND scaled_model_id = """ + str(scaled_model_id))
00017 except:
00018 print "ERROR: Can't execute query"
00019
00020 rows = cur.fetchall()
00021 return (len(rows)!=0)