[Piuparts-commits] rev 394 - piatti/org/piuparts.debian.org/htdocs piatti/org/piuparts.debian.org/htdocs/images trunk trunk/debian trunk/piupartslib

Holger Levsen holger at alioth.debian.org
Thu May 7 13:31:16 UTC 2009


Author: holger
Date: 2009-05-07 13:31:16 +0000 (Thu, 07 May 2009)
New Revision: 394

Added:
   piatti/org/piuparts.debian.org/htdocs/images/sunny.png
   piatti/org/piuparts.debian.org/htdocs/images/weather-severe-alert.png
Modified:
   piatti/org/piuparts.debian.org/htdocs/style.css
   trunk/TODO
   trunk/debian/changelog
   trunk/piuparts-report.py
   trunk/piupartslib/packagesdb.py
Log:
  - improve and fix source status overview calculation
  - use icons to provide a quick overview of a source packages status. 
    (Thanks to tango.freedesktop.org for the icons!)
  - mark bugged logs in package overview
  - fix "dependency unknown package is unknown-package" in state pages
  - nicer color palette in generated graphs



Added: piatti/org/piuparts.debian.org/htdocs/images/sunny.png
===================================================================
(Binary files differ)


Property changes on: piatti/org/piuparts.debian.org/htdocs/images/sunny.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: piatti/org/piuparts.debian.org/htdocs/images/weather-severe-alert.png
===================================================================
(Binary files differ)


Property changes on: piatti/org/piuparts.debian.org/htdocs/images/weather-severe-alert.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: piatti/org/piuparts.debian.org/htdocs/style.css
===================================================================
--- piatti/org/piuparts.debian.org/htdocs/style.css	2009-05-05 19:07:24 UTC (rev 393)
+++ piatti/org/piuparts.debian.org/htdocs/style.css	2009-05-07 13:31:16 UTC (rev 394)
@@ -270,7 +270,7 @@
 }
 td.lightbluelabelcell {
     color: white;
-    background-color: #a0a0ff;
+    background-color: #90c0ff;
     vertical-align: top;
     text-align: left;
     padding: 0.2em 0.3em 0.2em 0.3em;

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2009-05-05 19:07:24 UTC (rev 393)
+++ trunk/TODO	2009-05-07 13:31:16 UTC (rev 394)
@@ -8,10 +8,7 @@
   - esp. these new maintainer packages...
  - maintainer-pages: 
   - assemble maintainer pages differently, to be able to sort them alphabetically + by section
-  - http://piuparts.debian.org/source/a/awesome.html should display bugged logs
   - split per section, do the same for source package, provide link to page in other section if existant
- - http://piuparts.debian.org/sid/state-dependency-does-not-exist.html:
-   "dependency unknown package is unknown-package"
  - sources.txt should not be calculated where it currently is (or maybe yes..)
  - packages.txt for binary packages
  - get rid of old log pages and put stats in the index page
@@ -92,6 +89,10 @@
 
 - publish FAI classes to setup piuparts.$fqdn automatically 
 
+- probably move svn/piatti to trunk/examples/piatti and include it into a new
+  binary package. when doing so keep in mind the two tango icons and credit 
+  those in debian/copyright.
+
 - a redirect of http://piuparts.d.o/foo to http://p.d.o/source/f/foo.html would be nice
 
 - release 0.37 before debconf9
@@ -119,7 +120,7 @@
 
 - piuparts can't currently test postfix, since installing postfix removes
   exim and removing postfix would require re-installing exim, and that
-  doesn't happen; there's other packages like that, too
+  doesn't happen; there are other packages like that, ie. debconf-english
 
 - mounting /proc and perhaps others (usbfs, sysfs, /dev/pts, etc.) in
   the chroot might be a good idea because some packages might need this.
@@ -131,6 +132,13 @@
   testing. PackagesDB.get_source_package() gives back the right value, but 
   piuparts-reports does not care.
 
+- from the FAQ: Just by looking at the Packages and Sources files it's 
+  impossible to distinguish unknown packages (because they haven't build yet
+  are only available on certains archs) and udebs, so that's why the state is
+  so ambiguous. Future versions of piuparts-report are supposed to alse parse 
+  the Packages files in the debian-installer directories, making it possible
+  to properly detect udebs.
+
 Low priority stuff (a.k.a. "nobody's said they must have it now")
 -----------------------------------------------------------------
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-05-05 19:07:24 UTC (rev 393)
+++ trunk/debian/changelog	2009-05-07 13:31:16 UTC (rev 394)
@@ -54,10 +54,13 @@
     - provide links to source packages pages from state pages and back, as well
       as links to the dependencies state.
     - draw graphs of package states over time (if pypthon-rpy and gs are 
-      installed).
+      installed) - thanks to Thomas Viehmann and Dirk Eddelbüttel for
+      inspiration and support.
     - create maintainer centric pages for each email address found in 
       Maintainers or Uploaders
     - improve layout, generate navigation for all pages.
+    - use icons to provide a quick overview of a source packages status. 
+      (Thanks to tango.freedesktop.org for the icons!)
   * Break backwards compatibility of the configuration files for master-slave-
     mode. Merge those three into one: /etc/piuparts/piuparts/piuparts.conf.
     Introduce a new global section in piuparts.conf which is shared among the

Modified: trunk/piuparts-report.py
===================================================================
--- trunk/piuparts-report.py	2009-05-05 19:07:24 UTC (rev 393)
+++ trunk/piuparts-report.py	2009-05-07 13:31:16 UTC (rev 394)
@@ -120,20 +120,20 @@
       Available reports
      </td>
     </tr>
-    $section_navigation
     <tr>
      <td class="contentcell">
-      <a href="/source/">by source package</a> 
+      <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=piuparts;users=debian-qa@lists.debian.org&archive=both" target="_blank">Bugs filed</a> 
      </td>
     </tr>     
+    $section_navigation
     <tr>
      <td class="contentcell">
-      <a href="/maintainer/">by maintainer / uploader</a> 
+      <a href="/source/">by source package</a> 
      </td>
     </tr>     
     <tr>
      <td class="contentcell">
-      <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=piuparts;users=debian-qa@lists.debian.org&archive=both" target="_blank">Bugs filed</a> 
+      <a href="/maintainer/">by maintainer / uploader</a> 
      </td>
     </tr>     
     <tr class="titlerow">
@@ -186,7 +186,9 @@
   <div>
    piuparts was written by <a href="mailto:liw at iki.fi">Lars Wirzenius</a> and is now maintained by 
    <a href="mailto:holger at debian.org">Holger Levsen</a>,  
-   <a href="mailto:luk at debian.org">Luk Claes</a> and <a href="http://qa.debian.org/" target="_blank">others</a>. GPL2 licenced.
+   <a href="mailto:luk at debian.org">Luk Claes</a> and <a href="http://qa.debian.org/" target="_blank">others</a>. 
+   GPL2 <a href="http://packages.debian.org/changelogs/pool/main/p/piuparts/current/copyright" target="_blank">licenced</a>.
+   Weather icons are from the <a href="http://tango.freedesktop.org/Tango_Icon_Library" target="_blank">Tango Icon Library</a>.
    <a href="http://validator.w3.org/check?uri=referer">
     <img border="0" src="/images/valid-html401.png" alt="Valid HTML 4.01!" height="15" width="80" valign="middle">
    </a>
@@ -440,7 +442,7 @@
 
 
 def emphasize_reason(str):
-    if str == "unknown-package" or str == "failed-testing" or str == "circular-dependency" or str == "dependency-failed-testing":
+    if str == "unknown" or str == "failed-testing" or str == "circular-dependency" or str == "dependency-failed-testing" or str == "dependency-does-not-exist" or "cannot-be-tested" in str:
       str = "<em>" + str + "</em>"
     return str
 
@@ -451,18 +453,28 @@
     else:
       return source[:1]
 
+
 def maintainer_subdir(maintainer):
     return maintainer.lower()[:1]
 
+
 def find_files_with_suffix(dir,suffix):
-    name=[name for name in os.listdir(dir) if name.endswith(suffix)]
+    files=[name for name in os.listdir(dir) if name.endswith(suffix)]
     subdirs=os.listdir(dir)
     for subdir in subdirs:
       if os.path.isdir(os.path.join(dir,subdir)):
-        name+=[name for name in os.listdir(os.path.join(dir,subdir)) if name.endswith(suffix)]
-    return name
+        for name_in_subdir in os.listdir(os.path.join(dir,subdir)):
+          if name_in_subdir.endswith(suffix):
+            files += [os.path.join(dir,subdir, name_in_subdir)]
+    # sort by age
+    content = {}
+    for file in files:
+      content[file] = os.path.getmtime(os.path.join(dir,file))
+    # Sort keys, based on time stamps
+    files = content.keys()
+    files.sort(lambda x,y: cmp(content[x],content[y]))
+    return files
 
-
 def update_file(source, target):
     if os.path.exists(target):
         aa = os.stat(source)
@@ -668,7 +680,6 @@
             if basename.startswith(package_name+"_") and basename.endswith(".log"):
               package, version = basename[:-len(".log")].split("_")
               links.append("<a href=\"/%s\">%s</a>" % (os.path.join(self._config.section, dir, basename),html_protect(version)))
-        links.sort()
         return links
 
     def link_to_source_summary(self, package_name):
@@ -680,15 +691,16 @@
 
     def link_to_state_page(self, section, package_name, link_target):
         state = self._binary_db.state_by_name(package_name)
-        if state != "unknown-package":
+        if state != "unknown":
             link = "<a href=\"/%s/%s\">%s</a>" % (
                 section,
                 "state-"+state+".html"+"#"+package_name,
                 link_target)
-        elif "-udeb" == package_name[len(package_name)-5:]:
-          link = "udeb-cannot-be-tested"
         else:
-          link = html_protect("unknown package")
+          if link_target == package_name:
+            link = html_protect(package_name)
+          else:
+            link = "unknown-package-or-udeb"
 
         return link
 
@@ -705,8 +717,9 @@
           links = self.find_links_to_logs (package_name, dirs, logs_by_dir)
           link = ", ".join(links)
 
+        # FIXME: css belongs into style.css
         if "/bugged/" in link:
-          link += " - <a href=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?package="+package_name+"\" target=\"_blank\">bug filed</a>"
+          link += " - <a href=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?package="+package_name+"\" target=\"_blank\" style=\"background-color:#e0c0d0;\">&nbsp;bug filed&nbsp;</a>"
 
         return link
 
@@ -772,14 +785,14 @@
               else:
                 state_style="labelcell"
               binaryrows += "<tr class=\"normalrow\"><td class=\"labelcell\">Binary:</td><td class=\"contentcell2\">%s</td><td class=\"%s\">piuparts-result:</td><td class=\"contentcell2\">%s %s</td><td class=\"labelcell\">Version:</td><td class=\"contentcell2\">%s</td></tr>" %  (binary, state_style, self.link_to_state_page(self._config.section,binary,state), self.links_to_logs(binary, state, logs_by_dir), html_protect(current_version))
-              if state != "successfully-tested":
+              if state not in ("successfully-tested", "essential-required"):
                 success = False
-              if state == "failed-testing":
+              if state == "failed-testing" or state == "dependency-does-not-exist" or state == "cannot-be-tested":
                 failed = True
 
             source_state="unknown"
-            if success: source_state="success"
-            if failed:  source_state="failed"
+            if success: source_state="<img src=\"/images/sunny.png\">"
+            if failed:  source_state="<img src=\"/images/weather-severe-alert.png\">"
             sources += "%s: %s\n" % (source, source_state)
 
             sourcerows = "<tr class=\"titlerow\"><td class=\"titlecell\" colspan=\"6\">%s in %s</td></tr>" % (source, self._config.section)
@@ -856,7 +869,8 @@
           r('t <- (read.table("'+countsfile+'",sep=",",header=1,row.names=1))')
           r('cname <- c("date",rep(colnames(t)))')
           r('v <- t[(nrow(t)-28):nrow(t),0:12]')
-          r('palette(c("green4", "red", "green", "brown", "black", "skyblue4", "yellow", "darkred", "salmon", "purple", "lightgreen",  "blue","darkgray"))')
+          # thanks to http://tango.freedesktop.org/Generic_Icon_Theme_Guidelines for those nice colors
+          r('palette(c("#4e9a06", "#ef2929", "#73d216", "#d3d7cf", "#5c3566", "#c4a000", "#fce94f", "#a40000", "#555753", "#2e3436", "#8ae234",  "#729fcf","#204a87"))')
           r('bitmap(file="'+pngfile+'",type="png16m",width=12,height=9,pointsize=10,res=100)')
           r('barplot(t(v),col = 1:13, main="Packages per state in '+self._config.section+' (past 4 weeks)", xlab="", ylab="Number of packages",space=0.1,border=0)')
           r('legend(x="bottom",legend=colnames(t), ncol=2,fill=1:13,xjust=0.5,yjust=0,bty="n")')
@@ -905,21 +919,19 @@
     def generate_output(self, master_directory, output_directory, section_names):
         self._section_names = section_names
         self._master_directory = os.path.abspath(os.path.join(master_directory, self._config.section))
-        if os.path.exists(self._master_directory):
+        if not os.path.exists(self._master_directory):
+            logging.debug("Warning: %s does not exist. Did you ever let the slave work?" % (self._master_directory, self._config.section))
+            os.mkdir(self._master_directory)
 
-            self._output_directory = os.path.abspath(os.path.join(output_directory, self._config.section))
-            if not os.path.exists(self._output_directory):
-                os.mkdir(self._output_directory)
+        self._output_directory = os.path.abspath(os.path.join(output_directory, self._config.section))
+        if not os.path.exists(self._output_directory):
+            os.mkdir(self._output_directory)
 
-            oldcwd = os.getcwd()
-            os.chdir(self._master_directory)
+        oldcwd = os.getcwd()
+        os.chdir(self._master_directory)
+        self.generate_html()
+        os.chdir(oldcwd)
 
-            self.generate_html()
-
-            os.chdir(oldcwd)
-        else:
-            logging.debug("Warning: %s does not exist. Did you ever let the slave work on %s?" % self._master_directory, self._config.section)
-
 def main():
     setup_logging(logging.DEBUG, None)
 
@@ -933,22 +945,31 @@
         global_config = Config(section="global")
         global_config.read(CONFIG_FILE)
         section_names = global_config["sections"].split()
+        master_directory = global_config["master-directory"]
+        output_directory = global_config["output-directory"]
 
-    sections = []
-    for section_name in section_names:
-        section = Section(section_name)
-        section.generate_output(master_directory=global_config["master-directory"],output_directory=global_config["output-directory"],section_names=section_names)
-        sections.append(section)
 
-    assemble_source_pages(os.path.join(global_config["output-directory"],"source"),section_names)
-    assemble_maintainer_pages(os.path.join(global_config["output-directory"],"maintainer"),section_names)
+    if os.path.exists(master_directory):
+        sections = []
+        for section_name in section_names:
+            section = Section(section_name)
+            section.generate_output(master_directory=master_directory,output_directory=output_directory,section_names=section_names)
+            sections.append(section)
 
-    logging.debug("Writing index page")
-    htmlpage = string.Template(HTML_HEADER + INDEX_BODY_TEMPLATE + HTML_FOOTER)
-    write_file(os.path.join(global_config["output-directory"],"index.html"), htmlpage.safe_substitute( {
+        # FIXME
+        assemble_source_pages(os.path.join(output_directory,"source"),section_names)
+        assemble_maintainer_pages(os.path.join(output_directory,"maintainer"),section_names)
+
+        logging.debug("Writing index page")
+        htmlpage = string.Template(HTML_HEADER + INDEX_BODY_TEMPLATE + HTML_FOOTER)
+        write_file(os.path.join(output_directory,"index.html"), htmlpage.safe_substitute( {
                                  "section_navigation": create_section_navigation(section_names),
                                  "time": time.strftime("%Y-%m-%d %H:%M %Z"),
                               }))
+    else:
+        logging.debug("Warning: %s does not exist!?! Creating it for you now." % master_directory)
+        os.mkdir(master_directory)
 
+
 if __name__ == "__main__":
     main()

Modified: trunk/piupartslib/packagesdb.py
===================================================================
--- trunk/piupartslib/packagesdb.py	2009-05-05 19:07:24 UTC (rev 393)
+++ trunk/piupartslib/packagesdb.py	2009-05-07 13:31:16 UTC (rev 394)
@@ -442,7 +442,7 @@
         if package_name in self._package_state:
             return self._package_state[package_name]
         else:
-            return "unknown-package"
+            return "unknown"
 
     def _find_packages_ready_for_testing(self):
         return self.get_packages_in_state("waiting-to-be-tested")




More information about the Piuparts-commits mailing list