Jump to content

User:RonBot/Run3

From Wikipedia, the free encyclopedia

in "whattodel" before passing through [{u'filehidden': True, u'archivename': u'20170504031453!Logo_Politecnico_Milano.png'}, {u'filehidden': True, u'archivename': u'20151105102246!Logo_Politecnico_Milano.png'}]

in "whattodel" after passing through [{u'archivename': u'20170504031453!Logo_Politecnico_Milano.png'}, {u'archivename': u'20151105102246!Logo_Politecnico_Milano.png'}]

    whattodel = res['query']['pages'][0]['imageinfo'][1:] #Go into specifics, ignore first result (DatBot's reduced version)
    print "versiontodelete.whattodel", whattodel
    for result in whattodel:
         print "versiontodelete.for loop", result
         if 'filehidden' in result:
             print "versiontodelete.for loop delete", result
             del result['filehidden'] #Remove any "filehidden" results
             whattodel = filter(None, whattodel) # Remove empty results
             print "versiontodelete.whattodel", whattodel
    return whattodel
versiontodelete.whattodel [{u'filehidden': True, u'archivename': u'20170504031453!Logo_Politecnico_Milano.png'}, {u'filehidden': True, u'archivename': u'20151105102246!Logo_Politecnico_Milano.png'}]
versiontodelete.for loop {u'filehidden': True, u'archivename': u'20170504031453!Logo_Politecnico_Milano.png'}
versiontodelete.for loop delete {u'filehidden': True, u'archivename': u'20170504031453!Logo_Politecnico_Milano.png'}
versiontodelete.whattodel [{u'archivename': u'20170504031453!Logo_Politecnico_Milano.png'}, {u'filehidden': True, u'archivename': u'20151105102246!Logo_Politecnico_Milano.png'}]
versiontodelete.for loop {u'filehidden': True, u'archivename': u'20151105102246!Logo_Politecnico_Milano.png'}
versiontodelete.for loop delete {u'filehidden': True, u'archivename': u'20151105102246!Logo_Politecnico_Milano.png'}
versiontodelete.whattodel [{u'archivename': u'20170504031453!Logo_Politecnico_Milano.png'}, {u'archivename': u'20151105102246!Logo_Politecnico_Milano.png'}]

So del is removing only "u'filehidden': True," and leaving the archive name, thus the "Remove empty results" does not work as it's not empty

Ron.