def __call__(self,fname):
        """Return a runner for the given filename."""

        if fname.endswith('.py'):
            runnerClass = PythonRunner
        elif fname.endswith('.ipy'):
            runnerClass = IPythonRunner
        else:
            raise ValueError('Unknown file type for Runner: %r' % fname)

        if self.runner is None:
            return self._makeRunner(runnerClass)
        else:
            if runnerClass==self.runnerClass:
                return self.runner
            else:
                e='A runner of type %r can not run file %r' % \
                   (self.runnerClass,fname)
                raise ValueError(e)
def __call__ ( self , fname ) : if fname . endswith ( '.py' ) : runnerClass = PythonRunner elif fname . endswith ( '.ipy' ) : runnerClass = IPythonRunner else : raise ValueError ( 'Unknown file type for Runner: %r' % fname ) if self . runner is None : return self . _makeRunner ( runnerClass ) else : if runnerClass == self . runnerClass : return self . runner else : e = 'A runner of type %r can not run file %r' % ( self . runnerClass , fname ) raise ValueError ( e )
Return a runner for the given filename.