(self, workarea, command, config, wfp)
return seqs
Generate a list of sequence positions (as percents).
Generate a list of sequence positions (as percents).
Generate a list of sequence positions ( as percents ) .
def _generate_sequence_percents(self, workarea, command, config, wfp):
        """ Generate a list of sequence positions (as percents). """
        seqs = []
        xdivs = config['xdivs']
        ydivs = config['ydivs']
        for x1, x2 in product(_iter_percent(xdivs), repeat=2):
            for y1, y2 in product(_iter_percent(ydivs), repeat=2):
                seqp = Seq(x1, x2, y1, y2, round(x2-x1,4), round(y2-y1,4))
                if seqp.x1 >= seqp.x2 or seqp.y1 >= seqp.y2: continue
                if not self.FILTERS[command](seqp): continue
                if command not in ['top', 'middle', 'bottom', 'noclamptop', 'noclampbottom'] \
                    and not config['minwidth'] <= seqp.w <= config['maxwidth']: continue
                if command not in ['left', 'middle', 'right', 'noclampleft', 'noclampright'] \
                    and not config['minheight'] <= seqp.h <= config['maxheight']: continue
                if command in ['noclampleft', 'noclampright'] \
                    and not _closest(wfp.y1, wfp.y2, seqp.y1, seqp.y2, ydivs): continue
                if command in ['noclamptop', 'noclampbottom'] \
                    and not _closest(wfp.x1, wfp.x2, seqp.x1, seqp.x2, xdivs): continue
                seqs.append(self._seqp_to_seq(seqp, workarea, config))
        return seqs
def _generate_sequence_percents ( self , workarea , command , config , wfp ) : seqs = [ ] xdivs = config [ 'xdivs' ] ydivs = config [ 'ydivs' ] for x1 , x2 in product ( _iter_percent ( xdivs ) , repeat = 2 ) : for y1 , y2 in product ( _iter_percent ( ydivs ) , repeat = 2 ) : seqp = Seq ( x1 , x2 , y1 , y2 , round ( x2 - x1 , 4 ) , round ( y2 - y1 , 4 ) ) if seqp . x1 >= seqp . x2 or seqp . y1 >= seqp . y2 : continue if not self . FILTERS [ command ] ( seqp ) : continue if command not in [ 'top' , 'middle' , 'bottom' , 'noclamptop' , 'noclampbottom' ] and not config [ 'minwidth' ] <= seqp . w <= config [ 'maxwidth' ] : continue if command not in [ 'left' , 'middle' , 'right' , 'noclampleft' , 'noclampright' ] and not config [ 'minheight' ] <= seqp . h <= config [ 'maxheight' ] : continue if command in [ 'noclampleft' , 'noclampright' ] and not _closest ( wfp . y1 , wfp . y2 , seqp . y1 , seqp . y2 , ydivs ) : continue if command in [ 'noclamptop' , 'noclampbottom' ] and not _closest ( wfp . x1 , wfp . x2 , seqp . x1 , seqp . x2 , xdivs ) : continue seqs . append ( self . _seqp_to_seq ( seqp , workarea , config ) ) return seqs