| 116 | ## Removes all items whose paths match the given |
| 117 | # regular expression. |
| 118 | def removeMatching( self, regEx ) : |
| 119 | |
| 120 | if type( regEx ) is str : |
| 121 | regEx = re.compile( regEx ) |
| 122 | |
| 123 | toRemove = [] |
| 124 | for i in range( 0, len( self.__items ) ) : |
| 125 | if regEx.search( self.__items[i][0] ) : |
| 126 | toRemove.append( i ) |
| 127 | |
| 128 | toRemove.sort() |
| 129 | toRemove.reverse() |
| 130 | for i in toRemove : |
| 131 | del self.__items[i] |
| 132 | |
| 133 | ## Appends another MenuDefinition or dict to the end |
| 134 | # of the definition. Duplicate entries will be overwritten. |