当前位置: 首页>>代码示例>>Python>>正文


Python Values.from_list方法代码示例

本文整理汇总了Python中conans.model.values.Values.from_list方法的典型用法代码示例。如果您正苦于以下问题:Python Values.from_list方法的具体用法?Python Values.from_list怎么用?Python Values.from_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在conans.model.values.Values的用法示例。


在下文中一共展示了Values.from_list方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: settings_defaults

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
 def settings_defaults(self, settings):
     default_settings = self.get_conf("settings_defaults")
     values = Values.from_list(default_settings)
     settings.values = values
     mixed_settings = _mix_settings_with_env(default_settings)
     values = Values.from_list(mixed_settings)
     settings.values = values
开发者ID:nesono,项目名称:conan,代码行数:9,代码来源:__init__.py

示例2: from_list

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
 def from_list(data):
     result = OptionsValues()
     by_package = defaultdict(list)
     for k, v in data:
         tokens = k.split(":")
         if len(tokens) == 2:
             package, option = tokens
             by_package[package.strip()].append((option, v))
         else:
             by_package[None].append((k, v))
     result._options = Values.from_list(by_package[None])
     for k, v in by_package.items():
         if k is not None:
             result._reqs_options[k] = Values.from_list(v)
     return result
开发者ID:NoWiseMan,项目名称:conan,代码行数:17,代码来源:options.py

示例3: _loader

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
    def _loader(self, current_path=None, user_settings_values=None, user_options_values=None,
                scopes=None):
        # The disk settings definition, already including the default disk values
        settings = self._paths.settings
        options = OptionsValues()
        conaninfo_scopes = Scopes()

        if current_path:
            conan_info_path = os.path.join(current_path, CONANINFO)
            if os.path.exists(conan_info_path):
                existing_info = ConanInfo.load_file(conan_info_path)
                settings.values = existing_info.full_settings
                options = existing_info.full_options  # Take existing options from conaninfo.txt
                conaninfo_scopes = existing_info.scope

        if user_settings_values:
            aux_values = Values.from_list(user_settings_values)
            settings.values = aux_values

        if user_options_values is not None:  # Install will pass an empty list []
            # Install OVERWRITES options, existing options in CONANINFO are not taken
            # into account, just those from CONANFILE + user command line
            options = OptionsValues.from_list(user_options_values)

        if scopes:
            conaninfo_scopes.update_scope(scopes)

        self._current_scopes = conaninfo_scopes
        return ConanFileLoader(self._runner, settings, options=options, scopes=conaninfo_scopes)
开发者ID:JustgeekDE,项目名称:conan,代码行数:31,代码来源:manager.py

示例4: simple_test

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
    def simple_test(self):
        v = Values()
        self.assertEqual(v.compiler, None)
        v.compiler = 3
        self.assertTrue(v.compiler == "3")

        self.assertEqual(v.compiler.version, None)
        v.compiler.version = "asfaf"
        self.assertEqual(v.compiler.version, "asfaf")

        my_list = v.as_list()
        self.assertEqual(my_list, [("compiler", "3"), ("compiler.version", "asfaf")])

        values = Values.from_list(my_list)
        self.assertEqual(values.dumps(), v.dumps())

        v.compiler = None
        self.assertEqual(v.as_list(), [("compiler", "None")])
        self.assertEqual(v.dumps(), "compiler=None")
开发者ID:davidsanfal,项目名称:conan,代码行数:21,代码来源:values_test.py

示例5: load_conan

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
    def load_conan(self, conanfile_path, output, consumer=False, reference=None, local=False):
        """ loads a ConanFile object from the given file
        """
        result = load_conanfile_class(conanfile_path)
        try:
            # Prepare the settings for the loaded conanfile
            # Mixing the global settings with the specified for that name if exist
            tmp_settings = self._settings.copy()
            if self._package_settings and result.name in self._package_settings:
                # Update the values, keeping old ones (confusing assign)
                values_tuple = self._package_settings[result.name]
                tmp_settings.values = Values.from_list(values_tuple)

            if reference:
                result.name = reference.name
                result.version = reference.version
                user, channel = reference.user, reference.channel
            else:
                user, channel = None, None

            # Instance the conanfile
            result = result(output, self._runner, tmp_settings, user, channel, local)

            # Assign environment
            result._env_values.update(self._env_values)

            if consumer:
                self._user_options.descope_options(result.name)
                result.options.initialize_upstream(self._user_options, local=local)
                self._user_options.clear_unscoped_options()
            else:
                result.in_local_cache = True

            if consumer or (self.dev_reference and self.dev_reference == reference):
                result.develop = True

            return result
        except Exception as e:  # re-raise with file name
            raise ConanException("%s: %s" % (conanfile_path, str(e)))
开发者ID:19317362,项目名称:conan,代码行数:41,代码来源:loader.py

示例6: settings_defaults

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
 def settings_defaults(self):
     default_settings = self.get_conf("settings_defaults")
     values = Values.from_list(default_settings)
     return values
开发者ID:davidsanfal,项目名称:conan,代码行数:6,代码来源:__init__.py

示例7: values

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
 def values(self):
     result = OptionsValues()
     result._options = Values.from_list(self._options.values_list)
     for k, v in self._reqs_options.items():
         result._reqs_options[k] = v.copy()
     return result
开发者ID:NoWiseMan,项目名称:conan,代码行数:8,代码来源:options.py

示例8: generate_default_config_file

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
 def generate_default_config_file():
     default_settings = detect_defaults_settings(self._output)
     default_setting_values = Values.from_list(default_settings)
     client_conf = default_client_conf + default_setting_values.dumps()
     save(self.conan_conf_path, client_conf)
开发者ID:WimK,项目名称:conan,代码行数:7,代码来源:paths.py

示例9: values

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
 def values(self):
     return Values.from_list(self.values_list)
开发者ID:SteffenL,项目名称:conan,代码行数:4,代码来源:config_dict.py

示例10: settings_values

# 需要导入模块: from conans.model.values import Values [as 别名]
# 或者: from conans.model.values.Values import from_list [as 别名]
 def settings_values(self):
     return Values.from_list(list(self.settings.items()))
开发者ID:nesono,项目名称:conan,代码行数:4,代码来源:profile.py


注:本文中的conans.model.values.Values.from_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。