本文整理汇总了Python中winerror.ERROR_RESOURCE_DATA_NOT_FOUND属性的典型用法代码示例。如果您正苦于以下问题:Python winerror.ERROR_RESOURCE_DATA_NOT_FOUND属性的具体用法?Python winerror.ERROR_RESOURCE_DATA_NOT_FOUND怎么用?Python winerror.ERROR_RESOURCE_DATA_NOT_FOUND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类winerror
的用法示例。
在下文中一共展示了winerror.ERROR_RESOURCE_DATA_NOT_FOUND属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: extract_manifest
# 需要导入模块: import winerror [as 别名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(handle, RT_MANIFEST, resource_name)
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例2: extract_manifest
# 需要导入模块: import winerror [as 别名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(
handle, RT_MANIFEST, resource_name).decode('utf-8', 'ignore')
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例3: extract_manifest
# 需要导入模块: import winerror [as 别名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(handle, RT_MANIFEST, resource_name)
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例4: extract_manifest
# 需要导入模块: import winerror [as 别名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 别名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(
handle, RT_MANIFEST, resource_name).decode('utf-8', 'ignore')
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise