Changeset 1950 for xmlrpcplugin/0.10/tracrpc
- Timestamp:
- 02/11/07 07:18:24 (2 years ago)
- Files:
-
- xmlrpcplugin/0.10/tracrpc/api.py (modified) (1 diff)
- xmlrpcplugin/0.10/tracrpc/ticket.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
xmlrpcplugin/0.10/tracrpc/api.py
r1278 r1950 225 225 indicate API breaking changes, while minor version changes are simple 226 226 additions, bug fixes, etc. """ 227 return [0, 1]227 return [0, 2] xmlrpcplugin/0.10/tracrpc/ticket.py
r1732 r1950 6 6 import trac.ticket.query as query 7 7 from trac.ticket.api import TicketSystem 8 8 from trac.ticket.notification import TicketNotifyEmail 9 10 import time 9 11 import pydoc 10 12 import xmlrpclib … … 25 27 yield ('TICKET_VIEW', ((list, int),), self.getAvailableActions) 26 28 yield ('TICKET_VIEW', ((list, int),), self.get) 27 yield ('TICKET_CREATE', ((int, str, str), (int, str, str, dict) ), self.create)28 yield ('TICKET_APPEND', ((list, int, str), (list, int, str, dict) ), self.update)29 yield ('TICKET_CREATE', ((int, str, str), (int, str, str, dict), (int, str, str, dict, bool)), self.create) 30 yield ('TICKET_APPEND', ((list, int, str), (list, int, str, dict), (list, int, str, dict, bool)), self.update) 29 31 yield ('TICKET_ADMIN', ((None, int),), self.delete) 30 32 yield ('TICKET_VIEW', ((dict, int), (dict, int, int)), self.changeLog) … … 70 72 return (t.id, t.time_created, t.time_changed, t.values) 71 73 72 def create(self, req, summary, description, attributes = {} ):74 def create(self, req, summary, description, attributes = {}, notify=False): 73 75 """ Create a new ticket, returning the ticket ID. """ 74 76 t = model.Ticket(self.env) … … 80 82 t[k] = v 81 83 t.insert() 84 85 if notify: 86 try: 87 tn = TicketNotifyEmail(self.env) 88 tn.notify(t, newticket=True) 89 except Exception, e: 90 self.log.exception("Failure sending notification on creation " 91 "of ticket #%s: %s" % (t.id, e)) 92 82 93 return t.id 83 94 84 def update(self, req, id, comment, attributes = {} ):95 def update(self, req, id, comment, attributes = {}, notify=False): 85 96 """ Update a ticket, returning the new ticket in the same form as getTicket(). """ 97 now = int(time.time()) 98 86 99 t = model.Ticket(self.env, id) 87 100 for k, v in attributes.iteritems(): 88 101 t[k] = v 89 102 t.save_changes(req.authname or 'anonymous', comment) 103 104 if notify: 105 try: 106 tn = TicketNotifyEmail(self.env) 107 tn.notify(t, newticket=False, modtime=now) 108 except Exception, e: 109 self.log.exception("Failure sending notification on change of " 110 "ticket #%s: %s" % (t.id, e)) 111 90 112 return self.get(req, t.id) 91 113
