def testme(): # text = 'Thu, 16 Dec 2010 12:14:05 +0000' # date = (dateutil.parser.parse(text)) # print(date.isoformat()) # # 2010-12-16T12:14:05+00:00 # sys.exit() q1 = MediaItem(_CFG, _CFG['accountId']) q1.Query(_CFG['query']) log("Query returned [{0}] items.".format(q1.QueryCount())) item = q1.Next() while item: print "item: [{0}]: id: {1} refid: {2}".format(q1.returnedCount,item['id'], item['reference_id']) # r = q1.Delete(item['id']) # if r: # log("Delete failed: [{0}]".format(r)) item = q1.Next()
def deleteMediaItems(): q1 = MediaItem(_CFG, _CFG['accountId']) q1.Query(_CFG['query']) log("Query returned [{0}] items.".format(q1.QueryCount())) item = q1.Next() while item: print "Deleting: [{0}]: id: {1} refid: {2}".format(q1.returnedCount,item['id'], item['reference_id']) r = q1.Delete(item['id']) if r: log("Delete failed: [{0}]".format(r)) item = q1.Next()