本文整理汇总了Python中fileinfo.FileInfo.extract方法的典型用法代码示例。如果您正苦于以下问题:Python FileInfo.extract方法的具体用法?Python FileInfo.extract怎么用?Python FileInfo.extract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fileinfo.FileInfo
的用法示例。
在下文中一共展示了FileInfo.extract方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_message
# 需要导入模块: from fileinfo import FileInfo [as 别名]
# 或者: from fileinfo.FileInfo import extract [as 别名]
# would work just as well.
filename_regex = r"^.*SuperSU.*\.zip$"
# This is the type of ramdisk. Run the 'list-ramdisks' file in the useful/
# folder to see what choices are available. (It's pretty obvious, you'll see)
file_info.ramdisk = 'jflte/AOSP/AOSP.def'
# If the zip file you're patching does not have a kernel, set this to false.
file_info.has_boot_image = True
# If the boot image has a different name or is in a subfolder, change this.
file_info.bootimg = 'boot.img'
# These two lines enable the autopatcher. In most cases, this is sufficient.
file_info.patch = autopatcher.auto_patch
file_info.extract = autopatcher.files_to_auto_patch
# If, for whatever reason, the autopatcher doesn't work, uncomment this line,
# copy your patch to patches/ and put the patch here.
#file_info.patch = 'jflte/AOSP/YourROM.patch'
def print_message():
# This is the message that is shown if the file to be patched is this one.
print("Detected The Name of Some ROM")
###
def matches(filename):
if re.search(filename_regex, filename):
return True
else:
return False