does the work for clearstamp() and clearstamps()
(self, stampid)
| 3094 | return stitem |
| 3095 | |
| 3096 | def _clearstamp(self, stampid): |
| 3097 | """does the work for clearstamp() and clearstamps() |
| 3098 | """ |
| 3099 | if stampid in self.stampItems: |
| 3100 | if isinstance(stampid, tuple): |
| 3101 | for subitem in stampid: |
| 3102 | self.screen._delete(subitem) |
| 3103 | else: |
| 3104 | self.screen._delete(stampid) |
| 3105 | self.stampItems.remove(stampid) |
| 3106 | # Delete stampitem from undobuffer if necessary |
| 3107 | # if clearstamp is called directly. |
| 3108 | item = ("stamp", stampid) |
| 3109 | buf = self.undobuffer |
| 3110 | if item not in buf.buffer: |
| 3111 | return |
| 3112 | index = buf.buffer.index(item) |
| 3113 | buf.buffer.remove(item) |
| 3114 | if index <= buf.ptr: |
| 3115 | buf.ptr = (buf.ptr - 1) % buf.bufsize |
| 3116 | buf.buffer.insert((buf.ptr+1)%buf.bufsize, [None]) |
| 3117 | |
| 3118 | def clearstamp(self, stampid): |
| 3119 | """Delete stamp with given stampid |
no test coverage detected