Ejemplo n.º 1
0
    def confObjCompare (self, objA, objB) :
        '''Do a simple compare on two ConfigObj objects.'''

        # Make a temp files for testing
        tmpconfA = tempfile.NamedTemporaryFile()
        tmpconfB = tempfile.NamedTemporaryFile()

        # There must be a better way to do this but this will work for now
        objA.filename = tmpconfA.name
        objA.write()
        objB.filename = tmpconfB.name
        objB.write()
        reObjA = ConfigObj(tmpconfA, encoding='utf-8')
        reObjB = ConfigObj(tmpconfB, encoding='utf-8')
        return reObjA.__eq__(reObjB)