Changeset 1154
- Timestamp:
- 08/19/06 00:27:47 (2 years ago)
- Files:
-
- xmlrpcplugin/0.10/tracrpc/ticket.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
xmlrpcplugin/0.10/tracrpc/ticket.py
r1070 r1154 28 28 yield ('TICKET_VIEW', ((xmlrpclib.Binary, int, str),), self.getAttachment) 29 29 yield ('TICKET_APPEND', 30 ((str, int, str, xmlrpclib.Binary, bool),31 (str, int, str, xmlrpclib.Binary)),30 ((str, int, str, str, xmlrpclib.Binary, bool), 31 (str, int, str, str, xmlrpclib.Binary)), 32 32 self.putAttachment) 33 33 yield ('TICKET_ADMIN', ((bool, int, str),), self.deleteAttachment) … … 79 79 80 80 def listAttachments(self, req, ticket): 81 """ Lists attachments for a given ticket. """ 82 return [a.filename for a in Attachment.select(self.env, 'ticket', ticket)] 81 """ Lists attachments for a given ticket. Returns (filename, 82 description, size, time, author) for each attachment.""" 83 for t in Attachment.select(self.env, 'ticket', ticket): 84 yield (t.filename, t.description or '', t.size, t.time, t.author) 83 85 84 86 def getAttachment(self, req, ticket, filename): … … 87 89 return xmlrpclib.Binary(attachment.open().read()) 88 90 89 def putAttachment(self, req, ticket, filename, d ata, replace=True):91 def putAttachment(self, req, ticket, filename, description, data, replace=True): 90 92 """ Add an attachment, optionally (and defaulting to) overwriting an 91 93 existing one. Returns filename.""" … … 100 102 attachment = Attachment(self.env, 'ticket', ticket) 101 103 attachment.author = req.authname or 'anonymous' 104 attachment.description = description 102 105 attachment.insert(filename, StringIO(data.data), len(data.data)) 103 106 return attachment.filename
