def main(): if len(sys.argv) < 2: print("usage: %s /path/to/projenv" % os.path.basename(sys.argv[0]), file=sys.stderr) sys.exit(2) env = open_environment(sys.argv[1]) with env.db_transaction: for oldprio, newprio in priority_mapping.items(): priority = Priority(env, oldprio) priority.name = newprio priority.update() for severity in list(Severity.select(env)): severity.delete()
def main(): if len(sys.argv) < 2: print >> sys.stderr, 'usage: %s /path/to/projenv' \ % os.path.basename(sys.argv[0]) sys.exit(2) env = open_environment(sys.argv[1]) with env.db_transaction: for oldprio, newprio in priority_mapping.items(): priority = Priority(env, oldprio) priority.name = newprio priority.update() for severity in list(Severity.select(env)): severity.delete()
def main(): if len(sys.argv) < 2: print >> sys.stderr, 'usage: %s /path/to/projenv' \ % os.path.basename(sys.argv[0]) sys.exit(2) env = open_environment(sys.argv[1]) db = env.get_db_cnx() for oldprio, newprio in priority_mapping.items(): priority = Priority(env, oldprio, db) priority.name = newprio priority.update(db) for severity in list(Severity.select(env, db)): severity.delete(db) db.commit()