| 1137 | self.status_bar.message(_("Session edited and reevaluated")) |
| 1138 | |
| 1139 | def clear_modules_and_reevaluate(self): |
| 1140 | if self.watcher: |
| 1141 | self.watcher.reset() |
| 1142 | cursor, line = self.cursor_offset, self.current_line |
| 1143 | for modname in set(sys.modules.keys()) - self.original_modules: |
| 1144 | del sys.modules[modname] |
| 1145 | self.reevaluate(new_code=False) |
| 1146 | self.cursor_offset, self.current_line = cursor, line |
| 1147 | self.status_bar.message( |
| 1148 | _("Reloaded at %s by user.") % (time.strftime("%X"),) |
| 1149 | ) |
| 1150 | |
| 1151 | def toggle_file_watch(self): |
| 1152 | if self.watcher: |