- Timestamp:
- 21 Sep 2012, 08:19:35 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
/main/waeup.kofa/branches/uli-async-update removed /main/waeup.kofa/branches/uli-autoinclude-less removed /main/waeup.kofa/trunk removed
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/objecthistory.py
r9209 r9211 78 78 self._annotations[self.history_key] = msgs 79 79 return 80 81 def modifyMessages(self, old, new):82 """Replaces history messages.83 84 Substring 'old' will be replaced by 'new' in all85 messages.86 """87 old_msgs = self._getMessages()88 new_msgs = PersistentList()89 for msg in old_msgs:90 new_msg = msg.replace(old, new)91 new_msgs.append(new_msg)92 self._annotations[self.history_key] = new_msgs93 return94 95 def removeMessage(self, number):96 """Removes a single history message.97 98 """99 msgs = self._getMessages()100 if not isinstance(number, int):101 return False, 'Not a number'102 try:103 line = msgs[number]104 except IndexError:105 return False, 'Number out of range'106 msgs.pop(number)107 self._annotations[self.history_key] = msgs108 return True, line
Note: See TracChangeset for help on using the changeset viewer.