Logo Search packages:      
Sourcecode: uicilibris version File versions  Download package

def uicilibris::wikiParser::wikiParser::include_file_recursive (   self,
  base 
)
makes a list of lines from a file, including recursively
other files when necessary
@param base the name of the file to process
@return a list of lines

Definition at line 448 of file wikiParser.py.

                                          :
        """
        makes a list of lines from a file, including recursively
        other files when necessary
        @param base the name of the file to process
        @return a list of lines
        """
        stack = []
        output = []
        def recurse(file_):
            stack.append(file_)
            nowikimode = False
            codemode = False
            for line in self.cache.getLines(file_):
                if nowikimode or codemode:
                    if nowikiendre.match(line):
                        nowikimode = False
                    elif codeendre.match(line):
                        codemode = False
                    output.append(line)
                elif nowikistartre.match(line):
                    output.append(line)
                    nowikimode = True
                elif codestartre.match(line):
                    output.append(line)
                    codemode = True
                else:
                    include = self.includeInstruction(line)
                    if include is not None:
                        if include in stack:
                            raise IncludeLoopException('Loop detected while trying '
                                    "to include: '%s'.\n" % include +
                                    'Stack: '+ "->".join(stack))
                        else:
                            recurse(include)
                    else:
                        output.append(line)
            stack.pop()
        recurse(base)
        return output


Generated by  Doxygen 1.6.0   Back to index