annotate data/plugin/action/submitcsv.py @ 626:f64779d5d500

FormSubmit: simplify code, auto-provide filename
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Mar 2013 18:29:47 +0100
parents f4e63b74b969
children f683dea1ac1b
rev   line source
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - submitcsv Action
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 Store submited data into CSV file. CSV file is located
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6 in standard MoinMoin attchment folder or defined in
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 targetpage CGI parameter.
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 @copyright: 2008 by Peter Bodi <petrdll@centrum.sk>
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 @license: GNU GPL, see COPYING for details.
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 """
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12
623
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
13 import os
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
14 import csv
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
15 import codecs
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
16 import cStringIO
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18 from MoinMoin import config, wikiutil
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 from MoinMoin.Page import Page
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
20 from MoinMoin.action import AttachFile
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22 from submitbase import SubmitBase
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
23
623
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
24
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
25 def execute(pagename, request):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26 submitcsv(pagename, request).render()
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
27
623
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
28
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
29 class submitcsv(SubmitBase):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
30
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
31 def __init__(self, pagename, request):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
32 SubmitBase.__init__(self, pagename, request)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
33
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34 self.delimiter = ';'
626
f64779d5d500 FormSubmit: simplify code, auto-provide filename
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 625
diff changeset
35 self.targetFile = request.form.get("targetfile", "list.csv")
f64779d5d500 FormSubmit: simplify code, auto-provide filename
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 625
diff changeset
36
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
37 def sanitize(self):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
38 SubmitBase.sanitize(self)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
39 self.targetFile = wikiutil.clean_input(self.targetFile)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
40
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
41 def submit(self):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
42 SubmitBase.submit(self)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
43 request = self.request
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
44 pagename = self.targetpage
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
45
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
46 attachDir = AttachFile.getAttachDir(request, pagename, create=1)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
47
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
48 targetFile = self.targetFile
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
49
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
50 filePath = os.path.join(attachDir, targetFile).encode(config.charset)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
51
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
52 # save header
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
53 if not os.path.exists(filePath):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
54 fh = open(filePath, 'wb')
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
55
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
56 # Encoded Input to writer.writerow
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
57 writer = csv.writer(fh, delimiter=self.delimiter)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
58 writer.writerow(self.labels)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
59
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
60 # Decoded Input to writer.writerow
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
61 #writer = UnicodeWriter(fh, delimiter=self.delimiter)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
62 #writer.writerow(self.labels)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
63
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
64 fh.close()
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
65
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
66 # save content
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
67 fh = open(filePath, 'ab')
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
68
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
69 # Encoded Input to writer.writerow
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
70 #writer = csv.writer(fh, delimiter=self.delimiter, quoting=csv.QUOTE_MINIMAL)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
71 #writer.writerow(self.values)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
72
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
73 # Decoded Input to writer.writerow
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
74 writer = UnicodeWriter(fh, delimiter=self.delimiter, quoting=csv.QUOTE_MINIMAL)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
75 writer.writerow(self.values)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
76
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
77 fh.close()
623
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
78
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
79
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
80 class UnicodeWriter:
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
81 """
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
82 A CSV writer which will write rows to CSV file "f",
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
83 which is encoded in the given encoding.
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
84 """
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
85
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
86 def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
87 # Redirect output to a queue
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
88 self.queue = cStringIO.StringIO()
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
89 self.writer = csv.writer(self.queue, dialect=dialect, **kwds)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
90 self.stream = f
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
91 self.encoder = codecs.getincrementalencoder(encoding)()
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
92
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
93 def writerow(self, row):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
94 self.writer.writerow([s.encode("utf-8") for s in row])
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
95 # Fetch UTF-8 output from the queue ...
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
96 data = self.queue.getvalue()
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
97 data = data.decode("utf-8")
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
98 # ... and reencode it into the target encoding
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
99 data = self.encoder.encode(data)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
100 # write to the target stream
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
101 self.stream.write(data)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
102 # empty queue
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
103 self.queue.truncate(0)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
104
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
105 def writerows(self, rows):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
106 for row in rows:
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
107 self.writerow(row)