arelle-release 2.37.46__py3-none-any.whl → 2.38.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. arelle/BetaFeatures.py +0 -21
  2. arelle/Cntlr.py +15 -8
  3. arelle/CntlrCmdLine.py +121 -56
  4. arelle/CntlrWinMain.py +143 -70
  5. arelle/DialogFind.py +1 -1
  6. arelle/DialogPluginManager.py +6 -4
  7. arelle/DisclosureSystem.py +7 -0
  8. arelle/ErrorManager.py +21 -6
  9. arelle/FileSource.py +11 -4
  10. arelle/FunctionIxt.py +16 -11
  11. arelle/HtmlUtil.py +5 -4
  12. arelle/LeiUtil.py +63 -43
  13. arelle/ModelDocument.py +20 -15
  14. arelle/ModelDtsObject.py +8 -0
  15. arelle/ModelInstanceObject.py +1 -1
  16. arelle/ModelObject.py +16 -18
  17. arelle/ModelObjectFactory.py +35 -17
  18. arelle/ModelXbrl.py +28 -11
  19. arelle/PluginManager.py +130 -105
  20. arelle/RuntimeOptions.py +1 -0
  21. arelle/UrlUtil.py +14 -0
  22. arelle/Validate.py +17 -12
  23. arelle/ValidateDuplicateFacts.py +3 -1
  24. arelle/ValidateFileSource.py +38 -0
  25. arelle/ValidateFilingText.py +3 -3
  26. arelle/ValidateXbrl.py +5 -2
  27. arelle/ValidateXbrlCalcs.py +210 -186
  28. arelle/ValidateXbrlDTS.py +1 -1
  29. arelle/ViewFile.py +1 -0
  30. arelle/ViewFileFactTable.py +2 -2
  31. arelle/ViewWinDTS.py +4 -1
  32. arelle/WebCache.py +28 -24
  33. arelle/XbrlConst.py +22 -0
  34. arelle/XmlUtil.py +16 -21
  35. arelle/XmlValidate.py +6 -9
  36. arelle/_version.py +16 -3
  37. arelle/api/Session.py +11 -2
  38. arelle/config/disclosuresystems.xsd +2 -0
  39. arelle/config/rosettaEntitlements.plist +8 -0
  40. arelle/conformance/CSVTestcaseLoader.py +1 -1
  41. arelle/formula/XPathContext.py +3 -3
  42. arelle/logging/formatters/LogFormatter.py +3 -1
  43. arelle/packages/report/ReportPackage.py +26 -13
  44. arelle/packages/report/ReportPackageConst.py +0 -1
  45. arelle/plugin/inlineXbrlDocumentSet.py +19 -5
  46. arelle/plugin/validate/DBA/DisclosureSystems.py +19 -1
  47. arelle/plugin/validate/DBA/PluginValidationDataExtension.py +2 -4
  48. arelle/plugin/validate/DBA/ValidationPluginExtension.py +2 -1
  49. arelle/plugin/validate/DBA/resources/config.xml +5 -0
  50. arelle/plugin/validate/DBA/rules/__init__.py +2 -2
  51. arelle/plugin/validate/DBA/rules/fr.py +19 -2
  52. arelle/plugin/validate/DBA/rules/tc.py +2 -0
  53. arelle/plugin/validate/DBA/rules/th.py +6 -0
  54. arelle/plugin/validate/DBA/rules/tm.py +18 -5
  55. arelle/plugin/validate/DBA/rules/tr.py +11 -5
  56. arelle/plugin/validate/EDINET/Constants.py +193 -9
  57. arelle/plugin/validate/EDINET/ContextRequirement.py +58 -0
  58. arelle/plugin/validate/EDINET/ControllerPluginData.py +220 -1
  59. arelle/plugin/validate/EDINET/CoverItemRequirements.py +42 -0
  60. arelle/plugin/validate/EDINET/DeiRequirements.py +118 -0
  61. arelle/plugin/validate/EDINET/FilingFormat.py +275 -0
  62. arelle/plugin/validate/EDINET/FormType.py +134 -0
  63. arelle/plugin/validate/EDINET/ManifestInstance.py +72 -5
  64. arelle/plugin/validate/EDINET/NamespaceConfig.py +50 -0
  65. arelle/plugin/validate/EDINET/PluginValidationDataExtension.py +493 -132
  66. arelle/plugin/validate/EDINET/{InstanceType.py → ReportFolderType.py} +72 -15
  67. arelle/plugin/validate/EDINET/Statement.py +139 -0
  68. arelle/plugin/validate/EDINET/TableOfContentsBuilder.py +595 -0
  69. arelle/plugin/validate/EDINET/UploadContents.py +48 -0
  70. arelle/plugin/validate/EDINET/ValidationPluginExtension.py +20 -2
  71. arelle/plugin/validate/EDINET/__init__.py +31 -6
  72. arelle/plugin/validate/EDINET/resources/config.xml +8 -1
  73. arelle/plugin/validate/EDINET/resources/cover-item-requirements.json +793 -0
  74. arelle/plugin/validate/EDINET/resources/dei-requirements.csv +27 -0
  75. arelle/plugin/validate/EDINET/resources/edinet-taxonomies.xml +2 -0
  76. arelle/plugin/validate/EDINET/rules/contexts.py +375 -14
  77. arelle/plugin/validate/EDINET/rules/edinet.py +1934 -45
  78. arelle/plugin/validate/EDINET/rules/frta.py +122 -3
  79. arelle/plugin/validate/EDINET/rules/gfm.py +1907 -11
  80. arelle/plugin/validate/EDINET/rules/upload.py +989 -141
  81. arelle/plugin/validate/ESEF/Const.py +3 -1
  82. arelle/plugin/validate/ESEF/ESEF_2021/DTS.py +5 -0
  83. arelle/plugin/validate/ESEF/ESEF_2021/Image.py +2 -2
  84. arelle/plugin/validate/ESEF/ESEF_2021/ValidateXbrlFinally.py +23 -20
  85. arelle/plugin/validate/ESEF/ESEF_Current/DTS.py +47 -14
  86. arelle/plugin/validate/ESEF/ESEF_Current/ValidateXbrlFinally.py +100 -25
  87. arelle/plugin/validate/ESEF/__init__.py +20 -6
  88. arelle/plugin/validate/ESEF/resources/authority-validations.json +76 -9
  89. arelle/plugin/validate/ESEF/resources/config.xml +20 -0
  90. arelle/plugin/validate/NL/DisclosureSystems.py +22 -0
  91. arelle/plugin/validate/NL/PluginValidationDataExtension.py +27 -9
  92. arelle/plugin/validate/NL/ValidationPluginExtension.py +51 -7
  93. arelle/plugin/validate/NL/resources/config.xml +18 -0
  94. arelle/plugin/validate/NL/rules/br_kvk.py +17 -61
  95. arelle/plugin/validate/NL/rules/fg_nl.py +7 -38
  96. arelle/plugin/validate/NL/rules/fr_kvk.py +7 -42
  97. arelle/plugin/validate/NL/rules/fr_nl.py +31 -147
  98. arelle/plugin/validate/NL/rules/nl_kvk.py +142 -28
  99. arelle/plugin/validate/ROS/PluginValidationDataExtension.py +2 -0
  100. arelle/plugin/validate/ROS/ValidationPluginExtension.py +4 -1
  101. arelle/plugin/validate/ROS/rules/ros.py +41 -9
  102. arelle/plugin/validate/UK/ValidateUK.py +130 -66
  103. arelle/plugin/validate/UK/__init__.py +89 -103
  104. arelle/utils/EntryPointDetection.py +79 -13
  105. arelle/utils/PluginHooks.py +125 -0
  106. arelle/utils/validate/ESEFImage.py +6 -6
  107. arelle/utils/validate/Validation.py +18 -0
  108. arelle/utils/validate/ValidationPlugin.py +76 -11
  109. arelle/utils/validate/ValidationUtil.py +35 -3
  110. {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/METADATA +30 -20
  111. {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/RECORD +115 -191
  112. {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/licenses/LICENSE.md +0 -3
  113. arelle/archive/CustomLogger.py +0 -43
  114. arelle/archive/LoadEFMvalidate.py +0 -32
  115. arelle/archive/LoadSavePreLbCsv.py +0 -26
  116. arelle/archive/LoadValidate.cs +0 -31
  117. arelle/archive/LoadValidate.py +0 -36
  118. arelle/archive/LoadValidateCmdLine.java +0 -69
  119. arelle/archive/LoadValidatePostedZip.java +0 -57
  120. arelle/archive/LoadValidateWebService.java +0 -34
  121. arelle/archive/SaveTableToExelle.py +0 -140
  122. arelle/archive/TR3toTR4.py +0 -88
  123. arelle/archive/plugin/ESEF_2022/__init__.py +0 -47
  124. arelle/archive/plugin/bigInstance.py +0 -394
  125. arelle/archive/plugin/cmdWebServerExtension.py +0 -43
  126. arelle/archive/plugin/crashTest.py +0 -38
  127. arelle/archive/plugin/functionsXmlCreation.py +0 -106
  128. arelle/archive/plugin/hello_i18n.pot +0 -26
  129. arelle/archive/plugin/hello_i18n.py +0 -32
  130. arelle/archive/plugin/importTestChild1.py +0 -21
  131. arelle/archive/plugin/importTestChild2.py +0 -22
  132. arelle/archive/plugin/importTestGrandchild1.py +0 -21
  133. arelle/archive/plugin/importTestGrandchild2.py +0 -21
  134. arelle/archive/plugin/importTestImported1.py +0 -23
  135. arelle/archive/plugin/importTestImported11.py +0 -22
  136. arelle/archive/plugin/importTestParent.py +0 -48
  137. arelle/archive/plugin/instanceInfo.py +0 -306
  138. arelle/archive/plugin/loadFromOIM-2018.py +0 -1282
  139. arelle/archive/plugin/locale/fr/LC_MESSAGES/hello_i18n.po +0 -25
  140. arelle/archive/plugin/objectmaker.py +0 -285
  141. arelle/archive/plugin/packagedImportTest/__init__.py +0 -47
  142. arelle/archive/plugin/packagedImportTest/importTestChild1.py +0 -21
  143. arelle/archive/plugin/packagedImportTest/importTestChild2.py +0 -22
  144. arelle/archive/plugin/packagedImportTest/importTestGrandchild1.py +0 -21
  145. arelle/archive/plugin/packagedImportTest/importTestGrandchild2.py +0 -21
  146. arelle/archive/plugin/packagedImportTest/importTestImported1.py +0 -24
  147. arelle/archive/plugin/packagedImportTest/importTestImported11.py +0 -21
  148. arelle/archive/plugin/packagedImportTest/subdir/importTestImported111.py +0 -21
  149. arelle/archive/plugin/packagedImportTest/subdir/subsubdir/importTestImported1111.py +0 -21
  150. arelle/archive/plugin/sakaCalendar.py +0 -215
  151. arelle/archive/plugin/saveInstanceInfoset.py +0 -121
  152. arelle/archive/plugin/sphinx/FormulaGenerator.py +0 -823
  153. arelle/archive/plugin/sphinx/SphinxContext.py +0 -404
  154. arelle/archive/plugin/sphinx/SphinxEvaluator.py +0 -783
  155. arelle/archive/plugin/sphinx/SphinxMethods.py +0 -1287
  156. arelle/archive/plugin/sphinx/SphinxParser.py +0 -1093
  157. arelle/archive/plugin/sphinx/SphinxValidator.py +0 -163
  158. arelle/archive/plugin/sphinx/US-GAAP Ratios Example.xsr +0 -52
  159. arelle/archive/plugin/sphinx/__init__.py +0 -285
  160. arelle/archive/plugin/streamingExtensions.py +0 -335
  161. arelle/archive/plugin/updateTableLB.py +0 -242
  162. arelle/archive/plugin/validate/SBRnl/CustomLoader.py +0 -19
  163. arelle/archive/plugin/validate/SBRnl/DTS.py +0 -305
  164. arelle/archive/plugin/validate/SBRnl/Dimensions.py +0 -357
  165. arelle/archive/plugin/validate/SBRnl/Document.py +0 -799
  166. arelle/archive/plugin/validate/SBRnl/Filing.py +0 -467
  167. arelle/archive/plugin/validate/SBRnl/__init__.py +0 -75
  168. arelle/archive/plugin/validate/SBRnl/config.xml +0 -26
  169. arelle/archive/plugin/validate/SBRnl/sbr-nl-taxonomies.xml +0 -754
  170. arelle/archive/plugin/validate/USBestPractices.py +0 -570
  171. arelle/archive/plugin/validate/USCorpAction.py +0 -557
  172. arelle/archive/plugin/validate/USSecTagging.py +0 -337
  173. arelle/archive/plugin/validate/XDC/__init__.py +0 -77
  174. arelle/archive/plugin/validate/XDC/config.xml +0 -20
  175. arelle/archive/plugin/validate/XFsyntax/__init__.py +0 -64
  176. arelle/archive/plugin/validate/XFsyntax/xf.py +0 -2227
  177. arelle/archive/plugin/validate/calc2.py +0 -536
  178. arelle/archive/plugin/validateSchemaLxml.py +0 -156
  179. arelle/archive/plugin/validateTableInfoset.py +0 -52
  180. arelle/archive/us-gaap-dei-docType-extraction-frm.xml +0 -90
  181. arelle/archive/us-gaap-dei-ratio-cash-frm.xml +0 -150
  182. arelle/examples/plugin/formulaSuiteConverter.py +0 -212
  183. arelle/examples/plugin/functionsCustom.py +0 -59
  184. arelle/examples/plugin/hello_dolly.py +0 -64
  185. arelle/examples/plugin/multi.py +0 -58
  186. arelle/examples/plugin/rssSaveOim.py +0 -96
  187. arelle/examples/plugin/validate/XYZ/DisclosureSystems.py +0 -2
  188. arelle/examples/plugin/validate/XYZ/PluginValidationDataExtension.py +0 -10
  189. arelle/examples/plugin/validate/XYZ/ValidationPluginExtension.py +0 -49
  190. arelle/examples/plugin/validate/XYZ/__init__.py +0 -75
  191. arelle/examples/plugin/validate/XYZ/resources/config.xml +0 -16
  192. arelle/examples/plugin/validate/XYZ/rules/__init__.py +0 -0
  193. arelle/examples/plugin/validate/XYZ/rules/rules01.py +0 -110
  194. arelle/examples/plugin/validate/XYZ/rules/rules02.py +0 -59
  195. arelle/model/CommentBase.py +0 -9
  196. arelle/model/ElementBase.py +0 -11
  197. arelle/model/PIBase.py +0 -10
  198. arelle/model/__init__.py +0 -15
  199. arelle/scripts-macOS/startWebServer.command +0 -3
  200. arelle/scripts-unix/startWebServer.sh +0 -1
  201. arelle/scripts-windows/startWebServer.bat +0 -5
  202. {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/WHEEL +0 -0
  203. {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/entry_points.txt +0 -0
  204. {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/top_level.txt +0 -0
@@ -1,25 +0,0 @@
1
- # Arelle
2
- # Copyright (C) 2011 MarkV System
3
- # This file is distributed under the same license as the Arelle package.
4
- # R�gis D�camps <regis.decamps@acp.banque-france.fr>, 2012.
5
- #
6
- #, fuzzy
7
- msgid ""
8
- msgstr ""
9
- "Project-Id-Version: 0.1\n"
10
- "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2012-01-04 18:04+0100\n"
12
- "PO-Revision-Date: 2012-01-04 18:04+0100\n"
13
- "Last-Translator: Regis Decamps <regis.decamps@acp.banque-france.fr>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
-
18
- #: hello.py:11 hello.py:16
19
- msgid "Hello World"
20
- msgstr "Bonjour tout le monde"
21
-
22
- #: hello.py:28
23
- msgid "Prints 'Hello world'"
24
- msgstr "Affiche 'Bonjour tout le monde'"
25
-
@@ -1,285 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- '''
3
- objectmaker.py is a plug-in that will draw diagrams from linkbases
4
-
5
- ObjectMaker(r) is a registered trademark of Workiva, Inc.
6
-
7
- This product uses graphviz, which must be installed separately on the platform.
8
-
9
- See COPYRIGHT.md for copyright information.
10
- '''
11
- import os, io, time
12
- from tkinter import Menu
13
- from arelle import ModelDocument, XmlUtil, XbrlConst
14
- from arelle.ModelDtsObject import ModelConcept
15
- from arelle.Version import authorLabel, copyrightLabel
16
-
17
- diagramNetworks = {
18
- "uml": ("http://xbrl.us/arcrole/Aggregation", "http://xbrl.us/arcrole/Composition", "http://xbrl.us/arcrole/Inheritance"),
19
- "dts": (),
20
- "pre": (XbrlConst.parentChild,),
21
- "cal": (XbrlConst.summationItem,),
22
- "def": (XbrlConst.essenceAlias, XbrlConst.similarTuples, XbrlConst.requiresElement, XbrlConst.generalSpecial,
23
- XbrlConst.all, XbrlConst.notAll, XbrlConst.hypercubeDimension, XbrlConst.dimensionDomain,
24
- XbrlConst.domainMember, XbrlConst.dimensionDefault),
25
- "anc": (XbrlConst.widerNarrower,)
26
- }
27
-
28
- # graphviz attributes: http://www.graphviz.org/doc/info/attrs.html
29
-
30
- networkEdgeTypes = {
31
- "uml": {
32
- "inheritance": {"dir": "back", "arrowtail": "empty"},
33
- "aggregation": {"dir": "back", "arrowtail": "odiamond"},
34
- "composition": {"dir": "back", "arrowtail": "diamond"}
35
- },
36
- "dts": {
37
- "all-types": {"dir": "forward", "arrowhead": "normal"}
38
- },
39
- "pre": {
40
- "parent-child": {"dir": "forward", "arrowhead": "normal"}
41
- },
42
- "cal": {
43
- "summation-item": {"dir": "forward", "arrowhead": "normal"}
44
- },
45
- "def": {
46
- "essence-alias": {"dir": "forward", "arrowhead": "normal"},
47
- "similar-tuples": {"dir": "forward", "arrowhead": "normal"},
48
- "requires-element": {"dir": "forward", "arrowhead": "normal"},
49
- "general-special": {"dir": "forward", "arrowhead": "normal"},
50
- "all": {"dir": "forward", "arrowhead": "normal"},
51
- "notall": {"dir": "forward", "arrowhead": "normal"}, # arc roles are lower-cased here
52
- "hypercube-dimension": {"dir": "forward", "arrowhead": "normal"},
53
- "dimension-domain": {"dir": "forward", "arrowhead": "normal"},
54
- "domain-member": {"dir": "forward", "arrowhead": "normal"},
55
- "dimension-default": {"dir": "forward", "arrowhead": "normal"}
56
- },
57
- "anc": {
58
- "wider-narrower": {"dir": "forward", "arrowhead": "normal"}
59
- },
60
- }
61
-
62
- def drawDiagram(modelXbrl, diagramFile, diagramNetwork=None, viewDiagram=False):
63
- if diagramNetwork not in diagramNetworks:
64
- modelXbrl.error("objectmaker:diagramNetwork",
65
- "Diagram network %(diagramNetwork)s not recognized, please specify one of %(recognizedDiagramNetworks)s",
66
- modelXbrl=modelXbrl, diagramNetwork=diagramNetwork, recognizedDiagramNetworks=", ".join(diagramNetworks))
67
- return
68
-
69
- try:
70
- from graphviz import Digraph, backend
71
- except ImportError:
72
- modelXbrl.error("objectmaker:missingLibrary",
73
- "Missing library, please install graphviz for python importing",
74
- modelXbrl=modelXbrl)
75
- return
76
-
77
- isUML = diagramNetwork == "uml"
78
- isBaseSpec = diagramNetwork in ("pre", "cal", "def", "anch")
79
- graphName = os.path.splitext(modelXbrl.modelDocument.basename)[0]
80
- mdl = Digraph(comment=graphName)
81
- mdl.attr("graph")
82
- mdl.node('node_title', graphName, shape="none", fontname="Bitstream Vera Sans")
83
- mdl.attr('node', shape="record")
84
- mdl.attr('node', fontname="Bitstream Vera Sans")
85
- mdl.attr('node', fontsize="8")
86
-
87
- if isUML:
88
- arcroleName = "http://xbrl.us/arcrole/Property"
89
- propertiesRelationshipSet = modelXbrl.relationshipSet(arcroleName)
90
- if not propertiesRelationshipSet:
91
- modelXbrl.modelManager.addToLog(_("no relationships for {0}").format(arcroleName))
92
- return False
93
-
94
- def node(mdl, id, modelObject):
95
- if modelObject is not None:
96
- mdl.attr("node", style="") # white classes
97
- if isUML:
98
- _properties = "".join(r"+{} {}\l".format(rel.toModelObject.qname.localName, rel.toModelObject.niceType)
99
- for rel in propertiesRelationshipSet.fromModelObject(modelObject)
100
- if rel.toModelObject is not None)
101
- mdl.node(id, "{{{}|{}}}".format(modelObject.qname.localName, _properties))
102
- elif isBaseSpec and isinstance(modelObject, ModelConcept):
103
- concept = modelObject
104
- if concept.isHypercubeItem:
105
- _properties = "Hypercube"
106
- elif concept.isExplicitDimension:
107
- _properties = "Dimension, Explicit"
108
- elif concept.isExplicitDimension:
109
- _properties = "Dimension, Typed ({} {})".format(typedDomainElement.qname, typedDomainElement.niceType)
110
- elif concept.isEnumeration:
111
- _properties = "Enumeration ({})".format(concept.enumDomain.qname)
112
- else:
113
- _properties = "{}{}".format("Abstract " if modelObject.isAbstract else "",
114
- modelObject.niceType)
115
- mdl.node(id, "{{{}|{}}}".format(modelObject.qname.localName, _properties))
116
- elif isinstance(modelObject, ModelDocument.ModelDocument):
117
- mdl.node(id, "{{{}|{}}}".format(modelObject.basename, modelObject.gettype()))
118
- elif isinstance(modelObject, str): # linkrole definition
119
- mdl.node(id, "{{{}}}".format(modelObject))
120
- else:
121
- mdl.node(id, "{{{}}}".format(modelObject.qname.localName))
122
-
123
- nodes = set()
124
- edges = set()
125
- arcroles = diagramNetworks[diagramNetwork]
126
-
127
- lang = None # from parameter for override
128
-
129
- # sort URIs by definition
130
- linkroleUris = set()
131
- if isBaseSpec:
132
- for arcrole in arcroles:
133
- graphRelationshipSet = modelXbrl.relationshipSet(arcrole)
134
- for linkroleUri in graphRelationshipSet.linkRoleUris:
135
- modelRoleTypes = modelXbrl.roleTypes.get(linkroleUri)
136
- if modelRoleTypes:
137
- roledefinition = (modelRoleTypes[0].genLabel(lang=lang, strip=True) or modelRoleTypes[0].definition or linkroleUri)
138
- else:
139
- roledefinition = linkroleUri
140
- linkroleUris.add((roledefinition, linkroleUri))
141
- else:
142
- linkroleUris.add((None, None))
143
-
144
- for roledefinition, linkroleUri in sorted(linkroleUris):
145
- for arcrole in arcroles:
146
- relationshipType = arcrole.rpartition("/")[2].lower()
147
- edgeType = networkEdgeTypes[diagramNetwork].get(relationshipType)
148
- if edgeType is None:
149
- modelXbrl.warning("objectmaker:unrecognizedArcrole",
150
- "Arcrole missing from networkEdgeTypes: %(arcrole)s:",
151
- modelXbrl=modelXbrl, arcrole=arcrole)
152
- continue
153
- graphRelationshipSet = modelXbrl.relationshipSet(arcrole, linkroleUri)
154
- roleprefix = (linkroleUri.replace("/","_").replace(":","_") + "_") if linkroleUri else ""
155
- if not graphRelationshipSet:
156
- continue
157
- if linkroleUri is not None:
158
- node(mdl, roleprefix, roledefinition or roleUri)
159
- for rootConcept in graphRelationshipSet.rootConcepts:
160
- childName = roleprefix + rootConcept.qname.localName
161
- node(mdl, childName, rootConcept)
162
- nodes.add(childName)
163
- mdl.edge(roleprefix, childName,
164
- dir=edgeType.get("dir"), arrowhead=edgeType.get("arrowhead"), arrowtail=edgeType.get("arrowtail"))
165
- for rel in graphRelationshipSet.modelRelationships:
166
- parent = rel.fromModelObject
167
- child = rel.toModelObject
168
- if parent is None or child is None:
169
- continue
170
- parentName = roleprefix + parent.qname.localName
171
- childName = roleprefix + child.qname.localName
172
- if parentName not in nodes:
173
- node(mdl, parentName, parent)
174
- nodes.add(parentName)
175
- if childName not in nodes:
176
- node(mdl, childName, child)
177
- nodes.add(childName)
178
- edgeKey = (relationshipType, parentName, childName)
179
- if edgeKey not in edges:
180
- edges.add(edgeKey)
181
- mdl.edge(parentName, childName,
182
- dir=edgeType.get("dir"), arrowhead=edgeType.get("arrowhead"), arrowtail=edgeType.get("arrowtail"))
183
-
184
- if diagramNetwork == "dts":
185
- def viewDtsDoc(modelDoc, parentDocName, grandparentDocName):
186
- docName = modelDoc.basename
187
- docType = modelDoc.gettype()
188
- if docName not in nodes:
189
- node(mdl, docName, modelDoc)
190
- if parentDocName:
191
- edgeKey = (parentDocName, docType, docName)
192
- if edgeKey in edges:
193
- return
194
- edges.add(edgeKey)
195
- edgeType = networkEdgeTypes[diagramNetwork]["all-types"]
196
- mdl.edge(parentDocName, docName,
197
- dir=edgeType.get("dir"), arrowhead=edgeType.get("arrowhead"), arrowtail=edgeType.get("arrowtail"))
198
- for referencedDoc in modelDoc.referencesDocument.keys():
199
- if referencedDoc.basename != parentDocName: # skip reverse linkbase ref
200
- viewDtsDoc(referencedDoc, docName, parentDocName)
201
-
202
- viewDtsDoc(modelXbrl.modelDocument, None, None)
203
-
204
- mdl.format = "pdf"
205
- try:
206
- mdl.render(diagramFile.replace(".pdf", ".gv"), view=viewDiagram)
207
- except backend.ExecutableNotFound as ex:
208
- modelXbrl.warning("objectmaker:graphvizExecutable",
209
- "Diagram saving requires installation of graphviz, error: %(error)s:",
210
- modelXbrl=modelXbrl, error=ex)
211
-
212
-
213
- def objectmakerMenuEntender(cntlr, menu, *args, **kwargs):
214
- # Extend menu with an item for the savedts plugin
215
- drawDiagMenu = Menu(cntlr.menubar, tearoff=0)
216
- menu.add_cascade(label="Draw Diagram", underline=0, menu=drawDiagMenu)
217
- drawDiagMenu.add_command(label=_("DTS"), underline=0, command=lambda: objectmakerMenuCommand(cntlr, "dts") )
218
- drawDiagMenu.add_command(label=_("Presentation"), underline=0, command=lambda: objectmakerMenuCommand(cntlr, "pre") )
219
- drawDiagMenu.add_command(label=_("Calculation"), underline=0, command=lambda: objectmakerMenuCommand(cntlr, "cal") )
220
- drawDiagMenu.add_command(label=_("Definition"), underline=0, command=lambda: objectmakerMenuCommand(cntlr, "def") )
221
- drawDiagMenu.add_command(label=_("UML"), underline=0, command=lambda: objectmakerMenuCommand(cntlr, "uml") )
222
-
223
- def objectmakerMenuCommand(cntlr, diagramNetwork):
224
- # save DTS menu item has been invoked
225
- if cntlr.modelManager is None or cntlr.modelManager.modelXbrl is None:
226
- cntlr.addToLog("No taxonomy loaded.")
227
- return
228
- # get file name into which to save log file while in foreground thread
229
- diagramFile = cntlr.uiFileDialog("save",
230
- title=_("objectmaker - Save {} diagram").format(diagramNetwork),
231
- initialdir=cntlr.config.setdefault("diagramFileDir","."),
232
- filetypes=[(_("Diagram file .pdf"), "*.pdf")],
233
- defaultextension=".pdf")
234
- if not diagramFile:
235
- return False
236
- import os
237
- cntlr.config["diagramFileDir"] = os.path.dirname(diagramFile)
238
- cntlr.saveConfig()
239
-
240
- import threading
241
- thread = threading.Thread(target=lambda
242
- _modelXbrl=cntlr.modelManager.modelXbrl,
243
- _diagramFile=diagramFile:
244
- drawDiagram(_modelXbrl, _diagramFile, diagramNetwork, True))
245
- thread.daemon = True
246
- thread.start()
247
-
248
- def objectmakerCommandLineOptionExtender(parser, *args, **kwargs):
249
- # extend command line options with a save DTS option
250
- parser.add_option("--save-diagram",
251
- action="store",
252
- dest="saveDiagram",
253
- help=_("Save Diagram file"))
254
- parser.add_option("--diagram-network",
255
- action="store",
256
- dest="diagramNetwork",
257
- help=_("Network to diagram: dts, pre, cal, def, uml"))
258
- parser.add_option("--view-diagram",
259
- action="store_true",
260
- dest="viewDiagram",
261
- help=_("Show diagram in GUI viewer"))
262
-
263
- def objectmakerCommandLineXbrlRun(cntlr, options, modelXbrl, *args, **kwargs):
264
- # extend XBRL-loaded run processing for this option
265
- diagramFile = getattr(options, "saveDiagram", None)
266
- if diagramFile:
267
- if cntlr.modelManager is None or cntlr.modelManager.modelXbrl is None:
268
- cntlr.addToLog("No taxonomy loaded.")
269
- return
270
- diagramNetwork = getattr(options, "diagramNetwork")
271
- viewDiagram = getattr(options, "viewDiagram", False)
272
- drawDiagram(cntlr.modelManager.modelXbrl, diagramFile, diagramNetwork, viewDiagram)
273
-
274
- __pluginInfo__ = {
275
- 'name': 'ObjectMaker',
276
- 'version': '1.0',
277
- 'description': "ObjectMaker(r) diagrams XBRL relationship graphs.",
278
- 'license': 'Apache-2 (ObjectMaker), Eclipse (Graphviz)',
279
- 'author': authorLabel,
280
- 'copyright': copyrightLabel + ' Graphviz (c) 2011 AT&T',
281
- # classes of mount points (required)
282
- 'CntlrWinMain.Menu.Tools': objectmakerMenuEntender,
283
- 'CntlrCmdLine.Options': objectmakerCommandLineOptionExtender,
284
- 'CntlrCmdLine.Xbrl.Run': objectmakerCommandLineXbrlRun,
285
- }
@@ -1,47 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from os import path
7
- from arelle.PluginManager import pluginClassMethods
8
- from arelle.Version import authorLabel, copyrightLabel
9
- from . import importTestImported1
10
- from .importTestImported1 import foo
11
-
12
- def parentMenuEntender(cntlr, menu):
13
- menu.add_command(label="Packaged Parent exercise descendants", underline=0, command=lambda: parentMenuCommand(cntlr) )
14
-
15
- def parentMenuCommand(cntl):
16
- for i in range(1,100):
17
- for pluginMethod in pluginClassMethods("Import.Packaged.Entry{}".format(i)):
18
- pluginMethod()
19
-
20
- def parentCommandLineOptionExtender(parser):
21
- parser.add_option("--packagedParentImportExample",
22
- action="store_true",
23
- dest="packagedParentImportExample",
24
- help=_('Test that imported plug-ins were actually loaded and activated"'))
25
-
26
- def parentCommandLineUtilityRun(cntlr, options, **kwargs):
27
- if options.packagedParentImportExample:
28
- parentMenuCommand(cntlr)
29
-
30
- def foo():
31
- print ("parent (__init__) of imported packaged plug-ins")
32
-
33
- __pluginInfo__ = {
34
- 'name': 'Import Test Package Parent',
35
- 'version': '0.9',
36
- 'description': "This is a imports-containing packaged (__init__) plugin.",
37
- 'license': 'Apache-2',
38
- 'author': authorLabel,
39
- 'copyright': copyrightLabel,
40
- # classes of mount points (required)
41
- 'CntlrWinMain.Menu.Tools': parentMenuEntender,
42
- 'CntlrCmdLine.Options': parentCommandLineOptionExtender,
43
- 'CntlrCmdLine.Utility.Run': parentCommandLineUtilityRun,
44
- 'Import.Packaged.Entry1': foo,
45
- # imported plugins
46
- 'import': ('importTestChild1.py', 'importTestChild2.py', "module_import_subtree")
47
- }
@@ -1,21 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
-
8
- def foo():
9
- print ("imported packaged plug-in child 1")
10
-
11
- __pluginInfo__ = {
12
- 'name': 'Package Listed Import Child 1',
13
- 'version': '0.9',
14
- 'description': "This is a packaged child plugin.",
15
- 'license': 'Apache-2',
16
- 'author': authorLabel,
17
- 'copyright': copyrightLabel,
18
- # classes of mount points (required)
19
- 'Import.Packaged.Entry2': foo,
20
- # imported plugins
21
- }
@@ -1,22 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
-
8
- def foo():
9
- print ("imported packaged plug-in child 2")
10
-
11
- __pluginInfo__ = {
12
- 'name': 'Package Listed Import Child 2',
13
- 'version': '0.9',
14
- 'description': "This is a packaged child plugin.",
15
- 'license': 'Apache-2',
16
- 'author': authorLabel,
17
- 'copyright': copyrightLabel,
18
- # classes of mount points (required)
19
- 'Import.Packaged.Entry3': foo,
20
- # import plugins
21
- 'import': ('importTestGrandchild1.py', 'importTestGrandchild2.py')
22
- }
@@ -1,21 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
-
8
- def foo():
9
- print ("imported packaged plug-in grandchild 1")
10
-
11
- __pluginInfo__ = {
12
- 'name': 'Package Listed Import Grandchild 1.1',
13
- 'version': '0.9',
14
- 'description': "This is a packaged grandchild plugin.",
15
- 'license': 'Apache-2',
16
- 'author': authorLabel,
17
- 'copyright': copyrightLabel,
18
- # classes of mount points (required)
19
- 'Import.Packaged.Entry4': foo,
20
- # imported plugins
21
- }
@@ -1,21 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
-
8
- def foo():
9
- print ("imported packaged plug-in grandchild 2")
10
-
11
- __pluginInfo__ = {
12
- 'name': 'Package Listed Import Grandchild 1.2',
13
- 'version': '0.9',
14
- 'description': "This is a packaged grandchild plugin.",
15
- 'license': 'Apache-2',
16
- 'author': authorLabel,
17
- 'copyright': copyrightLabel,
18
- # classes of mount points (required)
19
- 'Import.Packaged.Entry5': foo,
20
- # imported plugins
21
- }
@@ -1,24 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
- from . import importTestImported11
8
- from .subdir import importTestImported111
9
- from .subdir.subsubdir import importTestImported1111
10
-
11
- def foo():
12
- print ("imported packaged plug-in relative imported 1")
13
-
14
- __pluginInfo__ = {
15
- 'name': 'Package Relative Import 1',
16
- 'version': '0.9',
17
- 'description': "This is a packaged relative imported plugin.",
18
- 'license': 'Apache-2',
19
- 'author': authorLabel,
20
- 'copyright': copyrightLabel,
21
- # classes of mount points (required)
22
- 'Import.Packaged.Entry6': foo,
23
- # imported plugins
24
- }
@@ -1,21 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
-
8
- def foo():
9
- print ("imported packaged plug-in relative imported 1.1")
10
-
11
- __pluginInfo__ = {
12
- 'name': 'Package Relative Import 1.1',
13
- 'version': '0.9',
14
- 'description': "This is a packaged relative imported plugin.",
15
- 'license': 'Apache-2',
16
- 'author': authorLabel,
17
- 'copyright': copyrightLabel,
18
- # classes of mount points (required)
19
- 'Import.Packaged.Entry7': foo,
20
- # imported plugins
21
- }
@@ -1,21 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
-
8
- def foo():
9
- print ("imported packaged plug-in relative subdir imported 1.1/1")
10
-
11
- __pluginInfo__ = {
12
- 'name': 'Package Relative Import 1.1/1',
13
- 'version': '0.9',
14
- 'description': "This is a packaged relative subdir imported plugin.",
15
- 'license': 'Apache-2',
16
- 'author': authorLabel,
17
- 'copyright': copyrightLabel,
18
- # classes of mount points (required)
19
- 'Import.Packaged.Entry8': foo,
20
- # imported plugins
21
- }
@@ -1,21 +0,0 @@
1
- '''
2
- pluginPackages test case
3
-
4
- See COPYRIGHT.md for copyright information.
5
- '''
6
- from arelle.Version import authorLabel, copyrightLabel
7
-
8
- def foo():
9
- print ("imported packaged plug-in relative subdir imported 1.1/1/1")
10
-
11
- __pluginInfo__ = {
12
- 'name': 'Package Relative Import 1.1/1/1',
13
- 'version': '0.9',
14
- 'description': "This is a packaged relative subsubdir imported plugin.",
15
- 'license': 'Apache-2',
16
- 'author': authorLabel,
17
- 'copyright': copyrightLabel,
18
- # classes of mount points (required)
19
- 'Import.Packaged.Entry8': foo,
20
- # imported plugins
21
- }