[Piuparts-commits] rev 288 - piatti trunk

Holger Levsen holger at alioth.debian.org
Thu Mar 19 15:43:15 UTC 2009


Author: holger
Date: 2009-03-19 15:43:14 +0000 (Thu, 19 Mar 2009)
New Revision: 288

Added:
   trunk/piuparts.conf.sample
Removed:
   trunk/piuparts-master.conf.sample
   trunk/piuparts-report.conf.sample
   trunk/piuparts-slave.conf.sample
Modified:
   piatti/README.txt
   trunk/TODO
   trunk/piuparts-report.py
Log:
fix syntax error by using proper templates

Modified: piatti/README.txt
===================================================================
--- piatti/README.txt	2009-03-19 13:51:23 UTC (rev 287)
+++ piatti/README.txt	2009-03-19 15:43:14 UTC (rev 288)
@@ -4,6 +4,7 @@
 todo
 ----
 - script for starting piuparts-slave in screen and cronjob to send mail with its output
+- cronjob to check number of mounts on /org/piuparts.d.o/tmp/
 - use local mirror
 - there should be a 2nd group of piuparts-people. those who can sudo into piupartsm to process logfiles. maybe make that the qa-group
 

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2009-03-19 13:51:23 UTC (rev 287)
+++ trunk/TODO	2009-03-19 15:43:14 UTC (rev 288)
@@ -39,6 +39,8 @@
 
 - support for extra-packages-url (for volatile, security, etc)
 
+- RSS feeds of logs
+
 - 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

Deleted: trunk/piuparts-master.conf.sample

Deleted: trunk/piuparts-report.conf.sample

Modified: trunk/piuparts-report.py
===================================================================
--- trunk/piuparts-report.py	2009-03-19 13:51:23 UTC (rev 287)
+++ trunk/piuparts-report.py	2009-03-19 15:43:14 UTC (rev 288)
@@ -30,8 +30,8 @@
 import ConfigParser
 import urllib
 import shutil
+import string
 
-
 import piupartslib
 
 
@@ -126,8 +126,8 @@
      </td>
     </tr>
     <tr class="normalrow">
-     <td class="contentcell2">
-      %(time)s
+     <td class="contentcell">
+      $time
      </td>
     </tr>
    </table>
@@ -147,6 +147,7 @@
    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 others. GPL2 licenced.
+   <br>
   </div>
   <div>
    <a href="http://validator.w3.org/check?uri=referer">
@@ -166,23 +167,23 @@
    <table class="righttable">
     <tr class="titlerow">
      <td class="titlecell">
-      %(title)s
+      $title
      </td>
     </tr>
     <tr class="normalrow">
      <td class="contentcell2">
-      %(preface)s
+      $preface
      </td>
     </tr>
     <tr class="normalrow">
      <td class="contentcell2">
-      The list has %(count)d packages, with %(versioncount)s total versions.
+      The list has $count packages, with $versioncount total versions.
      </td>
     </tr>
     <tr class="normalrow">
      <td class="contentcell2">
       <ul>
-       %(loglist)s
+       $loglist
       </ul>
      </td>
     </tr>
@@ -194,13 +195,13 @@
    <table class="righttable">
     <tr class="titlerow">
      <td class="titlecell">
-      Packages in state "%(state)s"
+      Packages in state "$state"
      </td>
     </tr>
     <tr class="normalrow">
      <td class="contentcell2">
       <ul>
-       %(list)s
+       $list
       </ul>
      </td>
     </tr>
@@ -215,7 +216,7 @@
       Statistics of packages per section
      </td>
     </tr>
-    %(tablerows)s
+    $tablerows
     <tr class="titlerow">
      <td class="titlecell" colspan="3">
       URL to packages file(s)
@@ -223,7 +224,7 @@
     </tr>
      <tr class="normalrow">
      <td class="contentcell2" colspan="3">
-      <code>%(packages-url)s</code>
+      <code>$packages-url</code>
      </td>
     </tr>
    </table>
@@ -373,16 +374,16 @@
                                      ", ".join(versions))
         lines.append(line)
 
+    htmlpage = string.Template(HTML_HEADER + LOG_LIST_BODY_TEMPLATE + HTML_FOOTER)
     f = file(filename, "w")
-    f.write(HTML_HEADER % {
+    f.write(htmlpage.safe_substitute( {
                 "time": time.strftime("%Y-%m-%d %H:%M %Z"),
-            } + LOG_LIST_BODY_TEMPLATE % {
                 "title": html_protect(title),
                 "preface": preface,
-                "loglist": "".join(lines),
-                "count": len(logs),
+                "count": len(packages),
                 "versioncount": version_count,
-            } + HTML_FOOTER)
+                "loglist": "".join(lines)
+            }))
     f.close()
 
 
@@ -495,12 +496,12 @@
                               dir_link)
             tablerows += "<tr class=\"normalrow\"> <td class=\"labelcell\">Total</td> <td class=\"labelcell\" colspan=\"2\">%d</td></tr>\n" % \
                          st.get_total_packages()
-            write_file(os.path.join(self._output_directory, "index.html"), HTML_HEADER % {
-                                                                        "time": time.strftime("%Y-%m-%d %H:%M %Z"),
-                                                                    } + SECTION_STATS_BODY_TEMPLATE % {
-                                                                        "packages-url": html_protect(self._config["packages-url"]), 
-                                                                        "tablerows": tablerows,
-                                                                    } + HTML_FOOTER)
+            htmlpage = string.Template(HTML_HEADER + SECTION_STATS_BODY_TEMPLATE + HTML_FOOTER)
+            write_file(os.path.join(self._output_directory, "index.html"), htmlpage.safe_substitute( {
+                "time": time.strftime("%Y-%m-%d %H:%M %Z"),
+                "tablerows": tablerows,
+                "packages-url": html_protect(self._config["packages-url"]), 
+               }))
 
             for state in st.get_states():
                 logging.debug("Writing page for %s" % state)
@@ -517,14 +518,14 @@
                         list += "</ul>\n"
                     list += "</li>\n"
                 list += "</ul>\n"
-                write_file(os.path.join(self._output_directory, "state-%s.html" % state), HTML_HEADER % { 
-                                         "time": time.strftime("%Y-%m-%d %H:%M %Z"),
-                                        } + STATE_BODY_TEMPLATE % {
-                                         "state": html_protect(state),
-                                         "list": list
-                                        } + HTML_FOOTER)
+                htmlpage = string.Template(HTML_HEADER + STATE_BODY_TEMPLATE + HTML_FOOTER)
+                write_file(os.path.join(self._output_directory, "state-%s.html" % state), htmlpage.safe_substitute( {
+                                            "time": time.strftime("%Y-%m-%d %H:%M %Z"),
+                                            "state": html_protect(state),
+                                            "list": list
+                                           }))
 
-                os.chdir(oldcwd)
+            os.chdir(oldcwd)
 
 
 def main():
@@ -549,9 +550,10 @@
         sections.append(section)
 
     logging.debug("Writing index page")
-    write_file(report_config["index-page"], HTML_HEADER % {
-                                                          "time": time.strftime("%Y-%m-%d %H:%M %Z"),
-                                                         } + INDEX_BODY_TEMPLATE + HTML_FOOTER)
+    htmlpage = string.SafeTemplate(HTML_HEADER + INDEX_BODY_TEMPLATE + HTML_FOOTER)
+    write_file(report_config["index-page"], htmlpage.safe_substitute( {
+                                 "time": time.strftime("%Y-%m-%d %H:%M %Z"),
+                              }))
 
 if __name__ == "__main__":
     main()

Deleted: trunk/piuparts-slave.conf.sample

Copied: trunk/piuparts.conf.sample (from rev 252, trunk/piuparts-slave.conf.sample)
===================================================================
--- trunk/piuparts.conf.sample	                        (rev 0)
+++ trunk/piuparts.conf.sample	2009-03-19 15:43:14 UTC (rev 288)
@@ -0,0 +1,75 @@
+#
+# This is the configuration file for piuparts running in master-slave mode
+#
+# The sample file does not set all required values, to prevent the
+# master from being run accidentally.
+# 
+# You MUST make sure that the packages url is set correctly. The sample
+# file does not set it at all, to prevent the master from being run
+# accidentally.
+#
+#
+
+[slave]
+sections = sid
+
+[sid]
+sections = sid
+log-file = slave.log
+idle-sleep = 300
+# master-host = localhost
+# master-user = piuparts
+# master-directory = .
+master-command = python /usr/share/piuparts/piuparts-master.py
+# mirror = http://your.mirror.here/debian
+piuparts-cmd = sudo piuparts
+distro = sid
+chroot-tgz = sid.tar.gz
+upgrade-test-distros = 
+upgrade-test-chroot-tgz = 
+max-reserved = 50
+debug = no
+
+[master]
+log-file = /dev/null
+# packages-url = http://your.mirror.here/debian/dists/sid/main/binary-i386/Packages.bz2
+
+# report
+[sid]
+output-directory = html
+
+[report]
+sections = sid
+index-page = ./index.html
+
+
+# You can have multiple sections, so that you can run piuparts for multiple dists
+
+# For stable-proposed-updates, you'll have to roll your own chroot, or modify
+# the sources.list in a generated chroot for stable, in order to include the
+# appropriate deb line for stable-proposed-updates
+## [s-p-u-i386]
+## idle-sleep = 300
+## # master-host = localhost
+## # master-user = piuparts
+## # master-directory = .
+## master-command = python /usr/share/piuparts/piuparts-master.py s-p-u-i386
+## # mirror = http://your.mirror.here/debian
+## piuparts-cmd = sudo piuparts
+## distro = stable-proposed-updates
+## chroot-tgz = s-p-u.tar.gz
+## keep-sources-list = yes
+## upgrade-test-distros =
+## upgrade-test-chroot-tgz =
+## max-reserved = 50
+## debug = no
+
+## [sid-ia64]
+## log-file = /dev/null
+## packages-url = http://ftp.debian.org/debian/dists/sid/binary-ia64/Packages.bz2
+
+## [s-p-u-i386]
+## log-file = /dev/null
+## packages-url = http://ftp.debian.org/debian/dists/stable-proposed-updates/binary-i386/Packages.bz2
+
+


Property changes on: trunk/piuparts.conf.sample
___________________________________________________________________
Name: svn:mergeinfo
   + 




More information about the Piuparts-commits mailing list