def analyze(): path = editor.get_path() if not path: return if not path.endswith('.py'): return editor.clear_annotations() text = editor.get_text() annotations = _pep8_annotations( text, ignore=settings.ANALYZER_PEP8_IGNORE, max_line_length=settings.ANALYZER_PEP8_MAX_LINE_LENGTH) annotations += _pyflakes_annotations(path, text) if not annotations: console.hud_alert('No Issues Found', 'iob:checkmark_32', settings.ANALYZER_HUD_DELAY) return None scroll = True by_line = sorted(annotations, key=lambda x: x.line) for l, a in groupby(by_line, lambda x: x.line): _annotate(l, a, scroll) scroll = False
def interaction(self, frame): self.setup(frame, None) self.event.clear() try: while True: if self.event.wait(2): # allow keyboard interrupt break finally: editor.clear_annotations() self.hide_menu() if self.quitting: self.hide_menu()
def interaction(self, frame): self.setup(frame,None) self.event.clear() try: while True: if self.event.wait(2): # allow keyboard interrupt break finally: editor.clear_annotations() self.hide_menu() if self.quitting: self.hide_menu()
def setup_ui(self): self.curframe = self.stack[self.curindex][0] # The f_locals dictionary is updated from the actual frame # locals whenever the .f_locals accessor is called, so we # cache it here to ensure that modifications are not overwritten. editor.clear_annotations() self.curframe_locals = self.curframe.f_locals frame = self.curframe editor.open_file(frame.f_code.co_filename) editor.annotate_line(frame.f_lineno, filename=frame.f_code.co_filename, scroll=True) self.show_menu() self.debugmenu['down'].enabled = self.curindex < len(self.stack) - 1 self.debugmenu['up'].enabled = self.curindex > 0 console.hide_output()
def setup_ui(self): self.curframe = self.stack[self.curindex][0] # The f_locals dictionary is updated from the actual frame # locals whenever the .f_locals accessor is called, so we # cache it here to ensure that modifications are not overwritten. editor.clear_annotations() self.curframe_locals = self.curframe.f_locals frame=self.curframe editor.open_file(frame.f_code.co_filename) editor.annotate_line(frame.f_lineno, filename = frame.f_code.co_filename, scroll = True) self.show_menu() self.debugmenu['down'].enabled=self.curindex<len(self.stack)-1 self.debugmenu['up'].enabled=self.curindex>0 console.hide_output()
def main(): path = editor.get_path() if not path: return if not path.endswith('.py'): return editor.clear_annotations() flake8_options = get_config_value('analyzer.flake8', None) selection = editor.get_selection() text = _editor_text() if flake8_options: annotations = _flake8_annotations(os.path.abspath(path), flake8_options) else: annotations = _pep8_annotations(text, ignore=_ignore_codes(), max_line_length=_max_line_length()) annotations += _pyflakes_annotations(path, text) if not annotations: if selection: editor.set_selection(selection[0], scroll=True) console.hud_alert('No Issues Found', 'iob:checkmark_32', _hud_alert_delay()) return None scroll = True by_line = sorted(annotations, key=lambda x: x.line) for l, a in groupby(by_line, lambda x: x.line): _annotate(l, a, scroll) scroll = False
def _run_unit_tests(path): editor.clear_annotations() _remove_log_file() pytest.main([ '-q', '-p', 'no:cacheprovider', '--junitxml={}'.format(_LOG_FILE_PATH), path ]) attrib, annotations = _parse_log_file() _show_results(attrib, not annotations) scroll = True for a in annotations: editor.annotate_line(a.line, a.text, a.style.value, True, filename=a.filename, scroll=scroll) scroll = False if _hide_console(): console.hide_output()
def clear_annotations(): editor.clear_annotations()
def play_action(self, sender): editor.clear_annotations() self.hide_menu() self.set_continue() self.event.set()
def stop_action(self, sender): editor.clear_annotations() self.cancel()
def step_in_action(self, sender): self.set_step() self.event.set() editor.clear_annotations()
def step_over_action(self, sender): self.set_next(self.curframe) self.event.set() editor.clear_annotations()
def main(): editor.clear_annotations()