本文整理汇总了Python中pykickstart.base.KickstartCommand.__setattr__方法的典型用法代码示例。如果您正苦于以下问题:Python KickstartCommand.__setattr__方法的具体用法?Python KickstartCommand.__setattr__怎么用?Python KickstartCommand.__setattr__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykickstart.base.KickstartCommand
的用法示例。
在下文中一共展示了KickstartCommand.__setattr__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __setattr__
# 需要导入模块: from pykickstart.base import KickstartCommand [as 别名]
# 或者: from pykickstart.base.KickstartCommand import __setattr__ [as 别名]
def __setattr__(self, name, value):
if name in self.internals:
if name == "method":
self._clear_seen()
if name == "method" and value == "cdrom":
setattr(self.handler.cdrom, "seen", True)
elif name == "method" and value == "harddrive":
setattr(self.handler.harddrive, "seen", True)
elif name == "method" and value == "nfs":
setattr(self.handler.nfs, "seen", True)
elif name == "method" and value == "url":
setattr(self.handler.url, "seen", True)
KickstartCommand.__setattr__(self, name, value)
elif self.handler.cdrom.seen:
setattr(self.handler.cdrom, name, value)
elif self.handler.harddrive.seen:
setattr(self.handler.harddrive, name, value)
elif self.handler.nfs.seen:
setattr(self.handler.nfs, name, value)
else:
setattr(self.handler.url, name, value)