X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fshow_new.py;h=cdd1473ad7428a178af0ee2d1e2f8fb4d3944834;hb=7efeb186029866804f6737f49839998d4fa21cd6;hp=bcf1300e155fcdb0b0077b68b95366f503bc0b87;hpb=4c7eee9642e82b6286f807ad92a93e7ef30288e6;p=dak.git diff --git a/dak/show_new.py b/dak/show_new.py index bcf1300e..cdd1473a 100755 --- a/dak/show_new.py +++ b/dak/show_new.py @@ -51,7 +51,7 @@ sources = set() def html_header(name, filestoexamine): if name.endswith('.changes'): name = ' '.join(name.split('_')[:2]) - print """ + result = """ + """%{"name":name} # we assume only one source (.dsc) per changes here - print """ + result += """ " + +"""%{"pkg":packagename} + result += " " + return result def html_footer(): - print """

Timestamp: %s (UTC)

"""% (time.strftime("%d.%m.%Y / %H:%M:%S", time.gmtime())) - print """

+ result = """

Timestamp: %s (UTC)

+"""% (time.strftime("%d.%m.%Y / %H:%M:%S", time.gmtime())) + result += """

Valid HTML 4.01! @@ -139,11 +144,13 @@ def html_footer(): """ -#""" + return result + ################################################################################ -def do_pkg(changes_file, session): +def do_pkg(changes_file): + session = DBConn().session() u = Upload() u.pkg.changes_file = changes_file (u.pkg.changes["fingerprint"], rejects) = utils.check_signature(changes_file) @@ -177,25 +184,24 @@ def do_pkg(changes_file, session): filestoexamine = [] for pkg in new.keys(): for fn in new[pkg]["files"]: - if (files[fn].has_key("new") and - (files[fn]["type"] == "dsc" or - not re_source_ext.match(files[fn]["type"]))): - filestoexamine.append(fn) + filestoexamine.append(fn) - html_header(changes["source"], filestoexamine) + print html_header(changes["source"], filestoexamine) check_valid(new) - examine_package.display_changes( u.pkg.changes["distribution"], changes_file) + distribution = changes["distribution"].keys()[0] + print examine_package.display_changes(distribution, changes_file) for fn in filter(lambda fn: fn.endswith(".dsc"), filestoexamine): - examine_package.check_dsc(distribution, fn) + print examine_package.check_dsc(distribution, fn) for fn in filter(lambda fn: fn.endswith(".deb") or fn.endswith(".udeb"), filestoexamine): - examine_package.check_deb(distribution, fn) + print examine_package.check_deb(distribution, fn) - html_footer() + print html_footer() if sys.stdout != stdout_fd: sys.stdout.close() sys.stdout = stdout_fd + session.close() ################################################################################ @@ -247,7 +253,7 @@ def main(): if not changes_file: continue print "\n" + changes_file - do_pkg (changes_file, session) + do_pkg (changes_file) files = set(os.listdir(cnf["Show-New::HTMLPath"])) to_delete = filter(lambda x: x.endswith(".html"), files.difference(sources))