예제 #1
0
 def handle_line(self, device, filename, line, args):
     """
 
     """
     try:
         area = AreaVi.get_opened_files(root)[filename]
     except KeyError:
         pass
     else:
         set_line(area, line)
예제 #2
0
    def delete_all_breakpoints(self):
        """
        It deletes all added breakpoint tags.
        It is useful when restarting pdb as a different process.
        """

        widgets = AreaVi.get_opened_files(root)
        for index, (filename, line) in self.map_index.items():
            area = widgets.get(filename)
            if area:
                area.tag_delete('_breakpoint_%s' % index)
예제 #3
0
파일: tools.py 프로젝트: zhangshiguang/vy
def findline(filename, line, col=0):
    files = AreaVi.get_opened_files(root)
    filename = abspath(filename)

    try:
        area = files[filename]
    except KeyError:
        area = root.note.open(filename)
    else:
        pass
    finally:
        root.note.set_line(area, line)
예제 #4
0
파일: rope.py 프로젝트: smiled0g/vy
    def update_instances(self, changes):
        """
        After changes it updates all AreaVi instances which 
        were changed.
        """

        # Avoid having to calculate it multiple times.
        self.files = AreaVi.get_opened_files(root)
        for ind in changes.changes:
            if isinstance(ind, (MoveResource,)):
                self.on_move_resource(ind)
            else:
                self.on_general_case(ind)
예제 #5
0
    def delete_all_breakpoints(self):
        """
        It deletes all added breakpoint tags.
        It is useful when restarting pdb as a different process.
        """

        for index, (filename, line) in self.map_index.iteritems():
            try:
                area = AreaVi.get_opened_files(root)[filename]
            except KeyError:
                pass
            else:
                NAME = '_breakpoint_%s' % index
                area.tag_delete(NAME)
예제 #6
0
    def e_pmsg(self, con, nick, user, host, target, msg):
        """
        Private messages sent to the user are handled here.
        """
        # Attempt to retrieve the areavi which corresponds
        # to the target/user.
        base = lambda key_value: (key_value[0].lower(), key_value[1])
        files = iter(AreaVi.get_opened_files(root).items())
        targets = dict(list(map(base, files)))

        try:
            area = targets[nick.lower()]
        except KeyError:
            area = self.create_private_channel(nick)
        area.append(H1 % (nick, msg))
예제 #7
0
    def handle_breakpoint(self, device, index, filename, line):
        """
        When a break point is added.
        """

        self.map_index[index] = (filename, line)
        self.map_line[(filename, line)] = index
        map = AreaVi.get_opened_files(root)

        area = map[filename]

        NAME = '_breakpoint_%s' % index
        area.tag_add(NAME, '%s.0 linestart' % line, '%s.0 lineend' % line)

        area.tag_config(NAME, **self.setup)
예제 #8
0
    def handle_deleted_breakpoint(self, device, index):
        """
        When a break point is removed.
        """

        filename, line = self.map_index[index]
        NAME = '_breakpoint_%s' % index
        area = None

        try:
            area = AreaVi.get_opened_files(root)[filename]
        except KeyError:
            return

        area.tag_delete(NAME)
예제 #9
0
파일: dap.py 프로젝트: curiousTauseef/vy
    def handle_line(self, device, filename, line):
        """
    
        """
        filename = abspath(filename)

        wids = AreaVi.get_opened_files(root)
        area = wids.get(filename)

        if area: root.note.set_line(area, line)
        area.tag_delete('(DebuggerBP)')
        area.tag_add('(DebuggerBP)', '%s.0 linestart' % line,
                     '%s.0 lineend' % line)
        area.tag_config('(DebuggerBP)', **self.setup)
        root.status.set_msg('Debugger stopped at: %s:%s' % (filename, line))