changeset 1133:36ec30d286ea

Cleaned up CHANGES/TODO Added try/finally to enforce db.close() Changed default classic issue item display to only show message summary
author Richard Jones <richard@users.sourceforge.net>
date Fri, 13 Sep 2002 00:08:44 +0000
parents 77581d5309f2
children 16874c9b86ad
files CHANGES.txt TODO.txt doc/customizing.txt roundup/admin.py roundup/cgi/client.py roundup/cgi/templating.py roundup/scripts/roundup_mailgw.py roundup/templates/classic/html/issue.item roundup/templates/classic/html/keyword.item roundup/templates/classic/html/msg.item roundup/templates/classic/html/style.css
diffstat 11 files changed, 184 insertions(+), 124 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Thu Sep 12 07:41:22 2002 +0000
+++ b/CHANGES.txt	Fri Sep 13 00:08:44 2002 +0000
@@ -1,7 +1,14 @@
 This file contains the changes to the Roundup system over time. The entries
 are given with the most recent entry first.
 
-2002-??-?? 0.5.0
+2002-09-?? 0.5.0 beta2
+Fixed:
+ . all backends now have a .close() method, and it's used everywhere
+ . fixed bug in detectors __init__
+ . switched the default issue item display to only show issue summary
+   (add instructions to doc to make it display entire content)
+
+2002-09-11 0.5.0 beta1
 Fixed:
  . #576086 ] dumb copying mistake (frontends/ZRoundup.py)
  . installation instructions now mention "python2" in "testing your python".
@@ -11,9 +18,37 @@
  . fixed the date module so that Date(". - 2d") works
  . web forms may now unset Link values (like assignedto)
  . cleanup: moved roundup.templatebuilder to roundup.templates.builder
+ . instance __init__ no longer silently traps dbinit import errors
 
 Feature:
-TODO: roll stuff in from the TODO to here
+ . new backend for metakit (thanks Gordon McMillan)
+ . new backend for gadfly (it's as done as it's going to get)
+ . further split the dbm backends from the core code, allowing easier
+   non-dict-like backends (eg metakit, RDB)
+ . implemented and used the new access control mechanisms (Permissions, Roles)
+   (see doc/security.txt)
+ . switched templating to use Zope's PageTemplates (yay!)
+ . switched to sessions for web authentication
+ . added Boolean and Number types
+ . fixed the journal bloat
+ . updated design document for new access controls
+ . updated customisation document, including more examples
+ . entire database export and import (incl files)
+ . better mailgw help message (feature request #558562)
+ . re-enabled link backrefs from messages (feature request #568714)
+ . the page layout is now templatable
+ . re-worked cgi interface to abstract out the explicit "issue" interface
+ . have index page handle mid-page errors better so header and footer are
+   still visible
+ . we handle "not found", access and item page render errors better
+ . fixed double-submit by having new-item-submit redirect at end
+ . daemonify roundup-server (fork, logfile, pidfile)
+ . modify cgitb to display PageTemplate errors better
+ . rename to "instance" to "tracker"
+ . have roundup.cgi pick up tracker config from the environment 
+ . revamped look and feel in web interface
+ . cleaned up stylesheet usage
+ . several bug fixes and documentation fixes
  . added is_retired test to hyperdb.Class
  . added capability to save queries:
    - a query Class with name, klass (to search) and url (query string)
@@ -48,10 +83,8 @@
      index
  . added email display function - mangles email addrs so they're not so easily
    scraped from the web
- . added sorting of checklist HTML display
  . switched to using a session-based web login
  . made mailgw handle set and modify operations on multilinks (bug #579094)
- . all storage-specific code (ie. backend) is now implemented by the backends
  . fixed the journal bloat from multilink changes - we just log the add or
    remove operations, not the whole list
 
--- a/TODO.txt	Thu Sep 12 07:41:22 2002 +0000
+++ b/TODO.txt	Fri Sep 13 00:08:44 2002 +0000
@@ -1,6 +1,7 @@
 General Roundup project TODO list. Note that some of these are semi-formed
 ideas. Those ideas that don't make the cutoff for the next major release are
-punted automatically into the subsequent major release TODO.
+punted automatically into the subsequent major release TODO. When stuff is
+done, it's moved to the CHANGES file.
 
 ======= ========= ============================================================
 State   Component Description
@@ -16,77 +17,47 @@
 pending hyperdb   make creator, creation and activity available pre-commit
 pending hyperdb   migrate "id" property to be Number type
 pending instance  split instance.open() into open() and login()
-pending mailgw   allow commands (feature request #556996)
-                 like "help", "dump issue123" (would send all info about
-                 issue123, including a digest of all messages, but probably
-                 not all files...), "list issue", ...
-pending mailgw   Allow multiple email addresses at one gw with different default
-                 classes and property values (possibly through command-line
-                 args to the mailgw as invoked in the mail delivery "aliases"
-                 file) eg::
+pending mailgw    allow commands (feature request #556996)
+                  like "help", "dump issue123" (would send all info about
+                  issue123, including a digest of all messages, but probably
+                  not all files...), "list issue", ...
+pending mailgw    Allow multiple email addresses at one gw with different
+                  default classes and property values (possibly through
+                  command-line args to the mailgw as invoked in the mail
+                  delivery "aliases" file) eg::
 
                    roundup: "|roundup-mailgw /instances/dev"
                    vmbugs: "|roundup-mailgw /instances/dev component=voicemail"
 
-pending project  switch to a Roundup instance for Roundup bug/feature tracking
-pending project  have the demo allow anonymous login
-pending security an LDAP user database implementation
-pending security authenticate over a secure connection
-pending security optionally auth with Basic HTTP auth instead of cookies
-pending security use digital signatures in mailgw
-pending security submission protection (ok, I've forgotten what this is)
-pending web      I18N
-pending web      Better message summary display (feature request #520244)
-pending web      Navigating around the issues (feature request #559149)
-pending web      Quick help links next to the property labels giving a
-                 description of the property. Combine with help for the actual
-                 form element too, eg. how to use the nosy list edit box.
-pending web      clicking on a group header should filter for that type of entry
-pending web      re-enable auth by basic http auth
-pending web      search "refinement" - pre-fill the search page with the
-                 current search parameters
-pending web      UNIX init.d script for roundup-server
-pending web      rewritten documentation (can come after the beta though so
-                 stuff is settled) ... including relevant file names in
-                 customisation doc
-pending web      allow multilink selections to select a "none" element to allow
-                 people with broken browsers to select nothing?
-pending web      password edit fields should always appear in pairs - for
-                 confirmation
-pending dist     include the HTML in docs
-
-bug     web      request.url is incorrect in cgi-bin environments
+pending project   switch to a Roundup instance for Roundup bug/feature tracking
+pending project   have the demo allow anonymous login
+pending security  an LDAP user database implementation
+pending security  authenticate over a secure connection
+pending security  optionally auth with Basic HTTP auth instead of cookies
+pending security  use digital signatures in mailgw
+pending security  submission protection (ok, I've forgotten what this is)
+pending web       I18N
+pending web       Better message summary display (feature request #520244)
+pending web       Navigating around the issues (feature request #559149)
+pending web       Quick help links next to the property labels giving a
+                  description of the property. Combine with help for the actual
+                  form element too, eg. how to use the nosy list edit box.
+pending web       clicking on a group header should filter for that type of
+                  entry
+pending web       re-enable auth by basic http auth
+pending web       search "refinement" - pre-fill the search page with the
+                  current search parameters
+pending web       UNIX init.d script for roundup-server
+pending web       rewritten documentation (can come after the beta though so
+                  stuff is settled) ... including relevant file names in
+                  customisation doc
+pending web       allow multilink selections to select a "none" element to allow
+                  people with broken browsers to select nothing?
+pending web       password edit fields should always appear in pairs - for
+                  confirmation
+pending web       write a _generic.item
+pending dist      include the HTML in docs
 
-done    instance rename to "instance" to "tracker"
-done    hyperdb  write a backend for gadfly (it's as done as it's going to get)
-done    hyperdb  full-text search also search certain String properties
-done    hyperdb  further split the *dbm backends from the core code, allowing
-                 easier non-dict-like backends (eg metakit, RDB)
-done    hyperdb  fix the journal bloat
-done    hyperdb  add Boolean and Number types (GM)
-done    hyperdb  update design document
-done    hyperdb  entire database export and import (incl files)
-done    mailgw   better help message (feature request #558562)
-done    security add info from doc/security.txt to design doc
-done    security switch to sessions for web authentication
-done    security implement and use the new logical control mechanisms
-done    web      Re-enable link backrefs from messages (feature request #568714)
-done    web      have the page layout (header/footer) be templatable
-done    web      fixing the templating so it works
-done    web      re-work cgi interface to abstract out the explicit "issue"
-                 interface
-done    web      have index page handle mid-page errors better so header and
-                 footer are still visible
-done    web      saving of named queries (GM, mangled by RJ :)
-done    web      handle "not found", access and item page render errors better
-done    web      fix double-submit by having new-item-submit redirect at end
-done    web      daemonify roundup-server (fork, logfile, pidfile)
-done    web      modify cgitb to display PageTemplate errors better
-done    web      have roundup.cgi pick up instance config from the environment 
-done    web      indicate that generated pages shouldn't be cached
-done    admin    have "set" command be applicable to all items in a class, and
-                 also be able to unset properties (ie. set to None)
-
-reject  instance the use of non-Python configuration files (ConfigParser)
+bug     web       request.url is incorrect in cgi-bin environments
 ======= ======== =============================================================
 
--- a/doc/customizing.txt	Thu Sep 12 07:41:22 2002 +0000
+++ b/doc/customizing.txt	Fri Sep 13 00:08:44 2002 +0000
@@ -2,7 +2,7 @@
 Customising Roundup
 ===================
 
-:Version: $Revision: 1.31 $
+:Version: $Revision: 1.32 $
 
 .. This document borrows from the ZopeBook section on ZPT. The original is at:
    http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -1757,6 +1757,28 @@
    which displays only the allowed status to transition to.
 
 
+Displaying entire message contents in the issue display
+-------------------------------------------------------
+
+Alter the issue.item template section for messages to::
+
+ <table class="messages" tal:condition="context/messages">
+  <tr><th colspan=3 class="header">Messages</th></tr>
+  <tal:block tal:repeat="msg context/messages/reverse">
+   <tr>
+    <th><a tal:attributes="href string:msg${msg/id}"
+           tal:content="string:msg${msg/id}"></a></th>
+    <th tal:content="string:Author: ${msg/author}">author</th>
+    <th tal:content="string:Date: ${msg/date}">date</th>
+   </tr>
+   <tr>
+    <td colspan="3" class="content">
+     <pre tal:content="msg/content">content</pre>
+    </td>
+   </tr>
+  </tal:block>
+ </table>
+
 -------------------
 
 Back to `Table of Contents`_
--- a/roundup/admin.py	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/admin.py	Fri Sep 13 00:08:44 2002 +0000
@@ -16,7 +16,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: admin.py,v 1.29 2002-09-11 01:19:45 richard Exp $
+# $Id: admin.py,v 1.30 2002-09-13 00:08:43 richard Exp $
 
 import sys, os, getpass, getopt, re, UserDict, shlex, shutil
 try:
@@ -1152,14 +1152,18 @@
                 self.comma_sep = 1
 
         # if no command - go interactive
+        # wrap in a try/finally so we always close off the db
         ret = 0
-        if not args:
-            self.interactive()
-        else:
-            ret = self.run_command(args)
-            if self.db: self.db.commit()
-        return ret
-
+        try:
+            if not args:
+                self.interactive()
+            else:
+                ret = self.run_command(args)
+                if self.db: self.db.commit()
+            return ret
+        finally:
+            if self.db:
+                self.db.close()
 
 if __name__ == '__main__':
     tool = AdminTool()
--- a/roundup/cgi/client.py	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/cgi/client.py	Fri Sep 13 00:08:44 2002 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.31 2002-09-12 07:00:41 richard Exp $
+# $Id: client.py,v 1.32 2002-09-13 00:08:44 richard Exp $
 
 __doc__ = """
 WWW request handler (also used in the stand-alone server).
@@ -105,6 +105,15 @@
         self.response_code = 200
 
     def main(self):
+        ''' Wrap the real main in a try/finally so we always close off the db.
+        '''
+        try:
+            self.inner_main()
+        finally:
+            if hasattr(self, 'db'):
+                self.db.close()
+
+    def inner_main(self):
         ''' Process a request.
 
             The most common requests are handled like so:
--- a/roundup/cgi/templating.py	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/cgi/templating.py	Fri Sep 13 00:08:44 2002 +0000
@@ -706,8 +706,13 @@
         '''
         if self._value is None: value = ''
         else: value = str(self._value)
-        value = value.replace('@', ' at ')
-        value = value.replace('.', ' ')
+        if value.find('@') != -1:
+            name, domain = value.split('@')
+            domain = ' '.join(domain.split('.')[:-1])
+            name = name.replace('.', ' ')
+            value = '%s at %s ...'%(name, domain)
+        else:
+            value = value.replace('.', ' ')
         if escape:
             value = cgi.escape(value)
         return value
--- a/roundup/scripts/roundup_mailgw.py	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/scripts/roundup_mailgw.py	Fri Sep 13 00:08:44 2002 +0000
@@ -14,7 +14,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: roundup_mailgw.py,v 1.5 2002-09-11 01:19:16 richard Exp $
+# $Id: roundup_mailgw.py,v 1.6 2002-09-13 00:08:44 richard Exp $
 
 # python version check
 from roundup import version_check
@@ -76,27 +76,32 @@
 
     # get a mail handler
     db = instance.open('admin')
-    handler = instance.MailGW(instance, db)
 
-    # if there's no more arguments, read a single message from stdin
-    if len(args) == 2:
-        return handler.do_pipe()
+    # now wrap in try/finally so we always close the database
+    try:
+        handler = instance.MailGW(instance, db)
+
+        # if there's no more arguments, read a single message from stdin
+        if len(args) == 2:
+            return handler.do_pipe()
 
-    # otherwise, figure what sort of mail source to handle
-    if len(args) < 4:
-        return usage(args, _('Error: not enough source specification information'))
-    source, specification = args[2:]
-    if source == 'mailbox':
-        return handler.do_mailbox(specification)
-    elif source == 'pop':
-        m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)',
-            specification)
-        if m:
-            return handler.do_pop(m.group('server'), m.group('user'),
-                m.group('pass'))
-        return usage(args, _('Error: pop specification not valid'))
+        # otherwise, figure what sort of mail source to handle
+        if len(args) < 4:
+            return usage(args, _('Error: not enough source specification information'))
+        source, specification = args[2:]
+        if source == 'mailbox':
+            return handler.do_mailbox(specification)
+        elif source == 'pop':
+            m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)',
+                specification)
+            if m:
+                return handler.do_pop(m.group('server'), m.group('user'),
+                    m.group('pass'))
+            return usage(args, _('Error: pop specification not valid'))
 
-    return usage(args, _('Error: The source must be either "mailbox" or "pop"'))
+        return usage(args, _('Error: The source must be either "mailbox" or "pop"'))
+    finally:
+        db.close()
 
 def run():
     sys.exit(main(sys.argv))
--- a/roundup/templates/classic/html/issue.item	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/templates/classic/html/issue.item	Fri Sep 13 00:08:44 2002 +0000
@@ -70,19 +70,17 @@
 changed <b>${context/activity}</b>.">activity info</span>
 
 <tal:block tal:condition="context/id">
+
  <table class="messages" tal:condition="context/messages">
-  <tr><th colspan=3 class="header">Messages</th></tr>
-  <tal:block tal:repeat="msg context/messages/reverse">
-   <tr>
-    <th><a tal:attributes="href string:msg${msg/id}"
-           tal:content="string:msg${msg/id}"></a></th>
-    <th tal:content="string:Author: ${msg/author}">author</th>
-    <th tal:content="string:Date: ${msg/date}">date</th>
-   </tr>
-   <tr>
-    <td colspan="3"><pre tal:content="msg/content">content</pre></td>
-   </tr>
-  </tal:block>
+  <tr><th colspan=4 class="header">Messages</th></tr>
+  <tr><th>Message</th><th>Author</th><th>Date</th><th>Summary</th></tr>
+  <tr tal:repeat="msg context/messages/reverse">
+   <td><a tal:attributes="href string:msg${msg/id}"
+          tal:content="string:msg${msg/id}"></a></td>
+   <td tal:content="msg/author">author</td>
+   <td tal:content="msg/date">date</td>
+   <td tal:content="msg/summary">summary</td>
+  </tr>
  </table>
 
  <table class="files" tal:condition="context/files">
--- a/roundup/templates/classic/html/keyword.item	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/templates/classic/html/keyword.item	Fri Sep 13 00:08:44 2002 +0000
@@ -1,13 +1,21 @@
 <!-- dollarId: keyword.item,v 1.3 2002/05/22 00:32:34 richard Exp dollar-->
 
-<table class="otherinfo">
+<table class="otherinfo" tal:define="keywords db/keyword/list"
+       tal:condition="keywords">
  <tr><th colspan="4" class="header">Existing Keywords</th></tr>
- <tr tal:define="keywords db/keyword/list"
-     tal:repeat="start python:range(0, len(keywords), 4)">
-  <td tal:define="batch python:utils.Batch(keywords, 4, start)"
-      tal:repeat="keyword batch" tal:content="keyword/name">keyword here</td>
+ <tr tal:repeat="start python:range(0, len(keywords), 4)">
+  <td width="25%" tal:define="batch python:utils.Batch(keywords, 4, start)"
+      tal:repeat="keyword batch">
+    <a tal:attributes="href string:keyword${keyword/id}"
+       tal:content="keyword/name">keyword here</a>
+  </td>
  </tr>
- <tr><td colspan="4" style="border-top: 1px solid gray">&nbsp;</td></tr>
+ <tr>
+  <td colspan="4" style="border-top: 1px solid gray">
+   To edit an existing keyword (for spelling or typing errors),
+   click on its entry above.
+  </td>
+ </tr>
 </table>
 
 <p class="help" tal:condition="not:context/id">
--- a/roundup/templates/classic/html/msg.item	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/templates/classic/html/msg.item	Fri Sep 13 00:08:44 2002 +0000
@@ -20,7 +20,7 @@
 <table class="messages">
  <tr><th colspan=2 class="header">Content</th></tr>
  <tr>
-  <td colspan=2><pre tal:content="context/content"></pre></td>
+  <td class="content" colspan=2><pre tal:content="context/content"></pre></td>
  </tr>
 </table>
 
--- a/roundup/templates/classic/html/style.css	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/templates/classic/html/style.css	Fri Sep 13 00:08:44 2002 +0000
@@ -133,11 +133,11 @@
   vertical-align: top;
 }
 
-table.list td.normal {
+table.list tr.normal td {
   empty-cells: show;
 }
 
-table.list td.alt {
+table.list tr.alt td {
   background-color: #efefef;
   empty-cells: show;
 }
@@ -177,6 +177,11 @@
 }
 
 table.messages td {
+  text-align: left;
+  empty-cells: show;
+}
+
+table.messages td.content {
   font-family: monospace;
   background-color: #efefef;
   border-top: 1px solid #afafaf;

Roundup Issue Tracker: http://roundup-tracker.org/