本文整理匯總了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