(self,line,new_char)
| 16 | if i in self.keep: del self.keep[i] |
| 17 | |
| 18 | def replace(self,line,new_char): |
| 19 | bad=0;changed=0 |
| 20 | #keep on replacing until there are no bad characters left |
| 21 | while 1: |
| 22 | clean=1 |
| 23 | for c in line: |
| 24 | if c not in self.keep: |
| 25 | clean=0 |
| 26 | line=line.replace(c,new_char) |
| 27 | changed=1 |
| 28 | #cannot continue replacing since line has changed w/for loop |
| 29 | break |
| 30 | #break the while loop if nothing bad was found |
| 31 | if clean: break |
| 32 | if self.debug and changed: print line |
| 33 | return line |
no outgoing calls
no test coverage detected