- override.setdefault(suite, {})
- override[suite].setdefault(component, {})
- override[suite][component].setdefault(otype, {})
+ """
+ # Here's a nice example of why the object API isn't always the
+ # right answer. On my laptop, the object version of the code
+ # takes 1:45, the 'dumb' tuple-based one takes 0:16 - mhy
+
+ if otype.overridetype == "dsc":
+ #q = session.query(Override).filter_by(suite_id = suite.suite_id)
+ #q = q.filter_by(component_id = component.component_id)
+ #q = q.filter_by(overridetype_id = otype.overridetype_id)
+ #q = q.join(Section).order_by(Section.section, Override.package)
+ #for o in q.all():
+ # dat = (o.package, o.section.section, o.maintainer)
+ # output_file.write(utils.result_join(dat) + '\n')
+ q = session.execute("SELECT o.package, s.section, o.maintainer FROM override o, section s WHERE o.suite = %s AND o.component = %s AND o.type = %s AND o.section = s.id ORDER BY s.section, o.package" % (suite.suite_id, component.component_id, otype.overridetype_id))
+ for i in q.fetchall():
+ output_file.write(utils.result_join(i) + '\n')