- Timestamp:
- 07/05/07 17:39:13 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/email2trac.py.in
r164 r165 378 378 pass 379 379 380 def keywords_to_dict(self, str) 380 def keywords_to_dict(self, str): 381 381 """ 382 382 Transfrom a str of the form [<key>=<value>]+ to dict[<key>] = <value> … … 391 391 index, value = string.split(field,'=') 392 392 if value: 393 result[index ] = value393 result[index.lower()] = value 394 394 except ValueError: 395 395 pass 396 396 397 return result s397 return result 398 398 399 399 def ticket_update(self, m): … … 421 421 # Must we update ticket fields 422 422 # 423 if result.group('ticketnr_keywords'):423 try: 424 424 nr, keywords = string.split(result.group('ticketnr_fields'), '?') 425 425 tkt_fields = self.keywords_to_dict(keywords) 426 else: 426 427 # Strip '#' 428 # 429 ticket_id = int(nr[1:]) 430 431 except AttributeError: 432 tkt_fields = dict() 433 427 434 nr = result.group('ticketnr') 428 429 # Strip '#' and ':' from ticket_id430 #431 ticket_id = int(nr[1:-1]) 435 # Strip '#' and ':' 436 # 437 ticket_id = int(nr[1:-1]) 438 432 439 433 440 # Get current time … … 443 450 except util.TracError, detail: 444 451 return False 452 453 # Must we update some ticket fields 454 # 455 #for entry in tkt.fields: 456 # print entry['name'] 457 # print entry 458 #sys.exit(1) 459 for key,value in tkt_fields.items(): 460 tkt[key] = value 445 461 446 462 tkt.save_changes(self.author, body_text, when)
Note: See TracChangeset
for help on using the changeset viewer.