Lines Matching refs:self

38     def __init__(self, editwin):
39 self.editwin = editwin
42 self.flist = self.editwin.flist
43 self.root = self.editwin.root
45 self.cli_args = []
46 self.perf = 0.0 # Workaround for macOS 11 Uni2; see bpo-42508.
48 def check_module_event(self, event):
49 if isinstance(self.editwin, outwin.OutputWindow):
50 self.editwin.text.bell()
52 filename = self.getfilename()
55 if not self.checksyntax(filename):
57 if not self.tabnanny(filename):
61 def tabnanny(self, filename):
68 self.editwin.gotoline(lineno)
69 self.errorbox("Tabnanny Tokenizing Error",
74 self.editwin.gotoline(nag.get_lineno())
75 self.errorbox("Tab/space error", indent_message)
79 def checksyntax(self, filename):
80 self.shell = shell = self.flist.open_shell()
90 editwin = self.editwin
104 self.errorbox("SyntaxError", "%-20s" % msg)
109 def run_custom_event(self, event):
110 return self.run_module_event(event, customize=True)
112 def run_module_event(self, event, *, customize=False):
121 if macosx.isCocoaTk() and (time.perf_counter() - self.perf < .05):
123 if isinstance(self.editwin, outwin.OutputWindow):
124 self.editwin.text.bell()
126 filename = self.getfilename()
129 code = self.checksyntax(filename)
132 if not self.tabnanny(filename):
135 title = f"Customize {self.editwin.short_title()} Run"
136 run_args = CustomRun(self.shell.text, title,
137 cli_args=self.cli_args).result
140 self.cli_args, restart = run_args if customize else ([], True)
141 interp = self.shell.interp
147 if self.cli_args:
148 argv += self.cli_args
169 def getfilename(self):
180 filename = self.editwin.io.filename
181 if not self.editwin.get_saved():
185 self.editwin.io.save(None)
187 confirm = self.ask_save_dialog()
188 self.editwin.text.focus_set()
190 self.editwin.io.save(None)
191 filename = self.editwin.io.filename
196 def ask_save_dialog(self):
201 parent=self.editwin.text)
204 def errorbox(self, title, message):
206 messagebox.showerror(title, message, parent=self.editwin.text)
207 self.editwin.text.focus_set()
208 self.perf = time.perf_counter()