def run(self):
    env = self.state.document.settings.env
    result = ViewList()
    for pattern in self.arguments[0].split():
        filenames = glob.glob(((env.config.cautodoc_root + '/') + pattern))
        if (len(filenames) == 0):
            fmt = 'Pattern "{pat}" does not match any files.'
            env.app.warn(fmt.format(pat=pattern), location=(env.docname, self.lineno))
            continue
        for filename in filenames:
            mode = os.stat(filename).st_mode
            if stat.S_ISDIR(mode):
                fmt = 'Path "{name}" matching pattern "{pat}" is a directory.'
                env.app.warn(fmt.format(name=filename, pat=pattern), location=(env.docname, self.lineno))
                continue
            env.note_dependency(os.path.abspath(filename))
            self.__parse(result, filename)
    with switch_source_input(self.state, result):
        node = nodes.section()
        nested_parse_with_titles(self.state, result, node)
    return node.children
def run(self):
    env = self.state.document.settings.env
    result = ViewList()
    for pattern in self.arguments[0].split():
        filenames = glob.glob(((env.config.cautodoc_root + '/') + pattern))
        if (len(filenames) == 0):
            fmt = 'Pattern "{pat}" does not match any files.'
            env.app.warn(fmt.format(pat=pattern), location=(env.docname, self.lineno))
            continue
        for filename in filenames:
            mode = os.stat(filename).st_mode
            if stat.S_ISDIR(mode):
                fmt = 'Path "{name}" matching pattern "{pat}" is a directory.'
                env.app.warn(fmt.format(name=filename, pat=pattern), location=(env.docname, self.lineno))
                continue
            env.note_dependency(os.path.abspath(filename))
            self.__parse(result, filename)
    with switch_source_input(self.state, result):
        node = nodes.section()
        nested_parse_with_titles(self.state, result, node)
    return node.children