當前位置: 首頁>>代碼示例>>Python>>正文


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怎麽用?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 
開發者ID:refack,項目名稱:GYP3,代碼行數:13,代碼來源:gyptest-link-generate-manifest.py

示例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 
開發者ID:refack,項目名稱:GYP3,代碼行數:14,代碼來源:gyptest-link-update-manifest.py

示例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 
開發者ID:turbulenz,項目名稱:gyp,代碼行數:13,代碼來源:gyptest-link-generate-manifest.py

示例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 
開發者ID:turbulenz,項目名稱:gyp,代碼行數:14,代碼來源:gyptest-link-update-manifest.py


注:本文中的winerror.ERROR_RESOURCE_DATA_NOT_FOUND屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。