(self, mark, regions)
Marks the requested files.

        mark
            True, False, or a function with signature `func(oldmark, filename)`.
            The function should return True or False.

        regions
            List of region(s).  Only files within the region will be modified.
Marks the requested files.
Marks the requested files .
def _mark(self, mark, regions):
        """
        Marks the requested files.

        mark
            True, False, or a function with signature `func(oldmark, filename)`.
            The function should return True or False.

        regions
            List of region(s).  Only files within the region will be modified.
        """
        filergn = self.fileregion()
        if not filergn:
            return

        self.index = self.get_all()
        # We can't update regions for a key, only replace, so we need to record the existing marks.
        marked = dict((self.get_fullpath_for(r), r) for r in self.view.get_regions('marked') if not r.empty())

        for line in self._get_lines(regions, filergn):
            filename = self.get_fullpath_for(line)

            if mark not in (True, False):
                newmark = mark(filename in marked, filename)
                assert newmark in (True, False), u'Invalid mark: {0}'.format(newmark)
            else:
                newmark = mark

            if newmark:
                name_point = self._get_name_point(line)
                marked[filename] = Region(name_point, line.b)
            else:
                marked.pop(filename, None)

        if marked:
            r = sorted(list(marked.values()), key=lambda region: region.a)
            self.view.add_regions('marked', r, 'dired.marked', '', MARK_OPTIONS)
        else:
            self.view.erase_regions('marked')
def _mark ( self , mark , regions ) : filergn = self . fileregion ( ) if not filergn : return self . index = self . get_all ( ) # We can't update regions for a key, only replace, so we need to record the existing marks. marked = dict ( ( self . get_fullpath_for ( r ) , r ) for r in self . view . get_regions ( 'marked' ) if not r . empty ( ) ) for line in self . _get_lines ( regions , filergn ) : filename = self . get_fullpath_for ( line ) if mark not in ( True , False ) : newmark = mark ( filename in marked , filename ) assert newmark in ( True , False ) , u'Invalid mark: {0}' . format ( newmark ) else : newmark = mark if newmark : name_point = self . _get_name_point ( line ) marked [ filename ] = Region ( name_point , line . b ) else : marked . pop ( filename , None ) if marked : r = sorted ( list ( marked . values ( ) ) , key = lambda region : region . a ) self . view . add_regions ( 'marked' , r , 'dired.marked' , '' , MARK_OPTIONS ) else : self . view . erase_regions ( 'marked' )