(self, newfile)
return (newfile, open(newfile, "r"))
Hook called on a filename to be sourced.
Hook called on a filename to be sourced.
Hook called on a filename to be sourced .
def sourcehook(self, newfile):
        "Hook called on a filename to be sourced."
        if newfile[0] == '"':
            newfile = newfile[1:-1]
        # This implements cpp-like semantics for relative-path inclusion.
        if isinstance(self.infile, str) and not os.path.isabs(newfile):
            newfile = os.path.join(os.path.dirname(self.infile), newfile)
        return (newfile, open(newfile, "r"))
def sourcehook ( self , newfile ) : if newfile [ 0 ] == '"' : newfile = newfile [ 1 : - 1 ] # This implements cpp-like semantics for relative-path inclusion. if isinstance ( self . infile , str ) and not os . path . isabs ( newfile ) : newfile = os . path . join ( os . path . dirname ( self . infile ) , newfile ) return ( newfile , open ( newfile , "r" ) )