本文整理汇总了Python中arelle.PluginManager.moduleModuleInfo方法的典型用法代码示例。如果您正苦于以下问题:Python PluginManager.moduleModuleInfo方法的具体用法?Python PluginManager.moduleModuleInfo怎么用?Python PluginManager.moduleModuleInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arelle.PluginManager
的用法示例。
在下文中一共展示了PluginManager.moduleModuleInfo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: selectLocally
# 需要导入模块: from arelle import PluginManager [as 别名]
# 或者: from arelle.PluginManager import moduleModuleInfo [as 别名]
def selectLocally(self):
choices = [] # list of tuple of (file name, description)
def sortOrder(key):
return {"EdgarRenderer": "1",
"validate": "2",
"xbrlDB": "3"}.get(key, "4") + key.lower()
def selectChoices(dir, indent=""):
dirHasEntries = False
for f in sorted(os.listdir(dir), key=sortOrder):
if f not in (".", "..", "__pycache__", "__init__.py"):
fPath = os.path.join(dir, f)
fPkgInit = os.path.join(fPath, "__init__.py")
dirInsertPoint = len(choices)
moduleInfo = None
if ((os.path.isdir(fPath) and os.path.exists(fPkgInit)) or
((os.path.isfile(fPath) and f.endswith(".py")))):
moduleInfo = PluginManager.moduleModuleInfo(fPath)
if moduleInfo:
choices.append((indent + f,
"name: {}\ndescription: {}\n version {}".format(
moduleInfo["name"],
moduleInfo["description"],
moduleInfo.get("version")),
fPath, moduleInfo["name"], moduleInfo.get("version"), moduleInfo["description"]))
dirHasEntries = True
if os.path.isdir(fPath) and f not in ("DQC_US_Rules",):
if selectChoices(fPath, indent=indent + " ") and not moduleInfo:
choices.insert(dirInsertPoint, (indent + f,None,None,None,None,None))
return dirHasEntries
selectChoices(self.cntlr.pluginDir)
selectedPath = DialogOpenArchive.selectPlugin(self, choices)
if selectedPath:
moduleInfo = PluginManager.moduleModuleInfo(selectedPath)
self.loadFoundModuleInfo(moduleInfo, selectedPath)
示例2: moduleReload
# 需要导入模块: from arelle import PluginManager [as 别名]
# 或者: from arelle.PluginManager import moduleModuleInfo [as 别名]
def moduleReload(self):
if self.selectedModule in self.pluginConfig["modules"]:
url = self.pluginConfig["modules"][self.selectedModule].get("moduleURL")
if url:
moduleInfo = PluginManager.moduleModuleInfo(url, reload=True)
if moduleInfo:
self.addPluginConfigModuleInfo(moduleInfo)
self.loadTreeViews()
self.cntlr.showStatus(_("{0} reloaded").format(moduleInfo.get("name")), clearAfter=5000)
示例3: findLocally
# 需要导入模块: from arelle import PluginManager [as 别名]
# 或者: from arelle.PluginManager import moduleModuleInfo [as 别名]
def findLocally(self):
filename = self.cntlr.uiFileDialog("open",
owner=self,
title=_("Choose plug-in module file"),
initialdir=self.cntlr.config.setdefault("pluginOpenDir","."),
filetypes=[(_("Python files"), "*.py")],
defaultextension=".py")
if filename:
self.cntlr.config["pluginOpenDir"] = os.path.dirname(filename)
moduleInfo = PluginManager.moduleModuleInfo(filename)
self.loadFoundModuleInfo(moduleInfo, filename)
示例4: moduleReload
# 需要导入模块: from arelle import PluginManager [as 别名]
# 或者: from arelle.PluginManager import moduleModuleInfo [as 别名]
def moduleReload(self):
if self.selectedModule in self.pluginConfig["modules"]:
url = self.pluginConfig["modules"][self.selectedModule].get("moduleURL")
if url:
moduleInfo = PluginManager.moduleModuleInfo(url, reload=True)
if moduleInfo:
self.addPluginConfigModuleInfo(moduleInfo)
self.loadTreeViews()
self.cntlr.showStatus(_("{0} reloaded").format(moduleInfo.get("name")), clearAfter=5000)
else:
messagebox.showwarning(_("Module error"),
_("File or module cannot be reloaded: \n\n{0}")
.format(url),
parent=self)
示例5: findLocally
# 需要导入模块: from arelle import PluginManager [as 别名]
# 或者: from arelle.PluginManager import moduleModuleInfo [as 别名]
def findLocally(self):
initialdir = self.cntlr.pluginDir # default plugin directory
if not self.cntlr.isMac: # can't navigate within app easily, always start in default directory
initialdir = self.cntlr.config.setdefault("pluginOpenDir", initialdir)
filename = self.cntlr.uiFileDialog("open",
parent=self,
title=_("Choose plug-in module file"),
initialdir=initialdir,
filetypes=[(_("Python files"), "*.py")],
defaultextension=".py")
if filename:
# check if a package is selected (any file in a directory containing an __init__.py
#if (os.path.basename(filename) == "__init__.py" and os.path.isdir(os.path.dirname(filename)) and
# os.path.isfile(filename)):
# filename = os.path.dirname(filename) # refer to the package instead
self.cntlr.config["pluginOpenDir"] = os.path.dirname(filename)
moduleInfo = PluginManager.moduleModuleInfo(filename)
self.loadFoundModuleInfo(moduleInfo, filename)
示例6: selectChoices
# 需要导入模块: from arelle import PluginManager [as 别名]
# 或者: from arelle.PluginManager import moduleModuleInfo [as 别名]
def selectChoices(dir, indent=""):
dirHasEntries = False
for f in sorted(os.listdir(dir), key=sortOrder):
if f not in (".", "..", "__pycache__", "__init__.py"):
fPath = os.path.join(dir, f)
fPkgInit = os.path.join(fPath, "__init__.py")
dirInsertPoint = len(choices)
moduleInfo = None
if ((os.path.isdir(fPath) and os.path.exists(fPkgInit)) or
((os.path.isfile(fPath) and f.endswith(".py")))):
moduleInfo = PluginManager.moduleModuleInfo(fPath)
if moduleInfo:
choices.append((indent + f,
"name: {}\ndescription: {}\n version {}".format(
moduleInfo["name"],
moduleInfo["description"],
moduleInfo.get("version")),
fPath, moduleInfo["name"], moduleInfo.get("version"), moduleInfo["description"]))
dirHasEntries = True
if os.path.isdir(fPath) and f not in ("DQC_US_Rules",):
if selectChoices(fPath, indent=indent + " ") and not moduleInfo:
choices.insert(dirInsertPoint, (indent + f,None,None,None,None,None))
return dirHasEntries
示例7: findOnWeb
# 需要导入模块: from arelle import PluginManager [as 别名]
# 或者: from arelle.PluginManager import moduleModuleInfo [as 别名]
def findOnWeb(self):
url = DialogURL.askURL(self)
if url: # url is the in-cache or local file
moduleInfo = PluginManager.moduleModuleInfo(url)
self.cntlr.showStatus("") # clear web loading status
self.loadFoundModuleInfo(moduleInfo, url)