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


Python Defaults.get_filesystem_image_types方法代码示例

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


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

示例1: __new__

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_image_types [as 别名]
 def __new__(self, xml_state, target_dir, root_dir, custom_args=None):
     requested_image_type = xml_state.get_build_type_name()
     if requested_image_type in Defaults.get_filesystem_image_types():
         return FileSystemBuilder(
             xml_state, target_dir, root_dir
         )
     elif requested_image_type in Defaults.get_disk_image_types():
         return DiskBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_live_image_types():
         return LiveImageBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_network_image_types():
         return PxeBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_archive_image_types():
         return ArchiveBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_container_image_types():
         return ContainerBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     else:
         raise KiwiRequestedTypeError(
             'requested image type %s not supported' % requested_image_type
         )
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:32,代码来源:__init__.py

示例2: __init__

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_image_types [as 别名]
 def __init__(self, xml_state, root_dir):
     self.configured_size = xml_state.get_build_type_size()
     self.size = SystemSize(root_dir)
     self.requested_image_type = xml_state.get_build_type_name()
     if self.requested_image_type in Defaults.get_filesystem_image_types():
         self.requested_filesystem = self.requested_image_type
     else:
         self.requested_filesystem = xml_state.build_type.get_filesystem()
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:10,代码来源:setup.py

示例3: create

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_image_types [as 别名]
    def create(self):
        """
        Build a mountable filesystem image

        Image types which triggers this builder are:

        * image="ext2"
        * image="ext3"
        * image="ext4"
        * image="btrfs"
        * image="xfs"

        :return: result

        :rtype: instance of :class:`Result`
        """
        log.info(
            'Creating %s filesystem', self.requested_filesystem
        )
        supported_filesystems = Defaults.get_filesystem_image_types()
        if self.requested_filesystem not in supported_filesystems:
            raise KiwiFileSystemSetupError(
                'Unknown filesystem: %s' % self.requested_filesystem
            )
        if self.requested_filesystem not in self.filesystems_no_device_node:
            self._operate_on_loop()
        else:
            self._operate_on_file()
        self.result.verify_image_size(
            self.runtime_config.get_max_size_constraint(),
            self.filename
        )
        self.result.add(
            key='filesystem_image',
            filename=self.filename,
            use_for_bundle=True,
            compress=True,
            shasum=True
        )
        self.result.add(
            key='image_packages',
            filename=self.system_setup.export_package_list(
                self.target_dir
            ),
            use_for_bundle=True,
            compress=False,
            shasum=False
        )
        self.result.add(
            key='image_verified',
            filename=self.system_setup.export_package_verification(
                self.target_dir
            ),
            use_for_bundle=True,
            compress=False,
            shasum=False
        )
        return self.result
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:60,代码来源:filesystem.py

示例4: __init__

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_image_types [as 别名]
 def __init__(self, xml_state, root_dir):
     self.configured_size = xml_state.get_build_type_size(
         include_unpartitioned=True
     )
     if xml_state.get_build_type_unpartitioned_bytes() > 0:
         log.warning(
             'Unpartitoned size attribute is ignored for filesystem images'
         )
     self.size = SystemSize(root_dir)
     self.requested_image_type = xml_state.get_build_type_name()
     if self.requested_image_type in Defaults.get_filesystem_image_types():
         self.requested_filesystem = self.requested_image_type
     else:
         self.requested_filesystem = xml_state.build_type.get_filesystem()
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:16,代码来源:setup.py


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