summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e33199)
raw | patch | inline | side by side (parent: 4e33199)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 21 Oct 2001 07:26:35 +0000 (07:26 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 21 Oct 2001 07:26:35 +0000 (07:26 +0000) |
source so that the filename is used in the link and the creation
information is displayed.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@323 57a73879-2fb5-44c3-a270-3262357dd7e2
information is displayed.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@323 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/cgi_client.py | patch | blob | history | |
roundup/htmltemplate.py | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 23bcb266bbf7a7cbfa014ee24dd2ddc84d3b8724..6215187beed35597ddc0e2df43766ce5b59932e7 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
2001-10-?? - 0.3.0
Feature:
. MailGW now moves 'unread' to 'chatting' on receiving e-mail for an issue.
+ . feature #473127: Filenames. I modified the file.index and htmltemplate
+ source so that the filename is used in the link and the creation
+ information is displayed.
Admin Tool (roundup-admin):
. Interactive mode for running multiple (independant at present) commands.
. Tabular display of nodes.
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index e46098ba0aa2273593bbb56c400825db403dddb4..3f7b4ccc7c0592fd127be12fc644241e50b938f7 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: cgi_client.py,v 1.36 2001-10-21 04:44:50 richard Exp $
+# $Id: cgi_client.py,v 1.37 2001-10-21 07:26:35 richard Exp $
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
import base64, Cookie, time
path = self.split_path
if not path or path[0] in ('', 'index'):
self.index()
- elif len(path) == 1:
- if path[0] == 'list_classes':
- self.classes()
- return
- if path[0] == 'login':
- self.login()
- return
- if path[0] == 'login_action':
- self.login_action()
- return
- if path[0] == 'newuser_action':
- self.newuser_action()
- return
- if path[0] == 'logout':
- self.logout()
- return
- m = dre.match(path[0])
- if m:
- self.classname = m.group(1)
- self.nodeid = m.group(2)
- try:
- cl = self.db.classes[self.classname]
- except KeyError:
- raise NotFound
- try:
- cl.get(self.nodeid, 'id')
- except IndexError:
- raise NotFound
- try:
- func = getattr(self, 'show%s'%self.classname)
- except AttributeError:
- raise NotFound
- func()
- return
- m = nre.match(path[0])
- if m:
- self.classname = m.group(1)
- try:
- func = getattr(self, 'new%s'%self.classname)
- except AttributeError:
- raise NotFound
- func()
- return
- self.classname = path[0]
+ elif not path:
+ raise 'ValueError', 'Path not understood'
+
+ #
+ # Everthing ignores path[1:]
+ #
+ # The file download link generator actually relies on this - it
+ # appends the name of the file to the URL so the download file name
+ # is correct, but doesn't actually use it.
+ action = path[0]
+ if action == 'list_classes':
+ self.classes()
+ return
+ if action == 'login':
+ self.login()
+ return
+ if action == 'login_action':
+ self.login_action()
+ return
+ if action == 'newuser_action':
+ self.newuser_action()
+ return
+ if action == 'logout':
+ self.logout()
+ return
+ m = dre.match(action)
+ if m:
+ self.classname = m.group(1)
+ self.nodeid = m.group(2)
try:
- self.db.getclass(self.classname)
+ cl = self.db.classes[self.classname]
except KeyError:
raise NotFound
- self.list()
- else:
- raise 'ValueError', 'Path not understood'
+ try:
+ cl.get(self.nodeid, 'id')
+ except IndexError:
+ raise NotFound
+ try:
+ func = getattr(self, 'show%s'%self.classname)
+ except AttributeError:
+ raise NotFound
+ func()
+ return
+ m = nre.match(action)
+ if m:
+ self.classname = m.group(1)
+ try:
+ func = getattr(self, 'new%s'%self.classname)
+ except AttributeError:
+ raise NotFound
+ func()
+ return
+ self.classname = action
+ try:
+ self.db.getclass(self.classname)
+ except KeyError:
+ raise NotFound
+ self.list()
def __del__(self):
self.db.close()
#
# $Log: not supported by cvs2svn $
+# Revision 1.36 2001/10/21 04:44:50 richard
+# bug #473124: UI inconsistency with Link fields.
+# This also prompted me to fix a fairly long-standing usability issue -
+# that of being able to turn off certain filters.
+#
# Revision 1.35 2001/10/21 00:17:54 richard
# CGI interface view customisation section may now be hidden (patch from
# Roch'e Compaan.)
index c720bb18f310976a1d915292b5bcdf3b832580a0..8d73e486e872fe544bf42bb8e555b5a188497b19 100644 (file)
--- a/roundup/htmltemplate.py
+++ b/roundup/htmltemplate.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: htmltemplate.py,v 1.30 2001-10-21 04:44:50 richard Exp $
+# $Id: htmltemplate.py,v 1.31 2001-10-21 07:26:35 richard Exp $
import os, re, StringIO, urllib, cgi, errno
#XXX deviates from spec
class Link(Base):
- ''' for a Link or Multilink property, display the names of the linked
- nodes, hyperlinked to the item views on those nodes
- for other properties, link to this node with the property as the text
+ '''For a Link or Multilink property, display the names of the linked
+ nodes, hyperlinked to the item views on those nodes.
+ For other properties, link to this node with the property as the
+ text.
+
+ If is_download is true, append the property value to the generated
+ URL so that the link may be used as a download link and the
+ downloaded file name is correct.
'''
- def __call__(self, property=None, **args):
+ def __call__(self, property=None, is_download=0):
if not self.nodeid and self.form is None:
return '[Link: not called from item]'
propclass = self.properties[property]
linkcl = self.db.classes[linkname]
k = linkcl.labelprop()
linkvalue = linkcl.get(value, k)
- return '<a href="%s%s">%s</a>'%(linkname, value, linkvalue)
+ if is_download:
+ return '<a href="%s%s/%s">%s</a>'%(linkname, value,
+ linkvalue, linkvalue)
+ else:
+ return '<a href="%s%s">%s</a>'%(linkname, value, linkvalue)
if isinstance(propclass, hyperdb.Multilink):
linkname = propclass.classname
linkcl = self.db.classes[linkname]
l = []
for value in value:
linkvalue = linkcl.get(value, k)
- l.append('<a href="%s%s">%s</a>'%(linkname, value, linkvalue))
+ if is_download:
+ l.append('<a href="%s%s/%s">%s</a>'%(linkname, value,
+ linkvalue, linkvalue))
+ else:
+ l.append('<a href="%s%s">%s</a>'%(linkname, value,
+ linkvalue))
return ', '.join(l)
if isinstance(propclass, hyperdb.String):
if value == '': value = '[no %s]'%property.capitalize()
- return '<a href="%s%s">%s</a>'%(self.classname, self.nodeid, value)
+ if is_download:
+ return '<a href="%s%s/%s">%s</a>'%(self.classname, self.nodeid,
+ value, value)
+ else:
+ return '<a href="%s%s">%s</a>'%(self.classname, self.nodeid, value)
class Count(Base):
''' for a Multilink property, display a count of the number of links in
#
# $Log: not supported by cvs2svn $
+# Revision 1.30 2001/10/21 04:44:50 richard
+# bug #473124: UI inconsistency with Link fields.
+# This also prompted me to fix a fairly long-standing usability issue -
+# that of being able to turn off certain filters.
+#
# Revision 1.29 2001/10/21 00:17:56 richard
# CGI interface view customisation section may now be hidden (patch from
# Roch'e Compaan.)
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index d70404c0417b1d3e288ffe06cd2dea2c6d7b7f13..546e74652909ed5efbf72c61932b1084c25d1b6a 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.13 2001-10-21 00:45:15 richard Exp $
+# $Id: roundupdb.py,v 1.14 2001-10-21 07:26:35 richard Exp $
import re, os, smtplib, socket
class Class(hyperdb.Class):
# Overridden methods:
def __init__(self, db, classname, **properties):
+ if (properties.has_key('creation') or properties.has_key('activity')
+ or properties.has_key('creator')):
+ raise ValueError, '"creation", "activity" and "creator" are reserved'
hyperdb.Class.__init__(self, db, classname, **properties)
self.auditors = {'create': [], 'set': [], 'retire': []}
self.reactors = {'create': [], 'set': [], 'retire': []}
properties['nosy'] = hyperdb.Multilink("user")
if not properties.has_key('superseder'):
properties['superseder'] = hyperdb.Multilink(classname)
- if (properties.has_key('creation') or properties.has_key('activity')
- or properties.has_key('creator')):
- raise ValueError, '"creation", "activity" and "creator" are reserved'
Class.__init__(self, db, classname, **properties)
# New methods:
#
# $Log: not supported by cvs2svn $
+# Revision 1.13 2001/10/21 00:45:15 richard
+# Added author identification to e-mail messages from roundup.
+#
# Revision 1.12 2001/10/04 02:16:15 richard
# Forgot to pass the protected flag down *sigh*.
#