Пример #1
0
        def get_sel(lhs, rhs):
            sel = select([
                func.group_filepath(lhs.c.path).label('LHSGROUP'),
                func.group_filepath(rhs.c.path.distinct()).label('RHSGROUP')
            ])
            sel = match(sel, lhs, rhs)

            if arguments['--size']:
                sel = sel.group_by(lhs.c.size).order_by(lhs.c.size)

            if arguments['--time']:
                sel = sel.group_by(lhs.c.time).order_by(lhs.c.time)

            if arguments['--extension']:
                sel = sel.group_by(lhs.c.extension).order_by(lhs.c.extension)

            if arguments['--basename']:
                sel = sel.group_by(lhs.c.basename).order_by(lhs.c.basename)

            if arguments['--quick']:
                sel = sel.group_by(lhs.c.hash_quick).order_by(lhs.c.hash_quick)

            if arguments['--full']:
                sel = sel.group_by(lhs.c.hash_total).order_by(lhs.c.hash_total)

            sel = sel.order_by(lhs.c.path)
            sel = sel.order_by(rhs.c.path)
            sel = sel.distinct()
            return sel
Пример #2
0
 def get_sel(lhs, rhs):
     sel = select(
         [func.group_filepath(lhs.c.path).label('UNIQUEGROUP')])
     sel = sel.where(~exists(match(select(['*']), lhs, rhs)))
     sel = sel.order_by(lhs.c.path)
     sel = sel.distinct()
     return sel
Пример #3
0
 def get_sel(lhs, rhs):
     sel = select([func.group_filepath(rhs.c.path).label('RHSGROUP')])
     sel = match(sel, lhs, rhs)
     sel = sel.group_by(lhs.c.path)
     sel = sel.order_by(rhs.c.path)
     sel = sel.distinct()
     return sel