(self, tag, keyword)
| 47 | msgbox.showerror("Error...", "Unable to load selected file") |
| 48 | |
| 49 | def highlight_pattern(self, tag, keyword): |
| 50 | start = self.scrollData.index("1.0") |
| 51 | end = self.scrollData.index("end") |
| 52 | self.scrollData.mark_set("matchStart", start) |
| 53 | self.scrollData.mark_set("matchEnd", start) |
| 54 | self.scrollData.mark_set("searchLimit", end) |
| 55 | count = IntVar() |
| 56 | while True: |
| 57 | index = self.scrollData.search(keyword, "matchEnd", "searchLimit", count=count, regexp=False) |
| 58 | if index == "": break |
| 59 | if count.get() == 0: break |
| 60 | self.scrollData.mark_set("matchStart", index) |
| 61 | self.scrollData.mark_set("matchEnd", "%s+%sc" % (index, count.get() )) |
| 62 | self.scrollData.tag_add(tag, "matchStart", "matchEnd") |
| 63 | |
| 64 | |
| 65 | def console_print(filename): |
no test coverage detected