本文整理汇总了Python中arelle.XbrlConst.baseSetArcroleLabel方法的典型用法代码示例。如果您正苦于以下问题:Python XbrlConst.baseSetArcroleLabel方法的具体用法?Python XbrlConst.baseSetArcroleLabel怎么用?Python XbrlConst.baseSetArcroleLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arelle.XbrlConst
的用法示例。
在下文中一共展示了XbrlConst.baseSetArcroleLabel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import baseSetArcroleLabel [as 别名]
def __init__(self, modelXbrl, tabWin, arcrole, linkrole=None, linkqname=None, arcqname=None, lang=None, treeColHdr=None):
super().__init__(modelXbrl, tabWin, XbrlConst.baseSetArcroleLabel(arcrole)[1:], True, lang)
self.arcrole = arcrole
self.linkrole = linkrole
self.linkqname = linkqname
self.arcqname = arcqname
self.treeColHdr = treeColHdr
示例2: __init__
# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import baseSetArcroleLabel [as 别名]
def __init__(
self,
modelXbrl,
tabWin,
arcrole,
linkrole=None,
linkqname=None,
arcqname=None,
lang=None,
treeColHdr=None,
showLinkroles=True,
showRelationships=True,
showColumns=True,
expandAll=False,
hasTableIndex=False,
):
if isinstance(arcrole, (list, tuple)):
tabName = arcrole[0]
else:
tabName = XbrlConst.baseSetArcroleLabel(arcrole)[1:]
super(ViewRelationshipSet, self).__init__(modelXbrl, tabWin, tabName, True, lang)
self.arcrole = arcrole
self.linkrole = linkrole
self.linkqname = linkqname
self.arcqname = arcqname
self.treeColHdr = treeColHdr
self.showLinkroles = showLinkroles
self.showRelationships = showRelationships
self.showColumns = showColumns
self.expandAllOnFirstDisplay = expandAll
self.hasTableIndex = hasTableIndex
self.isResourceArcrole = False
示例3: __init__
# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import baseSetArcroleLabel [as 别名]
def __init__(self, modelXbrl, tabWin, arcrole, linkrole=None, linkqname=None, arcqname=None, lang=None, treeColHdr=None):
if isinstance(arcrole, (list,tuple)):
tabName = arcrole[0]
else:
tabName = XbrlConst.baseSetArcroleLabel(arcrole)[1:]
super(ViewRelationshipSet, self).__init__(modelXbrl, tabWin, tabName, True, lang)
self.arcrole = arcrole
self.linkrole = linkrole
self.linkqname = linkqname
self.arcqname = arcqname
self.treeColHdr = treeColHdr
self.isResourceArcrole = False
示例4: baseSetArcroles
# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import baseSetArcroleLabel [as 别名]
def baseSetArcroles(modelXbrl):
# returns sorted list of tuples of arcrole basename and uri
return sorted(set((XbrlConst.baseSetArcroleLabel(b[0]),b[0]) for b in modelXbrl.baseSets.keys()))
示例5: groupRelationshipLabel
# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import baseSetArcroleLabel [as 别名]
def groupRelationshipLabel(arcrole):
if isinstance(arcrole, (list,tuple)): # (group-name, [arcroles])
arcroleName = arcrole[0]
else:
arcroleName = XbrlConst.baseSetArcroleLabel(arcrole)[1:]
return arcroleName
示例6: view
# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import baseSetArcroleLabel [as 别名]
def view(self, firstTime=False):
self.blockSelectEvent = 1
self.blockViewModelObject = 0
self.tag_has = defaultdict(list) # temporary until Tk 8.6
# relationship set based on linkrole parameter, to determine applicable linkroles
relationshipSet = self.modelXbrl.relationshipSet(self.arcrole, self.linkrole, self.linkqname, self.arcqname)
if not relationshipSet:
self.modelXbrl.modelManager.addToLog(_("no relationships for {0}").format(self.arcrole))
return False
if firstTime:
# set up treeView widget and tabbed pane
hdr = self.treeColHdr if self.treeColHdr else _("{0} Relationships").format(XbrlConst.baseSetArcroleLabel(self.arcrole)[1:])
self.treeView.heading("#0", text=hdr)
if self.arcrole == XbrlConst.parentChild: # extra columns
self.treeView.column("#0", width=300, anchor="w")
self.treeView["columns"] = ("type", "references")
self.treeView.column("type", width=100, anchor="w", stretch=False)
self.treeView.heading("type", text=_("Type"))
self.treeView.column("references", width=200, anchor="w", stretch=False)
self.treeView.heading("references", text=_("References"))
elif self.arcrole == XbrlConst.summationItem: # extra columns
self.treeView.column("#0", width=300, anchor="w")
self.treeView["columns"] = ("weight", "balance")
self.treeView.column("weight", width=48, anchor="w", stretch=False)
self.treeView.heading("weight", text=_("Weight"))
self.treeView.column("balance", width=70, anchor="w", stretch=False)
self.treeView.heading("balance", text=_("Balance"))
elif self.arcrole == "XBRL-dimensions": # add columns for dimensional information
self.treeView.column("#0", width=300, anchor="w")
self.treeView["columns"] = ("arcrole", "contextElement", "closed", "usable")
self.treeView.column("arcrole", width=100, anchor="w", stretch=False)
self.treeView.heading("arcrole", text="Arcrole")
self.treeView.column("contextElement", width=50, anchor="center", stretch=False)
self.treeView.heading("contextElement", text="Context")
self.treeView.column("closed", width=40, anchor="center", stretch=False)
self.treeView.heading("closed", text="Closed")
self.treeView.column("usable", width=40, anchor="center", stretch=False)
self.treeView.heading("usable", text="Usable")
elif self.arcrole == "Table-rendering": # add columns for dimensional information
self.treeView.column("#0", width=160, anchor="w")
self.treeView["columns"] = ("axis", "abstract", "header", "priItem", "dims")
self.treeView.column("axis", width=50, anchor="center", stretch=False)
self.treeView.heading("axis", text="Axis")
self.treeView.column("abstract", width=24, anchor="center", stretch=False)
self.treeView.heading("abstract", text="Abs")
self.treeView.column("header", width=160, anchor="w", stretch=False)
self.treeView.heading("header", text="Header")
self.treeView.column("priItem", width=100, anchor="w", stretch=False)
self.treeView.heading("priItem", text="Primary Item")
self.treeView.column("dims", width=150, anchor="w", stretch=False)
self.treeView.heading("dims", text=_("Dimensions"))
self.id = 1
for previousNode in self.treeView.get_children(""):
self.treeView.delete(previousNode)
# sort URIs by definition
linkroleUris = []
for linkroleUri in relationshipSet.linkRoleUris:
modelRoleTypes = self.modelXbrl.roleTypes.get(linkroleUri)
if modelRoleTypes:
roledefinition = modelRoleTypes[0].definition
if not roledefinition:
roledefinition = linkroleUri
roleId = modelRoleTypes[0].objectId(self.id)
else:
roledefinition = linkroleUri
roleId = "node{0}".format(self.id)
self.id += 1
linkroleUris.append((roledefinition, linkroleUri, roleId))
linkroleUris.sort()
# for each URI in definition order
for linkroleUriTuple in linkroleUris:
linknode = self.treeView.insert("", "end", linkroleUriTuple[2], text=linkroleUriTuple[0], tags=("ELR",))
linkRelationshipSet = self.modelXbrl.relationshipSet(self.arcrole, linkroleUriTuple[1], self.linkqname, self.arcqname)
for rootConcept in linkRelationshipSet.rootConcepts:
self.viewConcept(rootConcept, rootConcept, "", self.labelrole, linknode, 1, linkRelationshipSet, set())
self.tag_has[linkroleUriTuple[1]].append(linknode)