Skip to content

Commit 6d6e710

Browse files
author
Richard Jones
committed
users may attach files to issues (and support in ext) through the web now
1 parent 4f83e61 commit 6d6e710

File tree

8 files changed

+54
-6
lines changed

8 files changed

+54
-6
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Feature:
1212
. roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
1313
. roundup-mailgw now supports unix mailbox and POP as sources of mail.
1414
. roundup-admin now handles all hyperdb exceptions
15+
. users may attach files to issues (and support in ext) through the web now
1516

1617
Fixed:
1718
. Fixed a bug in HTMLTemplate changes.

roundup/cgi_client.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.55 2001-11-07 02:34:06 jhermann Exp $
18+
# $Id: cgi_client.py,v 1.56 2001-11-14 21:35:21 richard Exp $
1919

2020
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
2121
import binascii, Cookie, time
@@ -424,6 +424,17 @@ def _post_editnode(self, nid, changes=None):
424424
link = self.db.classes[link]
425425
link.set(nodeid, **{property: nid})
426426

427+
# handle file attachments
428+
files = []
429+
if self.form.has_key('__file'):
430+
file = self.form['__file']
431+
type = mimetypes.guess_type(file.filename)[0]
432+
if not type:
433+
type = "application/octet-stream"
434+
# create the new file entry
435+
files.append(self.db.file.create(type=type, name=file.filename,
436+
content=file.file.read()))
437+
427438
# generate an edit message
428439
# don't bother if there's no messages or nosy list
429440
props = cl.getprops()
@@ -481,7 +492,7 @@ def _post_editnode(self, nid, changes=None):
481492
content=content)
482493
messages = cl.get(nid, 'messages')
483494
messages.append(message_id)
484-
props = {'messages': messages}
495+
props = {'messages': messages, 'files': files}
485496
cl.set(nid, **props)
486497

487498
def newnode(self, message=None):
@@ -955,6 +966,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
955966

956967
#
957968
# $Log: not supported by cvs2svn $
969+
# Revision 1.55 2001/11/07 02:34:06 jhermann
970+
# Handling of damaged login cookies
971+
#
958972
# Revision 1.54 2001/11/07 01:16:12 richard
959973
# Remove the '=' padding from cookie value so quoting isn't an issue.
960974
#

roundup/templatebuilder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: templatebuilder.py,v 1.11 2001-08-07 00:24:42 richard Exp $
18+
# $Id: templatebuilder.py,v 1.12 2001-11-14 21:35:21 richard Exp $
1919
import errno, re
2020

2121
preamble = """
@@ -81,10 +81,13 @@ def installHtmlBase(template, installDir):
8181
elif len(sys.argv) == 3:
8282
installHtmlBase(sys.argv[1], sys.argv[2])
8383
else:
84-
raise "what you talkin about willis?"
84+
print "Usage: %s <template directory>"%sys.argv[0]
8585

8686
#
8787
# $Log: not supported by cvs2svn $
88+
# Revision 1.11 2001/08/07 00:24:42 richard
89+
# stupid typo
90+
#
8891
# Revision 1.10 2001/08/07 00:15:51 richard
8992
# Added the copyright/license notice to (nearly) all files at request of
9093
# Bizar Software.

roundup/templates/classic/html/issue.item

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
<td colspan=3 class="form-text"><display call="note()"></td>
4141
</tr>
4242

43+
<tr bgcolor="ffffea">
44+
<td width=1% nowrap align=right><span class="form-label">File</span></td>
45+
<td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
46+
</tr>
47+
4348
<tr bgcolor="ffffea">
4449
<td>&nbsp;</td>
4550
<td colspan=3 class="form-text"><display call="submit()"></td>

roundup/templates/classic/htmlbase.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@
119119
<td colspan=3 class="form-text"><display call="note()"></td>
120120
</tr>
121121
122+
<tr bgcolor="ffffea">
123+
<td width=1% nowrap align=right><span class="form-label">File</span></td>
124+
<td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
125+
</tr>
126+
122127
<tr bgcolor="ffffea">
123128
<td>&nbsp;</td>
124129
<td colspan=3 class="form-text"><display call="submit()"></td>

roundup/templates/extended/html/issue.item

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Id: issue.item,v 1.5 2001-07-30 08:03:56 richard Exp $-->
1+
<!-- $Id: issue.item,v 1.6 2001-11-14 21:35:22 richard Exp $-->
22
<table border=0 cellspacing=0 cellpadding=2>
33

44
<tr class="strong-header">
@@ -52,6 +52,11 @@
5252
<td colspan=3 class="form-text"><display call="note()"></td>
5353
</tr>
5454

55+
<tr bgcolor="ffffea">
56+
<td width=1% nowrap align=right><span class="form-label">File</span></td>
57+
<td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
58+
</tr>
59+
5560
<tr bgcolor="ffffea">
5661
<td>&nbsp;</td>
5762
<td colspan=3 class="form-text"><display call="submit()"></td>

roundup/templates/extended/html/support.item

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Id: support.item,v 1.2 2001-07-30 08:03:56 richard Exp $-->
1+
<!-- $Id: support.item,v 1.3 2001-11-14 21:35:22 richard Exp $-->
22
<table border=0 cellspacing=0 cellpadding=2>
33

44
<tr class="strong-header">
@@ -59,6 +59,11 @@
5959
<td colspan=3 class="form-text"><display call="note()"></td>
6060
</tr>
6161

62+
<tr bgcolor="ffffea">
63+
<td width=1% nowrap align=right><span class="form-label">File</span></td>
64+
<td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
65+
</tr>
66+
6267
<tr bgcolor="ffffea">
6368
<td>&nbsp;</td>
6469
<td colspan=3 class="form-text"><display call="submit()"></td>

roundup/templates/extended/htmlbase.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@
156156
<td colspan=3 class="form-text"><display call="note()"></td>
157157
</tr>
158158
159+
<tr bgcolor="ffffea">
160+
<td width=1% nowrap align=right><span class="form-label">File</span></td>
161+
<td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
162+
</tr>
163+
159164
<tr bgcolor="ffffea">
160165
<td>&nbsp;</td>
161166
<td colspan=3 class="form-text"><display call="submit()"></td>
@@ -537,6 +542,11 @@
537542
<td colspan=3 class="form-text"><display call="note()"></td>
538543
</tr>
539544
545+
<tr bgcolor="ffffea">
546+
<td width=1% nowrap align=right><span class="form-label">File</span></td>
547+
<td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
548+
</tr>
549+
540550
<tr bgcolor="ffffea">
541551
<td>&nbsp;</td>
542552
<td colspan=3 class="form-text"><display call="submit()"></td>

0 commit comments

Comments
 (0)