本文整理汇总了Python中multiboot.patchinfo.PatchInfo.on_filename_set方法的典型用法代码示例。如果您正苦于以下问题:Python PatchInfo.on_filename_set方法的具体用法?Python PatchInfo.on_filename_set怎么用?Python PatchInfo.on_filename_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiboot.patchinfo.PatchInfo
的用法示例。
在下文中一共展示了PatchInfo.on_filename_set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PatchInfo
# 需要导入模块: from multiboot.patchinfo import PatchInfo [as 别名]
# 或者: from multiboot.patchinfo.PatchInfo import on_filename_set [as 别名]
from multiboot.autopatchers.standard import StandardPatcher
from multiboot.autopatchers.jflte import GoogleEditionPatcher
from multiboot.patchinfo import PatchInfo
import os
patchinfo = PatchInfo()
patchinfo.matches = r"^K[BK]-.*\.zip$"
patchinfo.name = 'Kangabean/Kangakat'
patchinfo.ramdisk = 'jflte/GoogleEdition/GoogleEdition.def'
def on_filename_set(patchinfo, filename):
filename = os.path.split(filename)[1]
if filename.startswith("KK"):
patchinfo.autopatchers= [StandardPatcher, GoogleEditionPatcher]
elif filename.startswith("KB"):
patchinfo.autopatchers= [StandardPatcher]
patchinfo.on_filename_set = on_filename_set