'Removes screenshots'

def removescreenshot(self, host, port=None, protocol='tcp', archive=False):

    changed = False
    for p in host.get('ports', []):
        if ((port is None) or ((p['port'] == port) and (p.get('protocol') == protocol))):
            if ('screenshot' in p):
                if (p['screenshot'] == 'field'):
                    if ('screendata' in p):
                        del p['screendata']
                if ('screenwords' in p):
                    del p['screenwords']
                del p['screenshot']
                changed = True
    if changed:
        self.db[(self.colname_oldhosts if archive else self.colname_hosts)].update({'_id': host['_id']}, {'$set': {'ports': host['ports']}})
