Guest User

Untitled

a guest
Sep 4th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. FILE_EXTENTIONS = 'png', 'jpg'
  2.  
  3. files = filter(
  4.     None,
  5.     (p.get('files') for p in req['threads'][0]['posts'])
  6.     )
  7.  
  8. prefix = urli.rsplit('/', 2)[0] + '/'
  9.  
  10. paths = (
  11.     prefix + path
  12.     for path in (f[0]['path'] for f in files)
  13.     if any(map(path.endswith, FILE_EXTENTIONS))
  14.     )
  15.  
  16. for p in paths:
  17.     label1['text'] = 'download ' + p
  18.     # ...
Advertisement
Add Comment
Please, Sign In to add comment