Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 3178:2ac85e66e9bb maint-0.8
remove rcsv
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 15 Feb 2005 00:22:24 +0000 |
| parents | f412ae175b4d |
| children | 6cd2cbb47fb0 |
comparison
equal
deleted
inserted
replaced
| 3177:d2592d790fd8 | 3178:2ac85e66e9bb |
|---|---|
| 19 | 19 |
| 20 from __future__ import nested_scopes | 20 from __future__ import nested_scopes |
| 21 | 21 |
| 22 import sys, cgi, urllib, os, re, os.path, time, errno, mimetypes | 22 import sys, cgi, urllib, os, re, os.path, time, errno, mimetypes |
| 23 | 23 |
| 24 from roundup import hyperdb, date, rcsv, support | 24 from roundup import hyperdb, date, csv, support |
| 25 from roundup import i18n | 25 from roundup import i18n |
| 26 from roundup.i18n import _ | 26 from roundup.i18n import _ |
| 27 | 27 |
| 28 try: | 28 try: |
| 29 import cPickle as pickle | 29 import cPickle as pickle |
| 567 return l | 567 return l |
| 568 | 568 |
| 569 def csv(self): | 569 def csv(self): |
| 570 ''' Return the items of this class as a chunk of CSV text. | 570 ''' Return the items of this class as a chunk of CSV text. |
| 571 ''' | 571 ''' |
| 572 if rcsv.error: | |
| 573 return rcsv.error | |
| 574 | |
| 575 props = self.propnames() | 572 props = self.propnames() |
| 576 s = StringIO.StringIO() | 573 s = StringIO.StringIO() |
| 577 writer = rcsv.writer(s, rcsv.comma_separated) | 574 writer = csv.writer(s) |
| 578 writer.writerow(props) | 575 writer.writerow(props) |
| 579 for nodeid in self._klass.list(): | 576 for nodeid in self._klass.list(): |
| 580 l = [] | 577 l = [] |
| 581 for name in props: | 578 for name in props: |
| 582 value = self._klass.get(nodeid, name) | 579 value = self._klass.get(nodeid, name) |
