Includes target contents into config.

        :param str|unicode|Section|list target: File path or Section to include.
2059
def include(self, target):
        
        for target_ in listify(target):
            if isinstance(target_, Section):
                target_ = ':' + target_.name

            self._set('ini', target_, multi=True)

        return self
157770
public static File[] listFiles(final File target, final List<Pattern> patterns, final boolean include) {
        if (patterns == null || patterns.isEmpty())
            return target.listFiles();

        return target.listFiles(new FilenameFilter() {

            @Override
            public boolean accept(File dir, String name) {
                for (Pattern pattern : patterns) {
                    Matcher matcher = pattern.matcher(name);
                    if (matcher.matches())
                        return include;
                }
                return !include;
            }

        });

    }
1063827
def add_section(self, section):
        
        self.config.read(self.filepath)
        self.config.add_section(section)
        with open(self.filepath, "w") as f:
            self.config.write(f)
1183784
def get_list(self, section, option):
        
        if self.has_option(section, option):
            return self.get(section, option).replace(' ', '').split(',')
        else:
            raise KeyError('{} with {} does not exist.'.format(section,
                                                               option))
1035910
def section(self, section):
        
        if isinstance(section, list):
            for h in section:
                self.add_section(h)
        else:
            self.add_section(section)
727222
def write(self, section, option, value):
        
        self.config.read(self.filepath)
        string = tidy_headers._parse_item.item2string(value, sep=", ")
        self.config.set(section, option, string)
        with open(self.filepath, "w") as f:
            self.config.write(f)
1178001
def config_file_contents
      output = []
      output << HEADING
      output << 'linters:' if linters_with_lints.any?
      linters_with_lints.each do |linter, files|
        output << generate_config_for_linter(linter, files)
      end
      output.join("\n\n")
    end
215590
function (targetFile, configItems) {
        var infoPlist = plist.parse(fs.readFileSync(targetFile, 'utf-8')),
            tempInfoPlist;

        configItems.forEach(function (item) {
            var key = item.parent;
            var plistXml = '<plist><dict><key>' + key + '</key>';
            plistXml += lib.eltreeToXmlString(item.data) + '</dict></plist>';

            var configPlistObj = plist.parse(plistXml);
            infoPlist[key] = configPlistObj[key];
        });

        tempInfoPlist = plist.build(infoPlist);
        tempInfoPlist = tempInfoPlist.replace(/<string>[\s\r\n]*<\/string>/g, '<string></string>');
        fs.writeFileSync(targetFile, tempInfoPlist, 'utf-8');
        console.log("* wrote iOS Plist: " + targetFile);
    }
74520
def merge_specs(target, source):
    

    for key, value in source.items():
        if isinstance(value, dict):
            node = target.setdefault(key, {})
            merge_specs(node, value)
        elif isinstance(value, list):
            node = target.setdefault(key, [])
            node.extend(value)
        else:
            target[key] = value
139634
def include(d, e):
    """"""

    return (d, [f for f in glob.glob('%s/%s' % (d, e)) if os.path.isfile(f)])
855158
def load(items, default_section=_DEFAULT_SECTION):
    
    settings = []

    assert isinstance(items, list), 'items必须为list'

    logger.debug(items)
    for item in items:
        if _is_conf(item):
            settings.append(load_from_ini(item, default_section))
        else:
            settings.append(load_from_name(item))
    logger.debug(settings)
    return merge(settings)
1007727
def write_config_file(self, f, comments):
        
        if len(self.elements) < 1:
            return
        super(_Section, self).write_config_file(f, comments)

        for e in self.elements.values():
            e.write_config_file(f, comments)
        f.write("\n")
966750
def setup(self, filepath):
        
        if self.log is not None:
            self.log.warning("Disallowed multiple setup of config.")
            return

        self.log = logging.getLogger(__name__)
        self.parser = ConfigParser.RawConfigParser()
        self.parser.read(filepath)
        self.sections = self.parser.sections()
        self.log_output.append(
            {"level": "info", "msg": "Loading config-file (%s)" % filepath})
        self.load_config()
        self.handle_logging()
76745
def get_targets(self):
        
        if not hasattr(self, "_targets"):
            targets = []
            for target_def in self.config.targets or []:
                target = Target(target_def)
                targets.append(target)
            self._targets = targets
        return self._targets
634577
def include_file(self, path, include_dirs = []):
        
        if self.include_includes:
            if self.debug: print("------------------                   Including a file: %s"%path)
            inc_dirs = include_dirs if include_dirs else self.include_dirs

            parser = LEMSFileParser(self, inc_dirs, self.include_includes)
            if os.access(path, os.F_OK):
                if not path in self.included_files:
                    parser.parse(open(path).read()) 
                    self.included_files.append(path)
                    return
                else:
                    if self.debug: print("Already included: %s"%path)
                    return
            else:
                for inc_dir in inc_dirs:
                    new_path = (inc_dir + '/' + path)
                    if os.access(new_path, os.F_OK):
                        if not new_path in self.included_files:
                            parser.parse(open(new_path).read())
                            self.included_files.append(new_path)
                            return
                        else:
                            if self.debug: print("Already included: %s"%path)
                            return
            msg = 'Unable to open ' + path
            if self.fail_on_missing_includes:
                raise Exception(msg)
            elif self.debug: 
                print(msg)
932170
def pack_found_items(self, s_text, target):
        
        all_children = self.all_children
        all_text = [target.GetItemText(i).lower() for i in all_children]

        found_items = [child for i, child in enumerate(all_children)
                       if s_text in all_text[i]]

        return found_items
22520
def get_targets(self, name=None):
        
        targets = []
        for section in self.get_sections():
            if section.endswith(u'Target'):
                targets += [value for value in self._sections[section]]

        if name is None:
            return targets

        if not isinstance(name, list):
            name = [name]

        return [target for target in targets if target.name in name]