diff options
author | 2009-11-23 21:24:25 +0100 | |
---|---|---|
committer | 2009-11-23 21:24:25 +0100 | |
commit | b13e47e89525a39a23aec57328769449daaae310 (patch) | |
tree | 02f07d6ccee1489df40edb0fd963d81d04424008 | |
parent | Work correctly on computers with stable arch in ACCEPT_KEYWORDS. (diff) | |
download | gentoo-bumpchecker-b13e47e89525a39a23aec57328769449daaae310.tar.gz gentoo-bumpchecker-b13e47e89525a39a23aec57328769449daaae310.tar.bz2 gentoo-bumpchecker-b13e47e89525a39a23aec57328769449daaae310.zip |
Prettify Kudos to Yngwin. Also fix slight issue with ~ keywords detection.
-rw-r--r-- | gbc.css | 60 | ||||
-rw-r--r-- | modules/portage_module.py | 2 | ||||
-rw-r--r-- | modules/xmodular_output.py | 58 |
3 files changed, 91 insertions, 29 deletions
@@ -0,0 +1,60 @@ +/* + Gentoo Bumpchecker Stylesheet + Copyright ©2009 Ben de Groot <yngwin@gentoo.org> + Licensed under the GPL version 2 (or later) +*/ + +/* limited reset */ +html,body,div,span,h1,h2,h3,p,a,table,tr,th,td { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font-weight: normal; + background: transparent; +} + +body { + background: #fff; + color: #555; + padding: 40px; + line-height: 1.2; + font-family: 'dejavu sans','bitstream vera sans',sans-serif; + font-size: .8em; +} + +h1 { + font: bold 2.4em/1 georgia,serif; + margin-bottom: 1em; +} + +p { + margin: .2em 0; +} + +#stats { + margin: 1em 0; +} + +table { + margin: 1em 0; + border: 1px solid #aaa; +} + +th { + font-weight: bold; +} + +th,td { + padding: 3px; + border: 1px solid #fff; + text-align: center; +} + +.pn { text-align: left; } + +.compliant { background: #8e8; } +.stableneedupdate { background: #acf; } +.needupdate { background: #f98; } +.notfound { background: #ddd; } +.newerversion { background: #fe8; } diff --git a/modules/portage_module.py b/modules/portage_module.py index 8f18321..82c4cf1 100644 --- a/modules/portage_module.py +++ b/modules/portage_module.py @@ -98,7 +98,7 @@ def find_packages_in_tree(package_list, portdir=None, all_overlays=False, overla else: #testing mysettings = portage.config(clone=portdbsettings) - mysettings['ACCEPT_KEYWORDS'] = '~amd64' # the arch I care for :] + mysettings['ACCEPT_KEYWORDS'] = 'amd64 ~amd64' # the arch I care for :] olddbapi_kw = portdbapi portdbapi = portage.portdbapi(mysettings['PORTDIR'], mysettings) diff --git a/modules/xmodular_output.py b/modules/xmodular_output.py index 84975c0..57f3c9c 100644 --- a/modules/xmodular_output.py +++ b/modules/xmodular_output.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- # Copyright John N. Laliberte <allanonjl@gentoo.org> +# Copyright Ben de Groot <yngwin@gentoo.org> # LICENSE - GPL2 -import package_module,time,clioptions_module,gnome_module,os +import package_module,time,clioptions_module,gnome_module,os,cgi class Output: @@ -51,62 +52,63 @@ class Output: # now we have all the results in the results list. # just time to generate some kind of "useful" output. - # for now, lets just make a crappy html file. ( this should use css and the like ) + # for now, lets just make a html file. ( using html5 and css ) # name, portage_version, gnome_version, status <-- is whats in the PackageUpdate object current_time = str(time.asctime(time.localtime())) lines = [] # header - lines.append('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">') + lines.append('<!DOCTYPE html>') lines.append("<html>") lines.append('<head>') - lines.append('<title>Xorg progress Table</title>') - lines.append('<link rel="stylesheet" type="text/css" href="default.css"></link>') + lines.append(' <meta charset="utf-8">') + lines.append(' <title>Xorg Progress Table</title>') + lines.append(' <link rel="stylesheet" type="text/css" href="gbc.css">') lines.append('</head>') lines.append("<body>") - lines.append("<h2>Xorg progress Table</h2>") - lines.append("contact " + os.environ["ECHANGELOG_USER"] + " if anything is not correct<br>") - lines.append("Generated date: " + current_time + "<br>") + lines.append("<h1>Xorg Progress Table</h1>") + lines.append("<p>Contact " + cgi.escape(os.environ["ECHANGELOG_USER"]) + " if anything is not correct.</p>") + lines.append("<p>Generated date: " + current_time + "</p>") # stats - lines.append("<br>") - lines.append("Compliant Packs: " + str('%0.2f' % self.compliant_percent)+ "%" + " Number = " + str(self.compliant) + "<br>") - lines.append("Packs that need to be updated: " + str('%0.2f' % self.update_percent)+ "%" + " Number = " + str(self.update_needed) + "<br>") - lines.append("New Packs that need to be added: " + str('%0.2f' % self.notfound_percent)+ "%" + " Number = " + str(self.not_found) + "<br>") - lines.append("<br>") + lines.append('<div id="stats">') + lines.append("<p>Compliant Packages: " + str('%0.2f' % self.compliant_percent)+ "%" + " Number = " + str(self.compliant) + "</p>") + lines.append("<p>Packages that need to be updated: " + str('%0.2f' % self.update_percent)+ "%" + " Number = " + str(self.update_needed) + "</p>") + lines.append("<p>New Packages that need to be added: " + str('%0.2f' % self.notfound_percent)+ "%" + " Number = " + str(self.not_found) + "</p>") + lines.append("</div>") - lines.append('<table cellpadding="3">') + lines.append('<table>') lines.append('<tr>') - lines.append("<th>Package Name</th><th>STABLE Version</th><th>Testing Version</th><th>Official Version</th><th>Latest Version</th>") + lines.append('<th class="pn">Package Name</th><th>Stable</th><th>Testing</th><th>Official</th><th>Latest</th>') lines.append('</tr>') # data for package in self.packages: if package.status == package_module.Status.NeedUpdate: - lines.append('<tr bgcolor="#FF8A75">') # "red" + lines.append('<tr class="needupdate">') # "red" elif package.status == package_module.Status.StableNeedUpdate: - lines.append('<tr bgcolor="#66CCCC">') # "blue" + lines.append('<tr class="stableneedupdate">') # "blue" elif package.status == package_module.Status.Compliant: - lines.append('<tr bgcolor="#D0EE80">') # "green" + lines.append('<tr class="compliant">') # "green" elif package.status == package_module.Status.NotFound: - lines.append('<tr bgcolor="#EBEBEB">') # "grey" + lines.append('<tr class="notfound">') # "grey" elif package.status == package_module.Status.NewerVersion: - lines.append('<tr bgcolor="#FBEC5D">') # "yellow" + lines.append('<tr class="newerversion">') # "yellow" - lines.append("<td>" + str(package.name) + "</td>") - lines.append('<th>' + str(package.stable_version) + "</th>") - lines.append("<th>" + str(package.portage_version) + "</th>") - lines.append("<th>" + str(package.gnome_version) + "</th>") - lines.append("<th>" + str(package.latest_version) + "</th>") + lines.append('<td class="pn">' + str(package.name) + "</td>") + lines.append('<td>' + str(package.stable_version) + "</td>") + lines.append("<td>" + str(package.portage_version) + "</td>") + lines.append("<td>" + str(package.gnome_version) + "</td>") + lines.append("<td>" + str(package.latest_version) + "</td>") lines.append("</tr>") lines.append("</table>") # footer - lines.append("<br>Official Version: Latest stable Xorg released individual packages") - lines.append("<br>Latest Version: Latest available Xorg released individual packages. Including the snapshots") - lines.append("</html>") + lines.append("<p>Official Version: Latest stable Xorg released individual packages.</p>") + lines.append("<p>Latest Version: Latest available Xorg released individual packages, including the snapshots.</p>") + lines.append("</body></html>") self.write_file(lines, clioptions_module.Options().get_arguments().output) |