# Path: vmcatcher/__version__.py

# 
# Path: vmcatcher/listutils.py
# def pairsNnot(list_a,list_b):
#     len_generate_list = len(list_a)
#     len_image_list = len(list_b)
#     ocupies_generate_list = set(range(len_generate_list))
#     ocupies_image_list = set(range(len_image_list))
#     ocupies_pairs = ocupies_image_list.intersection(ocupies_generate_list)
#     diff_a = ocupies_generate_list.difference(ocupies_image_list)
#     diff_b = ocupies_image_list.difference(ocupies_generate_list)
#     arepairs = []
#     for i in ocupies_pairs:
#         arepairs.append([list_a[i],list_b[i]])
#     notpairs_a = []
#     for i in diff_a:
#         notpairs_a.append(list_a[i])
#     notpairs_b = []
#     for i in diff_b:
#         notpairs_b.append(list_b[i])
# 
#     return arepairs,notpairs_a,notpairs_b


from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from smimeX509validation import TrustStore, LoadDirChainOfTrust,smimeX509validation, smimeX509ValidationError
from vmcatcher.__version__ import version
from hepixvmitrust.vmitrustlib import VMimageListDecoder as VMimageListDecoder
from hepixvmitrust.vmitrustlib import time_format_definition as time_format_definition
from vmcatcher.listutils import pairsNnot
from M2Crypto import SMIME, X509, BIO
import vmcatcher.databaseDefinition as model
import os
import logging
import optparse
import vmcatcher
import urllib2
import urllib
import hashlib
import datetime
import vmcatcher.queryby
    import simplejson as json
    import json
import sys
import vmcatcher.outputfacard
        for item in extra_selectors:
            pairs.append([item,None])

        NoErrorHappened = True
        Session = self.SessionFactory()

        for pair in pairs:
            selector_filter = pair[0]
            output_file_name = pair[1]
            output_fileptr = sys.stdout
            if output_file_name != None:
                output_fileptr = open(output_file_name,'w+')
                output_fileptr.flush()

            queryImageDef = self.selector_curent(Session, selector_filter)
            if queryImageDef.count() == 0:
                self.log.warning("Selections '%s' does not match any known images." % (selector_filter))
                continue
            #view = self.factory_view(output_fileptr,Session,self.anchor)
            self._outputter.fpOutput = output_fileptr
            self._outputter.saSession = Session
            self._outputter.x509anchor = self.anchor
            for imagedef in queryImageDef:
                good = self._outputter.display_imagedef(imagedef)
                if good != True:
                    NoErrorHappened = False
            if output_file_name != None:
                output_fileptr.close()
        return NoErrorHappened


# Path: vmcatcher/__version__.py

# 
# Path: vmcatcher/listutils.py
# def pairsNnot(list_a,list_b):
#     len_generate_list = len(list_a)
#     len_image_list = len(list_b)
#     ocupies_generate_list = set(range(len_generate_list))
#     ocupies_image_list = set(range(len_image_list))
#     ocupies_pairs = ocupies_image_list.intersection(ocupies_generate_list)
#     diff_a = ocupies_generate_list.difference(ocupies_image_list)
#     diff_b = ocupies_image_list.difference(ocupies_generate_list)
#     arepairs = []
#     for i in ocupies_pairs:
#         arepairs.append([list_a[i],list_b[i]])
#     notpairs_a = []
#     for i in diff_a:
#         notpairs_a.append(list_a[i])
#     notpairs_b = []
#     for i in diff_b:
#         notpairs_b.append(list_b[i])
# 
#     return arepairs,notpairs_a,notpairs_b


# Path: vmcatcher/vmcatcher_image/controler.py
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from smimeX509validation import TrustStore, LoadDirChainOfTrust,smimeX509validation, smimeX509ValidationError
from vmcatcher.__version__ import version
from hepixvmitrust.vmitrustlib import VMimageListDecoder as VMimageListDecoder
from hepixvmitrust.vmitrustlib import time_format_definition as time_format_definition
from vmcatcher.listutils import pairsNnot
from M2Crypto import SMIME, X509, BIO
import vmcatcher.databaseDefinition as model
import os
import logging
import optparse
import vmcatcher
import urllib2
import urllib
import hashlib
import datetime
import vmcatcher.queryby
    import simplejson as json
    import json
import sys
import vmcatcher.outputfacard

        for item in extra_selectors:
            pairs.append([item,None])

        NoErrorHappened = True
        Session = self.SessionFactory()

        for pair in pairs:
            selector_filter = pair[0]
            output_file_name = pair[1]
            output_fileptr = sys.stdout
            if output_file_name != None:
                output_fileptr = open(output_file_name,'w+')
                output_fileptr.flush()

            queryImageDef = self.selector_curent(Session, selector_filter)
            if queryImageDef.count() == 0:
                self.log.warning("Selections '%s' does not match any known images." % (selector_filter))
                continue
            #view = self.factory_view(output_fileptr,Session,self.anchor)
            self._outputter.fpOutput = output_fileptr
            self._outputter.saSession = Session
            self._outputter.x509anchor = self.anchor
            for imagedef in queryImageDef:
                good = self._outputter.display_imagedef(imagedef)
                if good != True:
                    NoErrorHappened = False
            if output_file_name != None:
                output_fileptr.close()
        return NoErrorHappened


    def image_list(self):