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


Python gencache.GetGeneratePath方法代碼示例

本文整理匯總了Python中win32com.client.gencache.GetGeneratePath方法的典型用法代碼示例。如果您正苦於以下問題:Python gencache.GetGeneratePath方法的具體用法?Python gencache.GetGeneratePath怎麽用?Python gencache.GetGeneratePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在win32com.client.gencache的用法示例。


在下文中一共展示了gencache.GetGeneratePath方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: GenerateChildFromTypeLibSpec

# 需要導入模塊: from win32com.client import gencache [as 別名]
# 或者: from win32com.client.gencache import GetGeneratePath [as 別名]
def GenerateChildFromTypeLibSpec(child, typelibInfo, verboseLevel = None, progressInstance = None, bUnicodeToString=None):
	assert bUnicodeToString is None, "this is deprecated and will go away"
	if verboseLevel is None:
		verboseLevel = 0 # By default, we use no gui, and no verbose level for the children.
	if type(typelibInfo)==type(()):
		typelibCLSID, lcid, major, minor  = typelibInfo
		tlb = pythoncom.LoadRegTypeLib(typelibCLSID, major, minor, lcid)
	else:
		tlb = typelibInfo
		tla = typelibInfo.GetLibAttr()
		typelibCLSID = tla[0]
		lcid = tla[1]
		major = tla[3]
		minor = tla[4]
	spec = selecttlb.TypelibSpec(typelibCLSID, lcid, major, minor)
	spec.FromTypelib(tlb, str(typelibCLSID))
	typelibs = [(tlb, spec)]

	if progressInstance is None:
		progressInstance = SimpleProgress(verboseLevel)
	progress = progressInstance

	for typelib, info in typelibs:
		dir_name = gencache.GetGeneratedFileName(info.clsid, info.lcid, info.major, info.minor)
		dir_path_name = os.path.join(gencache.GetGeneratePath(), dir_name)
		progress.LogBeginGenerate(dir_path_name)

		gen = genpy.Generator(typelib, info.dll, progress)
		gen.generate_child(child, dir_path_name)
		progress.SetDescription("Importing module")
		__import__("win32com.gen_py." + dir_name + "." + child)
	progress.Close() 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:34,代碼來源:makepy.py


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