From: richard Date: Wed, 14 Nov 2001 21:35:22 +0000 (+0000) Subject: . users may attach files to issues (and support in ext) through the web now X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c1c4c29d53c8e1eda63cbba420fe13ea334923e5;p=roundup.git . users may attach files to issues (and support in ext) through the web now git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@401 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index 2df05e5..413f268 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,7 @@ Feature: . roundup-admin now accepts abbreviated commands (eg. l = li = lis = list) . roundup-mailgw now supports unix mailbox and POP as sources of mail. . roundup-admin now handles all hyperdb exceptions + . users may attach files to issues (and support in ext) through the web now Fixed: . Fixed a bug in HTMLTemplate changes. diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index 43b648e..e05aa1a 100644 --- a/roundup/cgi_client.py +++ b/roundup/cgi_client.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: cgi_client.py,v 1.55 2001-11-07 02:34:06 jhermann Exp $ +# $Id: cgi_client.py,v 1.56 2001-11-14 21:35:21 richard Exp $ import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes import binascii, Cookie, time @@ -424,6 +424,17 @@ class Client: link = self.db.classes[link] link.set(nodeid, **{property: nid}) + # handle file attachments + files = [] + if self.form.has_key('__file'): + file = self.form['__file'] + type = mimetypes.guess_type(file.filename)[0] + if not type: + type = "application/octet-stream" + # create the new file entry + files.append(self.db.file.create(type=type, name=file.filename, + content=file.file.read())) + # generate an edit message # don't bother if there's no messages or nosy list props = cl.getprops() @@ -481,7 +492,7 @@ class Client: content=content) messages = cl.get(nid, 'messages') messages.append(message_id) - props = {'messages': messages} + props = {'messages': messages, 'files': files} cl.set(nid, **props) def newnode(self, message=None): @@ -955,6 +966,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0): # # $Log: not supported by cvs2svn $ +# Revision 1.55 2001/11/07 02:34:06 jhermann +# Handling of damaged login cookies +# # Revision 1.54 2001/11/07 01:16:12 richard # Remove the '=' padding from cookie value so quoting isn't an issue. # diff --git a/roundup/templatebuilder.py b/roundup/templatebuilder.py index a4c2912..cbbd0bf 100644 --- a/roundup/templatebuilder.py +++ b/roundup/templatebuilder.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: templatebuilder.py,v 1.11 2001-08-07 00:24:42 richard Exp $ +# $Id: templatebuilder.py,v 1.12 2001-11-14 21:35:21 richard Exp $ import errno, re preamble = """ @@ -81,10 +81,13 @@ if __name__ == "__main__": elif len(sys.argv) == 3: installHtmlBase(sys.argv[1], sys.argv[2]) else: - raise "what you talkin about willis?" + print "Usage: %s