Rev 221: RSS feed description now specifies whether PQM is processing. in http://bzr.daniel-watkins.co.uk/pqm/rss

Daniel Watkins daniel at daniel-watkins.co.uk
Mon Jul 14 15:11:38 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/rss

------------------------------------------------------------
revno: 221
revision-id: daniel at daniel-watkins.co.uk-20080714141020-oi3qsf07d0zclchl
parent: daniel at daniel-watkins.co.uk-20080714140016-6uw33kn6e0hudbvj
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: rss
timestamp: Mon 2008-07-14 15:10:20 +0100
message:
  RSS feed description now specifies whether PQM is processing.
-------------- next part --------------
=== modified file 'pqm/ui/template.py'
--- a/pqm/ui/template.py	2008-07-14 14:00:16 +0000
+++ b/pqm/ui/template.py	2008-07-14 14:10:20 +0000
@@ -63,7 +63,7 @@
   <channel>
     <title>Patch Queue Manager Queue</title>
     <link></link>
-    <description></description>
+    <description><tal:block tal:condition="not: processing">PQM is not currently processing additional requests</tal:block></description>
     <item tal:repeat="message messages">
       <tal:block tal:condition="not: message/other">
         <tal:block tal:condition="message/pqm_managed">

=== modified file 'pqm/ui/tests/test_twisted.py'
--- a/pqm/ui/tests/test_twisted.py	2008-07-14 14:00:16 +0000
+++ b/pqm/ui/tests/test_twisted.py	2008-07-14 14:10:20 +0000
@@ -374,3 +374,18 @@
                     '  </channel>\n'
                     '</rss>')
         self.assertDocTest(expected, rss)
+
+    def testNotProcessingQueue(self):
+        queue = self.getResource(empty=True, processing=False)
+        request = DummyRequest(['rss.xml'])
+        result_resource = getChildForRequest(queue, request)
+        rss = self.removeBlankLines(result_resource.render(request))
+        expected = ('<?xml version="1.0" encoding="iso-8859-1"?>\n'
+                    '<rss version="2.0">\n'
+                    '  <channel>\n'
+                    '    <title>Patch Queue Manager Queue</title>\n'
+                    '    <link></link>\n'
+                    '    <description>PQM is not currently processing additional requests</description>\n'
+                    '  </channel>\n'
+                    '</rss>')
+        self.assertDocTest(expected, rss)

=== modified file 'pqm/ui/twistd.py'
--- a/pqm/ui/twistd.py	2008-07-10 15:03:33 +0000
+++ b/pqm/ui/twistd.py	2008-07-14 14:10:20 +0000
@@ -73,6 +73,7 @@
     def getProjectRSS(self, selected_project, request):
         template = compileXMLTemplate(rss_template)
         c = Context()
+        c.addGlobal('processing', self.currentlyProcessing())
         c.addGlobal('messages', [self.getMessageDict(selected_project, m)
                                     for m in self.queue.messages])
         c.addGlobal('status_text', self.queue.status_text)



More information about the bazaar-commits mailing list