Browse Source

do this iteratively so the user gets results sooner..

main
John-Mark Gurney 1 year ago
parent
commit
81a0c7f77f
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      ui/medashare/cli.py

+ 4
- 6
ui/medashare/cli.py View File

@@ -1467,17 +1467,15 @@ def cmd_search(options, persona, objstr, cache):
except KeyError:
return False

r = [ x for x in objstr if x.type == 'file' and testfun(x) ]
r = ( x for x in objstr if x.type == 'file' and testfun(x) )

if _type == 'file':
r = [ objstr.by_hash(x['hashes'][0]) for x in r ]
r = [ [ y for y in x if y['type'] == 'file' ] for x in r ]
r = sum(r, [])
r = [ x.fullname for x in r ]
r = ( x.fullname for x in r )
else:
raise ValueError('unhandled type: %s' % repr(_type))

print('\n'.join(r))
for i in r:
print(i)

def main():
import argparse


Loading…
Cancel
Save