本文整理汇总了Python中kiwi.defaults.Defaults.get_publisher方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_publisher方法的具体用法?Python Defaults.get_publisher怎么用?Python Defaults.get_publisher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.defaults.Defaults
的用法示例。
在下文中一共展示了Defaults.get_publisher方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_publisher [as 别名]
def __init__(self, xml_state, target_dir, root_dir, custom_args=None):
self.media_dir = None
self.live_container_dir = None
self.arch = platform.machine()
if self.arch == 'i686' or self.arch == 'i586':
self.arch = 'ix86'
self.root_dir = root_dir
self.target_dir = target_dir
self.xml_state = xml_state
self.live_type = xml_state.build_type.get_flags()
self.volume_id = xml_state.build_type.get_volid() or \
Defaults.get_volume_id()
self.mbrid = SystemIdentifier()
self.mbrid.calculate_id()
self.filesystem_custom_parameters = {
'mount_options': xml_state.get_fs_mount_option_list()
}
self.publisher = xml_state.build_type.get_publisher() or \
Defaults.get_publisher()
if not self.live_type:
self.live_type = Defaults.get_default_live_iso_type()
self.boot_image = BootImageDracut(
xml_state, target_dir, self.root_dir
)
self.firmware = FirmWare(
xml_state
)
self.system_setup = SystemSetup(
xml_state=xml_state, root_dir=self.root_dir
)
self.isoname = ''.join(
[
target_dir, '/',
xml_state.xml_data.get_name(),
'.' + platform.machine(),
'-' + xml_state.get_image_version(),
'.iso'
]
)
self.result = Result(xml_state)
self.runtime_config = RuntimeConfig()
示例2: test_get_publisher
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_publisher [as 别名]
def test_get_publisher(self):
assert Defaults.get_publisher() == 'SUSE LINUX GmbH'
示例3: create
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_publisher [as 别名]
def create(self):
"""
Build a bootable hybrid live ISO image
Image types which triggers this builder are:
* image="iso"
:raises KiwiLiveBootImageError: if no kernel or hipervisor is found
in boot image tree
:return: result
:rtype: instance of :class:`Result`
"""
# media dir to store CD contents
self.media_dir = mkdtemp(
prefix='live-media.', dir=self.target_dir
)
# unpack cdroot user files to media dir
self.system_setup.import_cdroot_files(self.media_dir)
rootsize = SystemSize(self.media_dir)
# custom iso metadata
log.info('Using following live ISO metadata:')
log.info('--> Application id: {0}'.format(self.mbrid.get_id()))
log.info('--> Publisher: {0}'.format(Defaults.get_publisher()))
log.info('--> Volume id: {0}'.format(self.volume_id))
custom_iso_args = {
'meta_data': {
'publisher': self.publisher,
'preparer': Defaults.get_preparer(),
'volume_id': self.volume_id,
'mbr_id': self.mbrid.get_id(),
'efi_mode': self.firmware.efi_mode()
}
}
# pack system into live boot structure as expected by dracut
log.info(
'Packing system into dracut live ISO type: {0}'.format(
self.live_type
)
)
root_filesystem = Defaults.get_default_live_iso_root_filesystem()
filesystem_custom_parameters = {
'mount_options': self.xml_state.get_fs_mount_option_list()
}
filesystem_setup = FileSystemSetup(
self.xml_state, self.root_dir
)
root_image = NamedTemporaryFile()
loop_provider = LoopDevice(
root_image.name,
filesystem_setup.get_size_mbytes(root_filesystem),
self.xml_state.build_type.get_target_blocksize()
)
loop_provider.create()
live_filesystem = FileSystem(
name=root_filesystem,
device_provider=loop_provider,
root_dir=self.root_dir + os.sep,
custom_args=filesystem_custom_parameters
)
live_filesystem.create_on_device()
log.info(
'--> Syncing data to {0} root image'.format(root_filesystem)
)
live_filesystem.sync_data(
Defaults.get_exclude_list_for_root_data_sync()
)
log.info('--> Creating squashfs container for root image')
self.live_container_dir = mkdtemp(
prefix='live-container.', dir=self.target_dir
)
Path.create(self.live_container_dir + '/LiveOS')
shutil.copy(
root_image.name, self.live_container_dir + '/LiveOS/rootfs.img'
)
live_container_image = FileSystem(
name='squashfs',
device_provider=None,
root_dir=self.live_container_dir
)
container_image = NamedTemporaryFile()
live_container_image.create_on_file(
container_image.name
)
Path.create(self.media_dir + '/LiveOS')
shutil.copy(
container_image.name, self.media_dir + '/LiveOS/squashfs.img'
)
# setup bootloader config to boot the ISO via isolinux
log.info('Setting up isolinux bootloader configuration')
bootloader_config_isolinux = BootLoaderConfig(
'isolinux', self.xml_state, self.media_dir
)
bootloader_config_isolinux.setup_live_boot_images(
#.........这里部分代码省略.........