Skip to content

Commit f123526

Browse files
author
Richard Jones
committed
Cleaned up CHANGES/TODO
Added try/finally to enforce db.close() Changed default classic issue item display to only show message summary
1 parent cc88603 commit f123526

File tree

11 files changed

+187
-127
lines changed

11 files changed

+187
-127
lines changed

CHANGES.txt

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

4-
2002-??-?? 0.5.0
4+
2002-09-?? 0.5.0 beta2
5+
Fixed:
6+
. all backends now have a .close() method, and it's used everywhere
7+
. fixed bug in detectors __init__
8+
. switched the default issue item display to only show issue summary
9+
(add instructions to doc to make it display entire content)
10+
11+
2002-09-11 0.5.0 beta1
512
Fixed:
613
. #576086 ] dumb copying mistake (frontends/ZRoundup.py)
714
. installation instructions now mention "python2" in "testing your python".
@@ -11,9 +18,37 @@ Fixed:
1118
. fixed the date module so that Date(". - 2d") works
1219
. web forms may now unset Link values (like assignedto)
1320
. cleanup: moved roundup.templatebuilder to roundup.templates.builder
21+
. instance __init__ no longer silently traps dbinit import errors
1422

1523
Feature:
16-
TODO: roll stuff in from the TODO to here
24+
. new backend for metakit (thanks Gordon McMillan)
25+
. new backend for gadfly (it's as done as it's going to get)
26+
. further split the dbm backends from the core code, allowing easier
27+
non-dict-like backends (eg metakit, RDB)
28+
. implemented and used the new access control mechanisms (Permissions, Roles)
29+
(see doc/security.txt)
30+
. switched templating to use Zope's PageTemplates (yay!)
31+
. switched to sessions for web authentication
32+
. added Boolean and Number types
33+
. fixed the journal bloat
34+
. updated design document for new access controls
35+
. updated customisation document, including more examples
36+
. entire database export and import (incl files)
37+
. better mailgw help message (feature request #558562)
38+
. re-enabled link backrefs from messages (feature request #568714)
39+
. the page layout is now templatable
40+
. re-worked cgi interface to abstract out the explicit "issue" interface
41+
. have index page handle mid-page errors better so header and footer are
42+
still visible
43+
. we handle "not found", access and item page render errors better
44+
. fixed double-submit by having new-item-submit redirect at end
45+
. daemonify roundup-server (fork, logfile, pidfile)
46+
. modify cgitb to display PageTemplate errors better
47+
. rename to "instance" to "tracker"
48+
. have roundup.cgi pick up tracker config from the environment
49+
. revamped look and feel in web interface
50+
. cleaned up stylesheet usage
51+
. several bug fixes and documentation fixes
1752
. added is_retired test to hyperdb.Class
1853
. added capability to save queries:
1954
- a query Class with name, klass (to search) and url (query string)
@@ -48,10 +83,8 @@ TODO: roll stuff in from the TODO to here
4883
index
4984
. added email display function - mangles email addrs so they're not so easily
5085
scraped from the web
51-
. added sorting of checklist HTML display
5286
. switched to using a session-based web login
5387
. made mailgw handle set and modify operations on multilinks (bug #579094)
54-
. all storage-specific code (ie. backend) is now implemented by the backends
5588
. fixed the journal bloat from multilink changes - we just log the add or
5689
remove operations, not the whole list
5790

TODO.txt

Lines changed: 39 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
General Roundup project TODO list. Note that some of these are semi-formed
22
ideas. Those ideas that don't make the cutoff for the next major release are
3-
punted automatically into the subsequent major release TODO.
3+
punted automatically into the subsequent major release TODO. When stuff is
4+
done, it's moved to the CHANGES file.
45

56
======= ========= ============================================================
67
State Component Description
@@ -16,77 +17,47 @@ pending hyperdb range searching of values (dates in particular).
1617
pending hyperdb make creator, creation and activity available pre-commit
1718
pending hyperdb migrate "id" property to be Number type
1819
pending instance split instance.open() into open() and login()
19-
pending mailgw allow commands (feature request #556996)
20-
like "help", "dump issue123" (would send all info about
21-
issue123, including a digest of all messages, but probably
22-
not all files...), "list issue", ...
23-
pending mailgw Allow multiple email addresses at one gw with different default
24-
classes and property values (possibly through command-line
25-
args to the mailgw as invoked in the mail delivery "aliases"
26-
file) eg::
20+
pending mailgw allow commands (feature request #556996)
21+
like "help", "dump issue123" (would send all info about
22+
issue123, including a digest of all messages, but probably
23+
not all files...), "list issue", ...
24+
pending mailgw Allow multiple email addresses at one gw with different
25+
default classes and property values (possibly through
26+
command-line args to the mailgw as invoked in the mail
27+
delivery "aliases" file) eg::
2728

2829
roundup: "|roundup-mailgw /instances/dev"
2930
vmbugs: "|roundup-mailgw /instances/dev component=voicemail"
3031

31-
pending project switch to a Roundup instance for Roundup bug/feature tracking
32-
pending project have the demo allow anonymous login
33-
pending security an LDAP user database implementation
34-
pending security authenticate over a secure connection
35-
pending security optionally auth with Basic HTTP auth instead of cookies
36-
pending security use digital signatures in mailgw
37-
pending security submission protection (ok, I've forgotten what this is)
38-
pending web I18N
39-
pending web Better message summary display (feature request #520244)
40-
pending web Navigating around the issues (feature request #559149)
41-
pending web Quick help links next to the property labels giving a
42-
description of the property. Combine with help for the actual
43-
form element too, eg. how to use the nosy list edit box.
44-
pending web clicking on a group header should filter for that type of entry
45-
pending web re-enable auth by basic http auth
46-
pending web search "refinement" - pre-fill the search page with the
47-
current search parameters
48-
pending web UNIX init.d script for roundup-server
49-
pending web rewritten documentation (can come after the beta though so
50-
stuff is settled) ... including relevant file names in
51-
customisation doc
52-
pending web allow multilink selections to select a "none" element to allow
53-
people with broken browsers to select nothing?
54-
pending web password edit fields should always appear in pairs - for
55-
confirmation
56-
pending dist include the HTML in docs
32+
pending project switch to a Roundup instance for Roundup bug/feature tracking
33+
pending project have the demo allow anonymous login
34+
pending security an LDAP user database implementation
35+
pending security authenticate over a secure connection
36+
pending security optionally auth with Basic HTTP auth instead of cookies
37+
pending security use digital signatures in mailgw
38+
pending security submission protection (ok, I've forgotten what this is)
39+
pending web I18N
40+
pending web Better message summary display (feature request #520244)
41+
pending web Navigating around the issues (feature request #559149)
42+
pending web Quick help links next to the property labels giving a
43+
description of the property. Combine with help for the actual
44+
form element too, eg. how to use the nosy list edit box.
45+
pending web clicking on a group header should filter for that type of
46+
entry
47+
pending web re-enable auth by basic http auth
48+
pending web search "refinement" - pre-fill the search page with the
49+
current search parameters
50+
pending web UNIX init.d script for roundup-server
51+
pending web rewritten documentation (can come after the beta though so
52+
stuff is settled) ... including relevant file names in
53+
customisation doc
54+
pending web allow multilink selections to select a "none" element to allow
55+
people with broken browsers to select nothing?
56+
pending web password edit fields should always appear in pairs - for
57+
confirmation
58+
pending web write a _generic.item
59+
pending dist include the HTML in docs
5760

58-
bug web request.url is incorrect in cgi-bin environments
59-
60-
done instance rename to "instance" to "tracker"
61-
done hyperdb write a backend for gadfly (it's as done as it's going to get)
62-
done hyperdb full-text search also search certain String properties
63-
done hyperdb further split the *dbm backends from the core code, allowing
64-
easier non-dict-like backends (eg metakit, RDB)
65-
done hyperdb fix the journal bloat
66-
done hyperdb add Boolean and Number types (GM)
67-
done hyperdb update design document
68-
done hyperdb entire database export and import (incl files)
69-
done mailgw better help message (feature request #558562)
70-
done security add info from doc/security.txt to design doc
71-
done security switch to sessions for web authentication
72-
done security implement and use the new logical control mechanisms
73-
done web Re-enable link backrefs from messages (feature request #568714)
74-
done web have the page layout (header/footer) be templatable
75-
done web fixing the templating so it works
76-
done web re-work cgi interface to abstract out the explicit "issue"
77-
interface
78-
done web have index page handle mid-page errors better so header and
79-
footer are still visible
80-
done web saving of named queries (GM, mangled by RJ :)
81-
done web handle "not found", access and item page render errors better
82-
done web fix double-submit by having new-item-submit redirect at end
83-
done web daemonify roundup-server (fork, logfile, pidfile)
84-
done web modify cgitb to display PageTemplate errors better
85-
done web have roundup.cgi pick up instance config from the environment
86-
done web indicate that generated pages shouldn't be cached
87-
done admin have "set" command be applicable to all items in a class, and
88-
also be able to unset properties (ie. set to None)
89-
90-
reject instance the use of non-Python configuration files (ConfigParser)
61+
bug web request.url is incorrect in cgi-bin environments
9162
======= ======== =============================================================
9263

doc/customizing.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.31 $
5+
:Version: $Revision: 1.32 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -1757,6 +1757,28 @@ to.
17571757
which displays only the allowed status to transition to.
17581758

17591759

1760+
Displaying entire message contents in the issue display
1761+
-------------------------------------------------------
1762+
1763+
Alter the issue.item template section for messages to::
1764+
1765+
<table class="messages" tal:condition="context/messages">
1766+
<tr><th colspan=3 class="header">Messages</th></tr>
1767+
<tal:block tal:repeat="msg context/messages/reverse">
1768+
<tr>
1769+
<th><a tal:attributes="href string:msg${msg/id}"
1770+
tal:content="string:msg${msg/id}"></a></th>
1771+
<th tal:content="string:Author: ${msg/author}">author</th>
1772+
<th tal:content="string:Date: ${msg/date}">date</th>
1773+
</tr>
1774+
<tr>
1775+
<td colspan="3" class="content">
1776+
<pre tal:content="msg/content">content</pre>
1777+
</td>
1778+
</tr>
1779+
</tal:block>
1780+
</table>
1781+
17601782
-------------------
17611783

17621784
Back to `Table of Contents`_

roundup/admin.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.29 2002-09-11 01:19:45 richard Exp $
19+
# $Id: admin.py,v 1.30 2002-09-13 00:08:43 richard Exp $
2020

2121
import sys, os, getpass, getopt, re, UserDict, shlex, shutil
2222
try:
@@ -1152,14 +1152,18 @@ def main(self):
11521152
self.comma_sep = 1
11531153

11541154
# if no command - go interactive
1155+
# wrap in a try/finally so we always close off the db
11551156
ret = 0
1156-
if not args:
1157-
self.interactive()
1158-
else:
1159-
ret = self.run_command(args)
1160-
if self.db: self.db.commit()
1161-
return ret
1162-
1157+
try:
1158+
if not args:
1159+
self.interactive()
1160+
else:
1161+
ret = self.run_command(args)
1162+
if self.db: self.db.commit()
1163+
return ret
1164+
finally:
1165+
if self.db:
1166+
self.db.close()
11631167

11641168
if __name__ == '__main__':
11651169
tool = AdminTool()

roundup/cgi/client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.31 2002-09-12 07:00:41 richard Exp $
1+
# $Id: client.py,v 1.32 2002-09-13 00:08:44 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -105,6 +105,15 @@ def __init__(self, instance, request, env, form=None):
105105
self.response_code = 200
106106

107107
def main(self):
108+
''' Wrap the real main in a try/finally so we always close off the db.
109+
'''
110+
try:
111+
self.inner_main()
112+
finally:
113+
if hasattr(self, 'db'):
114+
self.db.close()
115+
116+
def inner_main(self):
108117
''' Process a request.
109118
110119
The most common requests are handled like so:

roundup/cgi/templating.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,13 @@ def email(self, escape=1):
706706
'''
707707
if self._value is None: value = ''
708708
else: value = str(self._value)
709-
value = value.replace('@', ' at ')
710-
value = value.replace('.', ' ')
709+
if value.find('@') != -1:
710+
name, domain = value.split('@')
711+
domain = ' '.join(domain.split('.')[:-1])
712+
name = name.replace('.', ' ')
713+
value = '%s at %s ...'%(name, domain)
714+
else:
715+
value = value.replace('.', ' ')
711716
if escape:
712717
value = cgi.escape(value)
713718
return value

roundup/scripts/roundup_mailgw.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: roundup_mailgw.py,v 1.5 2002-09-11 01:19:16 richard Exp $
17+
# $Id: roundup_mailgw.py,v 1.6 2002-09-13 00:08:44 richard Exp $
1818

1919
# python version check
2020
from roundup import version_check
@@ -76,27 +76,32 @@ def main(args):
7676

7777
# get a mail handler
7878
db = instance.open('admin')
79-
handler = instance.MailGW(instance, db)
80-
81-
# if there's no more arguments, read a single message from stdin
82-
if len(args) == 2:
83-
return handler.do_pipe()
84-
85-
# otherwise, figure what sort of mail source to handle
86-
if len(args) < 4:
87-
return usage(args, _('Error: not enough source specification information'))
88-
source, specification = args[2:]
89-
if source == 'mailbox':
90-
return handler.do_mailbox(specification)
91-
elif source == 'pop':
92-
m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)',
93-
specification)
94-
if m:
95-
return handler.do_pop(m.group('server'), m.group('user'),
96-
m.group('pass'))
97-
return usage(args, _('Error: pop specification not valid'))
98-
99-
return usage(args, _('Error: The source must be either "mailbox" or "pop"'))
79+
80+
# now wrap in try/finally so we always close the database
81+
try:
82+
handler = instance.MailGW(instance, db)
83+
84+
# if there's no more arguments, read a single message from stdin
85+
if len(args) == 2:
86+
return handler.do_pipe()
87+
88+
# otherwise, figure what sort of mail source to handle
89+
if len(args) < 4:
90+
return usage(args, _('Error: not enough source specification information'))
91+
source, specification = args[2:]
92+
if source == 'mailbox':
93+
return handler.do_mailbox(specification)
94+
elif source == 'pop':
95+
m = re.match(r'((?P<user>[^:]+)(:(?P<pass>.+))?@)?(?P<server>.+)',
96+
specification)
97+
if m:
98+
return handler.do_pop(m.group('server'), m.group('user'),
99+
m.group('pass'))
100+
return usage(args, _('Error: pop specification not valid'))
101+
102+
return usage(args, _('Error: The source must be either "mailbox" or "pop"'))
103+
finally:
104+
db.close()
100105

101106
def run():
102107
sys.exit(main(sys.argv))

roundup/templates/classic/html/issue.item

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,17 @@
7070
changed <b>${context/activity}</b>.">activity info</span>
7171

7272
<tal:block tal:condition="context/id">
73+
7374
<table class="messages" tal:condition="context/messages">
74-
<tr><th colspan=3 class="header">Messages</th></tr>
75-
<tal:block tal:repeat="msg context/messages/reverse">
76-
<tr>
77-
<th><a tal:attributes="href string:msg${msg/id}"
78-
tal:content="string:msg${msg/id}"></a></th>
79-
<th tal:content="string:Author: ${msg/author}">author</th>
80-
<th tal:content="string:Date: ${msg/date}">date</th>
81-
</tr>
82-
<tr>
83-
<td colspan="3"><pre tal:content="msg/content">content</pre></td>
84-
</tr>
85-
</tal:block>
75+
<tr><th colspan=4 class="header">Messages</th></tr>
76+
<tr><th>Message</th><th>Author</th><th>Date</th><th>Summary</th></tr>
77+
<tr tal:repeat="msg context/messages/reverse">
78+
<td><a tal:attributes="href string:msg${msg/id}"
79+
tal:content="string:msg${msg/id}"></a></td>
80+
<td tal:content="msg/author">author</td>
81+
<td tal:content="msg/date">date</td>
82+
<td tal:content="msg/summary">summary</td>
83+
</tr>
8684
</table>
8785

8886
<table class="files" tal:condition="context/files">

0 commit comments

Comments
 (0)