Mercurial > p > roundup > code
comparison roundup/roundupdb.py @ 772:db5daf396518
Removed temporary workaround.
It seems it was a bug in the nosyreaction detector in the 0.4.1
extended template and has already been fixed in the repo. We'll see.
| author | Derrick Hudson <dman13@users.sourceforge.net> |
|---|---|
| date | Sun, 16 Jun 2002 01:05:15 +0000 |
| parents | 0ffb5aaeecf5 |
| children | 60189cf7ba8e |
comparison
equal
deleted
inserted
replaced
| 771:c6802cfe86f5 | 772:db5daf396518 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: roundupdb.py,v 1.57 2002-06-15 15:49:29 dman13 Exp $ | 18 # $Id: roundupdb.py,v 1.58 2002-06-16 01:05:15 dman13 Exp $ |
| 19 | 19 |
| 20 __doc__ = """ | 20 __doc__ = """ |
| 21 Extending hyperdb with types specific to issue-tracking. | 21 Extending hyperdb with types specific to issue-tracking. |
| 22 """ | 22 """ |
| 23 | 23 |
| 519 ''' | 519 ''' |
| 520 | 520 |
| 521 # simplistic check to see if the url is valid, | 521 # simplistic check to see if the url is valid, |
| 522 # then append a trailing slash if it is missing | 522 # then append a trailing slash if it is missing |
| 523 base = self.db.config.ISSUE_TRACKER_WEB | 523 base = self.db.config.ISSUE_TRACKER_WEB |
| 524 # Oops, can't do this in python2.1 | 524 if not isinstance( base , type('') ) or not base.startswith( "http://" ) : |
| 525 #if not isinstance( base , "" ) or not base.startswith( "http://" ) : | |
| 526 if type(base) != type("") or not base.startswith( "http://" ) : | |
| 527 base = "Configuration Error: ISSUE_TRACKER_WEB isn't a fully-qualified URL" | 525 base = "Configuration Error: ISSUE_TRACKER_WEB isn't a fully-qualified URL" |
| 528 elif base[-1] != '/' : | 526 elif base[-1] != '/' : |
| 529 base += '/' | 527 base += '/' |
| 530 web = base + 'issue'+ nodeid | 528 web = base + 'issue'+ nodeid |
| 531 | 529 |
| 576 return '\n'.join(m) | 574 return '\n'.join(m) |
| 577 | 575 |
| 578 def generateChangeNote(self, nodeid, oldvalues): | 576 def generateChangeNote(self, nodeid, oldvalues): |
| 579 """Generate a change note that lists property changes | 577 """Generate a change note that lists property changes |
| 580 """ | 578 """ |
| 579 | |
| 580 if __debug__ : | |
| 581 if not isinstance( oldvalues , type({}) ) : | |
| 582 raise TypeError( | |
| 583 "'oldvalues' must be dict-like, not %s." | |
| 584 % str(type(oldvalues)) ) | |
| 585 | |
| 581 cn = self.classname | 586 cn = self.classname |
| 582 cl = self.db.classes[cn] | 587 cl = self.db.classes[cn] |
| 583 changed = {} | 588 changed = {} |
| 584 props = cl.getprops(protected=0) | 589 props = cl.getprops(protected=0) |
| 585 | |
| 586 # XXX DSH | |
| 587 # Temporary work-around to prevent crashes and allow the issue to be | |
| 588 # submitted. | |
| 589 try : | |
| 590 oldvalues.keys | |
| 591 except AttributeError : | |
| 592 # The arg isn't a dict. Precondition/interface violation. | |
| 593 return '\n'.join( | |
| 594 ('', '-'*10, | |
| 595 "Precondition/interface Error -- 'oldvalues' isn't a dict." , | |
| 596 '-'*10 , '' , str(oldvalues) ) ) | |
| 597 | 590 |
| 598 # determine what changed | 591 # determine what changed |
| 599 for key in oldvalues.keys(): | 592 for key in oldvalues.keys(): |
| 600 if key in ['files','messages']: continue | 593 if key in ['files','messages']: continue |
| 601 new_value = cl.get(nodeid, key) | 594 new_value = cl.get(nodeid, key) |
| 664 m.insert(0, '') | 657 m.insert(0, '') |
| 665 return '\n'.join(m) | 658 return '\n'.join(m) |
| 666 | 659 |
| 667 # | 660 # |
| 668 # $Log: not supported by cvs2svn $ | 661 # $Log: not supported by cvs2svn $ |
| 662 # Revision 1.57 2002/06/15 15:49:29 dman13 | |
| 663 # Use 'email' instead of 'rfc822', if available. | |
| 664 # Don't use isinstance() on a string (not allowed in python 2.1). | |
| 665 # Return an error message instead of crashing if 'oldvalues' isn't a | |
| 666 # dict (in generateChangeNote). | |
| 667 # | |
| 669 # Revision 1.56 2002/06/14 03:54:21 dman13 | 668 # Revision 1.56 2002/06/14 03:54:21 dman13 |
| 670 # #565992 ] if ISSUE_TRACKER_WEB doesn't have the trailing '/', add it | 669 # #565992 ] if ISSUE_TRACKER_WEB doesn't have the trailing '/', add it |
| 671 # | 670 # |
| 672 # use the rfc822 module to ensure that every (oddball) email address and | 671 # use the rfc822 module to ensure that every (oddball) email address and |
| 673 # real-name is properly quoted | 672 # real-name is properly quoted |
| 854 # signature info in e-mails. | 853 # signature info in e-mails. |
| 855 # . Some more flexibility in the mail gateway and more error handling. | 854 # . Some more flexibility in the mail gateway and more error handling. |
| 856 # . Login now takes you to the page you back to the were denied access to. | 855 # . Login now takes you to the page you back to the were denied access to. |
| 857 # | 856 # |
| 858 # Fixed: | 857 # Fixed: |
| 859 # . Lots of bugs, thanks Roché and others on the devel mailing list! | 858 # . Lots of bugs, thanks Roché and others on the devel mailing list! |
| 860 # | 859 # |
| 861 # Revision 1.20 2001/11/25 10:11:14 jhermann | 860 # Revision 1.20 2001/11/25 10:11:14 jhermann |
| 862 # Typo fix | 861 # Typo fix |
| 863 # | 862 # |
| 864 # Revision 1.19 2001/11/22 15:46:42 jhermann | 863 # Revision 1.19 2001/11/22 15:46:42 jhermann |
