+def show_new_comments(changes_files, session):
+ sources = set()
+ query = """SELECT package, version, comment, author
+ FROM new_comments
+ WHERE package IN ('"""
+
+ for changes in changes_files:
+ sources.add(os.path.basename(changes).split("_")[0])
+
+ query += "%s') ORDER BY package, version" % "', '".join(sources)
+ r = session.execute(query)
+
+ for i in r:
+ print "%s_%s\n%s\n(%s)\n\n\n" % (i[0], i[1], i[2], i[3])
+
+ session.commit()
+