Пример #1
0
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
Пример #2
0
Файл: vdb.py Проект: jsbain/vdb
 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()
Пример #3
0
Файл: vdb.py Проект: jsbain/vdb
	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()
Пример #4
0
Файл: vdb.py Проект: jsbain/vdb
    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()
Пример #5
0
Файл: vdb.py Проект: jsbain/vdb
	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()
Пример #6
0
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
Пример #7
0
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()
Пример #8
0
def clear_annotations():
    editor.clear_annotations()
Пример #9
0
Файл: vdb.py Проект: jsbain/vdb
 def play_action(self, sender):
     editor.clear_annotations()
     self.hide_menu()
     self.set_continue()
     self.event.set()
Пример #10
0
Файл: vdb.py Проект: jsbain/vdb
 def stop_action(self, sender):
     editor.clear_annotations()
     self.cancel()
Пример #11
0
Файл: vdb.py Проект: jsbain/vdb
 def step_in_action(self, sender):
     self.set_step()
     self.event.set()
     editor.clear_annotations()
Пример #12
0
Файл: vdb.py Проект: jsbain/vdb
 def step_over_action(self, sender):
     self.set_next(self.curframe)
     self.event.set()
     editor.clear_annotations()
Пример #13
0
Файл: vdb.py Проект: jsbain/vdb
	def step_in_action(self, sender):
		self.set_step()
		self.event.set()
		editor.clear_annotations()
Пример #14
0
Файл: vdb.py Проект: jsbain/vdb
	def step_over_action(self, sender):
		self.set_next(self.curframe)
		self.event.set()
		editor.clear_annotations()
Пример #15
0
Файл: vdb.py Проект: jsbain/vdb
	def play_action(self, sender):
		editor.clear_annotations()
		self.hide_menu()
		self.set_continue()
		self.event.set()
Пример #16
0
def main():
    editor.clear_annotations()
Пример #17
0
Файл: vdb.py Проект: jsbain/vdb
	def stop_action(self, sender):
		editor.clear_annotations()
		self.cancel()