test

C code posted by thomas guittonneau
created at 19 Feb 11:46, updated at 21 Feb 05:59

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
                if include in module:
                    del(self.previousModules[module])

    def new(self):
        return list( set( sys.modules ).difference(set( self.previousModules )) )

    def rollback(self):
        new=self.new()

        #force reload when modname next imported
        for module in new:
            if sys.modules.has_key(module):
                if sys.modules[module]: print 'reload %s'%sys.modules[module]
                del(sys.modules[module])

        #clean sys.modules dict
        for module in sys.modules.keys():
572 Bytes in 2 ms with coderay