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,156 +0,0 @@
1
- '''
2
- Save DTS is an example of a plug-in to both GUI menu and command line/web service
3
- that will save the files of a DTS into a zip file.
4
-
5
- See COPYRIGHT.md for copyright information.
6
- '''
7
-
8
- import threading
9
- from arelle.Version import authorLabel, copyrightLabel
10
- from lxml import etree
11
-
12
- def validateSchemaWithLxml(modelXbrl, cntlr=None):
13
- class schemaResolver(etree.Resolver):
14
- def resolve(self, url, id, context):
15
- if url.startswith("file:///__"):
16
- url = importedFilepaths[int(url[10:])]
17
- filepath = modelXbrl.modelManager.cntlr.webCache.getfilename(url)
18
- return self.resolve_filename(filepath, context)
19
-
20
- entryDocument = modelXbrl.modelDocument
21
- # test of schema validation using lxml (trial experiment, commented out for production use)
22
- from arelle import ModelDocument
23
- imports = []
24
- importedNamespaces = set()
25
- importedFilepaths = []
26
-
27
- '''
28
- for mdlSchemaDoc in entryDocument.referencesDocument.keys():
29
- if (mdlSchemaDoc.type == ModelDocument.Type.SCHEMA and
30
- mdlSchemaDoc.targetNamespace not in importedNamespaces):
31
- # actual file won't pass through properly, fake with table reference
32
- imports.append('<xsd:import namespace="{0}" schemaLocation="file:///__{1}"/>'.format(
33
- mdlSchemaDoc.targetNamespace, len(importedFilepaths)))
34
- importedNamespaces.add(mdlSchemaDoc.targetNamespace)
35
- importedFilepaths.append(mdlSchemaDoc.filepath)
36
- '''
37
-
38
- def importReferences(referencingDocument):
39
- for mdlSchemaDoc in referencingDocument.referencesDocument.keys():
40
- if (mdlSchemaDoc.type == ModelDocument.Type.SCHEMA and
41
- mdlSchemaDoc.targetNamespace not in importedNamespaces):
42
- importedNamespaces.add(mdlSchemaDoc.targetNamespace)
43
- importReferences(mdlSchemaDoc) # do dependencies first
44
- # actual file won't pass through properly, fake with table reference
45
- imports.append('<xsd:import namespace="{0}" schemaLocation="file:///__{1}"/>'.format(
46
- mdlSchemaDoc.targetNamespace, len(importedFilepaths)))
47
- importedFilepaths.append(mdlSchemaDoc.filepath)
48
- importReferences(entryDocument)
49
- # add schemas used in xml validation but not DTS discovered
50
- for mdlDoc in modelXbrl.urlDocs.values():
51
- if mdlDoc.type in (ModelDocument.Type.INSTANCE, ModelDocument.Type.LINKBASE):
52
- schemaLocation = mdlDoc.xmlRootElement.get("{http://www.w3.org/2001/XMLSchema-instance}schemaLocation")
53
- if schemaLocation:
54
- ns = None
55
- for entry in schemaLocation.split():
56
- if ns is None:
57
- ns = entry
58
- else:
59
- if ns not in importedNamespaces:
60
- imports.append('<xsd:import namespace="{0}" schemaLocation="file:///__{1}"/>'.format(
61
- ns, len(importedFilepaths)))
62
- importedNamespaces.add(ns)
63
- importedFilepaths.append(entry)
64
- ns = None
65
- schemaXml = '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n{0}</xsd:schema>\n'.format(
66
- '\n'.join(imports))
67
- # trace schema files referenced
68
- with open("c:\\temp\\test.xml", "w") as fh:
69
- fh.write(schemaXml)
70
- modelXbrl.modelManager.showStatus(_("lxml validator loading xml schema"))
71
- schema_root = etree.XML(schemaXml)
72
- import time
73
- startedAt = time.time()
74
- parser = etree.XMLParser()
75
- parser.resolvers.add(schemaResolver())
76
- schemaDoc = etree.fromstring(schemaXml, parser=parser, base_url=entryDocument.filepath+"-dummy-import.xsd")
77
- schema = etree.XMLSchema(schemaDoc)
78
- from arelle.Locale import format_string
79
- modelXbrl.info("info:lxmlSchemaValidator", format_string(modelXbrl.modelManager.locale,
80
- _("schema loaded in %.2f secs"),
81
- time.time() - startedAt))
82
- modelXbrl.modelManager.showStatus(_("lxml schema validating"))
83
- # check instance documents and linkbases (sort for inst doc before linkbases, and in file name order)
84
- for mdlDoc in sorted(modelXbrl.urlDocs.values(), key=lambda mdlDoc: (-mdlDoc.type, mdlDoc.filepath)):
85
- if mdlDoc.type in (ModelDocument.Type.INSTANCE, ModelDocument.Type.LINKBASE):
86
- startedAt = time.time()
87
- docXmlTree = etree.parse(mdlDoc.filepath)
88
- modelXbrl.info("info:lxmlSchemaValidator", format_string(modelXbrl.modelManager.locale,
89
- _("schema validated in %.3f secs"),
90
- time.time() - startedAt),
91
- modelDocument=mdlDoc)
92
- if not schema.validate(docXmlTree):
93
- for error in schema.error_log:
94
- modelXbrl.error("lxmlSchema:{0}".format(error.type_name.lower()),
95
- error.message,
96
- modelDocument=mdlDoc,
97
- sourceLine=error.line)
98
- modelXbrl.modelManager.showStatus(_("lxml validation done"), clearAfter=3000)
99
-
100
- if cntlr is not None:
101
- # if using GUI controller, not cmd line or web service, select the errors window when done
102
- cntlr.uiThreadQueue.put((cntlr.logSelect, []))
103
-
104
- def validateSchemaWithLxmlMenuEntender(cntlr, validationmenu):
105
- # Insert as 2nd menu item for the lxml schema validation
106
- validationmenu.insert_command(1, label="Validate schema with lxml",
107
- underline=0,
108
- command=lambda: validateSchemaWithLxmlMenuCommand(cntlr) )
109
-
110
- def validateSchemaWithLxmlMenuCommand(cntlr):
111
- # save DTS menu item has been invoked
112
- if cntlr.modelManager is None or cntlr.modelManager.modelXbrl is None:
113
- cntlr.addToLog(_("No taxonomy loaded."))
114
- return
115
- # do the schema validation in background (and afterwards focus on GUI messages pane)
116
- thread = threading.Thread(target=lambda dts=cntlr.modelManager.modelXbrl, c=cntlr: validateSchemaWithLxml(dts, c))
117
- thread.daemon = True
118
- thread.start()
119
-
120
- def validateSchemaWithLxmlCommandLineOptionExtender(parser):
121
- # extend command line options with a save DTS option
122
- parser.add_option("--validateSchemaWithLxml",
123
- action="store_true",
124
- dest="validateSchemaLxml",
125
- help=_("Validate the schema with lxml (experimental)"))
126
-
127
- def validateSchemaWithLxmlCommandLineXbrlRun(cntlr, options, modelXbrl, *args, **kwargs):
128
- # extend XBRL-loaded run processing for this option
129
- if getattr(options, "validateSchemaLxml", False):
130
- if cntlr.modelManager is None or cntlr.modelManager.modelXbrl is None:
131
- cntlr.addToLog(_("No taxonomy loaded."))
132
- return
133
- validateSchemaWithLxml(cntlr.modelManager.modelXbrl)
134
-
135
-
136
- '''
137
- Do not use _( ) in pluginInfo itself (it is applied later, after loading
138
- '''
139
-
140
- __pluginInfo__ = {
141
- 'name': 'Validate Schema with Lxml',
142
- 'version': '0.9',
143
- 'description': "This plug-in provides schema validation using lxml. As of 2012-05 "
144
- " lxml does not properly schema validate XBRL schemas, which is why"
145
- " it is provided in a plug-in instead of the main build. "
146
- "For the GUI, this feature is inserted to the tools->validation menu 2nd position. "
147
- "This is an experimental feature, not suitable for XBRL production use until lxml"
148
- " schema validation becomes reliable for XBRL schemas.",
149
- 'license': 'Apache-2',
150
- 'author': authorLabel,
151
- 'copyright': copyrightLabel,
152
- # classes of mount points (required)
153
- 'CntlrWinMain.Menu.Validation': validateSchemaWithLxmlMenuEntender,
154
- 'CntlrCmdLine.Options': validateSchemaWithLxmlCommandLineOptionExtender,
155
- 'CntlrCmdLine.Xbrl.Run': validateSchemaWithLxmlCommandLineXbrlRun,
156
- }
@@ -1,52 +0,0 @@
1
- '''
2
- This is an example of a plug-in to both GUI menu and command line/web service
3
- that will provide an option to replace behavior of table linkbase validation to
4
- generate vs diff table linkbase infoset files.
5
-
6
- See COPYRIGHT.md for copyright information.
7
- '''
8
- from arelle.Version import authorLabel, copyrightLabel
9
-
10
- def validateTableInfosetMenuEntender(cntlr, validateMenu):
11
- # Extend menu with an item for the save infoset plugin
12
- cntlr.modelManager.generateTableInfoset = cntlr.config.setdefault("generateTableInfoset",False)
13
- from tkinter import BooleanVar
14
- generateTableInfoset = BooleanVar(value=cntlr.modelManager.generateTableInfoset)
15
- def setTableInfosetOption(*args):
16
- cntlr.config["generateTableInfoset"] = cntlr.modelManager.generateTableInfoset = generateTableInfoset.get()
17
- generateTableInfoset.trace("w", setTableInfosetOption)
18
- validateMenu.add_checkbutton(label=_("Generate table infosets (instead of diffing them)"),
19
- underline=0,
20
- variable=generateTableInfoset, onvalue=True, offvalue=False)
21
-
22
- def validateTableInfosetCommandLineOptionExtender(parser):
23
- # extend command line options with a save DTS option
24
- parser.add_option("--generate-table-infoset",
25
- action="store_true",
26
- dest="generateTableInfoset",
27
- help=_("Generate table instance infosets (instead of diffing them)."))
28
-
29
- def validateTableInfosetCommandLineXbrlLoaded(cntlr, options, modelXbrl, *args, **kwargs):
30
- cntlr.modelManager.generateTableInfoset = getattr(options, "generateTableInfoset", False)
31
-
32
- def validateTableInfoset(modelXbrl, resultTableUri):
33
- diffToFile = not getattr(modelXbrl.modelManager, 'generateTableInfoset', False)
34
- from arelle import ViewFileRenderedGrid
35
- ViewFileRenderedGrid.viewRenderedGrid(modelXbrl,
36
- resultTableUri,
37
- diffToFile=diffToFile) # false to save infoset files
38
- return True # blocks standard behavior in validate.py
39
-
40
- __pluginInfo__ = {
41
- 'name': 'Validate Table Infoset (Optional behavior)',
42
- 'version': '0.9',
43
- 'description': "This plug-in adds a feature modify batch validation of table linkbase to save, versus diff, infoset files. ",
44
- 'license': 'Apache-2',
45
- 'author': authorLabel,
46
- 'copyright': copyrightLabel,
47
- # classes of mount points (required)
48
- 'CntlrWinMain.Menu.Validation': validateTableInfosetMenuEntender,
49
- 'CntlrCmdLine.Options': validateTableInfosetCommandLineOptionExtender,
50
- 'CntlrCmdLine.Xbrl.Loaded': validateTableInfosetCommandLineXbrlLoaded,
51
- 'Validate.TableInfoset': validateTableInfoset,
52
- }
@@ -1,90 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <!-- linkbase with prefix declarations used below, including us-gaap's of 2008-2011 -->
4
- <link:linkbase
5
- xmlns:link="http://www.xbrl.org/2003/linkbase"
6
- xmlns:xbrli="http://www.xbrl.org/2003/instance"
7
- xmlns:xlink="http://www.w3.org/1999/xlink"
8
- xmlns:generic="http://xbrl.org/2008/generic"
9
- xmlns:validation="http://xbrl.org/2008/validation"
10
- xmlns:va="http://xbrl.org/2008/assertion/value"
11
- xmlns:variable="http://xbrl.org/2008/variable"
12
- xmlns:cf="http://xbrl.org/2008/filter/concept"
13
- xmlns:gf="http://xbrl.org/2008/filter/general"
14
- xmlns:msg="http://xbrl.org/2010/message"
15
- xmlns:xfi="http://www.xbrl.org/2008/function/instance"
16
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17
- xmlns:dei-08="http://xbrl.us/dei/2008-03-31"
18
- xmlns:dei-09="http://xbrl.us/dei/2009-01-31"
19
- xmlns:dei-11="http://xbrl.sec.gov/dei/2011-01-31"
20
- xmlns:xbrldt="http://xbrl.org/2005/xbrldt"
21
- xsi:schemaLocation="
22
- http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd
23
- http://xbrl.org/2008/generic http://www.xbrl.org/2008/generic-link.xsd
24
- http://xbrl.org/2008/assertion/value http://www.xbrl.org/2008/value-assertion.xsd
25
- http://xbrl.org/2008/variable http://www.xbrl.org/2008/variable.xsd
26
- http://xbrl.org/2008/filter/concept http://www.xbrl.org/2008/concept-filter.xsd
27
- http://xbrl.org/2008/filter/general http://www.xbrl.org/2008/general-filter.xsd
28
- http://xbrl.org/2010/message http://www.xbrl.org/2010/generic-message.xsd
29
- ">
30
-
31
- <!-- arcroleRef's for arcroles used in the example -->
32
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-set" xlink:href="http://www.xbrl.org/2008/variable.xsd#variable-set" xlink:type="simple"/>
33
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-filter" xlink:href="http://www.xbrl.org/2008/variable.xsd#variable-filter" xlink:type="simple"/>
34
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2010/assertion-satisfied-message" xlink:href="http://www.xbrl.org/2010/validation-message.xsd#assertion-satisfied-message" xlink:type="simple"/>
35
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2010/assertion-unsatisfied-message" xlink:href="http://www.xbrl.org/2010/validation-message.xsd#assertion-unsatisfied-message" xlink:type="simple"/>
36
- <link:roleRef roleURI="http://www.xbrl.org/2008/role/link" xlink:href="http://www.xbrl.org/2008/generic-link.xsd#standard-link-role" xlink:type="simple"/>
37
-
38
- <generic:link xlink:type="extended"
39
- xlink:role="http://www.xbrl.org/2008/role/link">
40
-
41
- <!-- a value assertion that is always true, so that every filing will match
42
- and produce an assertion message with the DEI document type found -->
43
- <va:valueAssertion xlink:type="resource"
44
- xlink:label="extract-DEI-DocumentType"
45
- id="extract-Document-Type"
46
- test="true()"
47
- aspectModel="dimensional" implicitFiltering="true"/>
48
-
49
- <!-- the message, providing the DEI document type, for each filing that has one -->
50
- <msg:message xlink:type="resource" xlink:label="DEI-document-type-message"
51
- xlink:role="http://www.xbrl.org/2010/role/message"
52
- xml:lang="en">DEI document type is {
53
- $docType
54
- }</msg:message>
55
-
56
- <!-- arc from value assertion to the message -->
57
- <generic:arc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2010/assertion-satisfied-message"
58
- xlink:from="extract-DEI-DocumentType" xlink:to="DEI-document-type-message" order="1.0"/>
59
-
60
- <!-- arc from the value assertion to the variable which is the document type -->
61
- <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set"
62
- name="docType" xlink:from="extract-DEI-DocumentType" xlink:to="vDocType"/>
63
-
64
- <!-- filter for document type, by concept name, and 'required context' (all dimensions defaulted) -->
65
- <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter"
66
- complement="false" cover="true" xlink:from="vDocType" xlink:to="fDocType"/>
67
-
68
- <variable:factVariable xlink:type="resource" bindAsSequence="false"
69
- xlink:label="vDocType" />
70
-
71
- <!-- filter accepts 2009, 2009, or 2011 document type concept -->
72
- <cf:conceptName xlink:type="resource" xlink:label="fDocType">
73
- <cf:concept>
74
- <cf:qname>dei-08:DocumentType</cf:qname>
75
- </cf:concept>
76
- <cf:concept>
77
- <cf:qname>dei-09:DocumentType</cf:qname>
78
- </cf:concept>
79
- <cf:concept>
80
- <cf:qname>dei-11:DocumentType</cf:qname>
81
- </cf:concept>
82
- </cf:conceptName>
83
-
84
- <!-- EFM's required context means all dimensions absent (defaulted, segment must be empty -->
85
- <gf:general xlink:type="resource" xlink:label="fDocType"
86
- test="empty( xfi:segment(.) )" />
87
-
88
- </generic:link>
89
-
90
- </link:linkbase>
@@ -1,150 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <link:linkbase
4
- xmlns:link="http://www.xbrl.org/2003/linkbase"
5
- xmlns:xbrli="http://www.xbrl.org/2003/instance"
6
- xmlns:xlink="http://www.w3.org/1999/xlink"
7
- xmlns:generic="http://xbrl.org/2008/generic"
8
- xmlns:va="http://xbrl.org/2008/assertion/value"
9
- xmlns:variable="http://xbrl.org/2008/variable"
10
- xmlns:cf="http://xbrl.org/2008/filter/concept"
11
- xmlns:gf="http://xbrl.org/2008/filter/general"
12
- xmlns:pf="http://xbrl.org/2008/filter/period"
13
- xmlns:acf="http://xbrl.org/2010/filter/aspect-cover"
14
- xmlns:msg="http://xbrl.org/2010/message"
15
- xmlns:xfi="http://www.xbrl.org/2008/function/instance"
16
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17
- xmlns:dei-11="http://xbrl.sec.gov/dei/2011-01-31"
18
- xmlns:us-gaap-11="http://fasb.org/us-gaap/2011-01-31"
19
- xmlns:xbrldt="http://xbrl.org/2005/xbrldt"
20
- xsi:schemaLocation="
21
- http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd
22
- http://xbrl.org/2008/generic http://www.xbrl.org/2008/generic-link.xsd
23
- http://xbrl.org/2008/assertion/value http://www.xbrl.org/2008/value-assertion.xsd
24
- http://xbrl.org/2008/variable http://www.xbrl.org/2008/variable.xsd
25
- http://xbrl.org/2008/filter/concept http://www.xbrl.org/2008/concept-filter.xsd
26
- http://xbrl.org/2008/filter/general http://www.xbrl.org/2008/general-filter.xsd
27
- http://xbrl.org/2008/filter/period http://www.xbrl.org/2008/period-filter.xsd
28
- http://xbrl.org/2010/filter/aspect-cover http://www.xbrl.org/2010/aspect-cover-filter.xsd
29
- http://xbrl.org/2010/message http://www.xbrl.org/2010/generic-message.xsd
30
- ">
31
-
32
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-set" xlink:href="http://www.xbrl.org/2008/variable.xsd#variable-set" xlink:type="simple"/>
33
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-filter" xlink:href="http://www.xbrl.org/2008/variable.xsd#variable-filter" xlink:type="simple"/>
34
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2010/assertion-satisfied-message" xlink:href="http://www.xbrl.org/2010/validation-message.xsd#assertion-satisfied-message" xlink:type="simple"/>
35
- <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2010/assertion-unsatisfied-message" xlink:href="http://www.xbrl.org/2010/validation-message.xsd#assertion-unsatisfied-message" xlink:type="simple"/>
36
- <link:roleRef roleURI="http://www.xbrl.org/2008/role/link" xlink:href="http://www.xbrl.org/2008/generic-link.xsd#standard-link-role" xlink:type="simple"/>
37
-
38
- <generic:link xlink:type="extended"
39
- xlink:role="http://www.xbrl.org/2008/role/link">
40
-
41
- <va:valueAssertion xlink:type="resource"
42
- xlink:label="cash-ratio"
43
- id="cash-ratio"
44
- test="true()"
45
- aspectModel="dimensional" implicitFiltering="true"/>
46
-
47
- <msg:message xlink:type="resource" xlink:label="cash-ratio-message"
48
- xlink:role="http://www.xbrl.org/2010/role/message"
49
- xml:lang="en">Cash ratio {
50
- if ($currentLiabilities ne 0) then
51
- (($cash + $marketableSecurities) div $currentLiabilities)
52
- else
53
- 'not available'
54
- }, Current ratio {
55
- if ($currentLiabilities ne 0) then
56
- ($currentAssets div $currentLiabilities)
57
- else
58
- 'not available'
59
-
60
- }</msg:message>
61
-
62
- <generic:arc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2010/assertion-satisfied-message"
63
- xlink:from="cash-ratio" xlink:to="cash-ratio-message" order="1.0"/>
64
-
65
- <!-- fact variable, arcs, and filters for document type, restricted to 10-K or 10-Q -->
66
- <variable:factVariable xlink:type="resource" bindAsSequence="false"
67
- xlink:label="vDocType" />
68
- <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set"
69
- name="docType" xlink:from="cash-ratio" xlink:to="vDocType"/>
70
- <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter"
71
- complement="false" cover="true" xlink:from="vDocType" xlink:to="fDocType"/>
72
- <cf:conceptName xlink:type="resource" xlink:label="fDocType">
73
- <cf:concept>
74
- <cf:qname>dei-11:DocumentType</cf:qname>
75
- </cf:concept>
76
- </cf:conceptName>
77
-
78
- <!-- EFM's required context means all dimensions absent (defaulted)
79
- and only bind for a 10-K/10-Q filing (don't bind for other form types) -->
80
- <gf:general xlink:type="resource" xlink:label="fDocType"
81
- test="empty( xfi:segment(.) ) and index-of(('10-K', '10-Q'), .) " />
82
-
83
- <!-- must cover unit because this variable is a string type -->
84
- <acf:aspectCover xlink:type="resource" xlink:label="fDocType">
85
- <acf:aspect>unit</acf:aspect>
86
- </acf:aspectCover>
87
-
88
- <!-- cash -->
89
- <variable:factVariable xlink:type="resource" bindAsSequence="false"
90
- xlink:label="vCash" />
91
- <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set"
92
- name="cash" xlink:from="cash-ratio" xlink:to="vCash"/>
93
- <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter"
94
- complement="false" cover="true" xlink:from="vCash" xlink:to="fCash"/>
95
- <cf:conceptName xlink:type="resource" xlink:label="fCash">
96
- <cf:concept>
97
- <cf:qname>us-gaap-11:Cash</cf:qname>
98
- </cf:concept>
99
- <cf:concept>
100
- <cf:qname>us-gaap-11:CashAndCashEquivalentsAtCarryingValue</cf:qname>
101
- </cf:concept>
102
- </cf:conceptName>
103
- <!-- Must match period-end of documentType period -->
104
- <pf:instantDuration xlink:type="resource" xlink:label="fCash" boundary="end" variable="docType" />
105
-
106
- <!-- marketable securities -->
107
- <variable:factVariable xlink:type="resource" bindAsSequence="false" fallbackValue="0"
108
- xlink:label="vMarketableSecurities" />
109
- <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set"
110
- name="marketableSecurities" xlink:from="cash-ratio" xlink:to="vMarketableSecurities"/>
111
- <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter"
112
- complement="false" cover="true" xlink:from="vMarketableSecurities" xlink:to="fMarketableSecurities"/>
113
- <cf:conceptName xlink:type="resource" xlink:label="fMarketableSecurities">
114
- <cf:concept>
115
- <cf:qname>us-gaap-11:MarketableSecuritiesCurrent</cf:qname>
116
- </cf:concept>
117
- </cf:conceptName>
118
- <pf:instantDuration xlink:type="resource" xlink:label="fCash" boundary="end" variable="docType" />
119
-
120
- <!-- current liabilities -->
121
- <variable:factVariable xlink:type="resource" bindAsSequence="false" fallbackValue="0"
122
- xlink:label="vCurrentLiabilities" />
123
- <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set"
124
- name="currentLiabilities" xlink:from="cash-ratio" xlink:to="vCurrentLiabilities"/>
125
- <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter"
126
- complement="false" cover="true" xlink:from="vCurrentLiabilities" xlink:to="fCurrentLiabilities"/>
127
- <cf:conceptName xlink:type="resource" xlink:label="fCurrentLiabilities">
128
- <cf:concept>
129
- <cf:qname>us-gaap-11:LiabilitiesCurrent</cf:qname>
130
- </cf:concept>
131
- </cf:conceptName>
132
- <pf:instantDuration xlink:type="resource" xlink:label="fCurrentLiabilities" boundary="end" variable="docType" />
133
-
134
- <!-- current assets -->
135
- <variable:factVariable xlink:type="resource" bindAsSequence="false" fallbackValue="0"
136
- xlink:label="vCurrentAssets" />
137
- <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set"
138
- name="currentAssets" xlink:from="cash-ratio" xlink:to="vCurrentAssets"/>
139
- <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter"
140
- complement="false" cover="true" xlink:from="vCurrentAssets" xlink:to="fCurrentAssets"/>
141
- <cf:conceptName xlink:type="resource" xlink:label="fCurrentAssets">
142
- <cf:concept>
143
- <cf:qname>us-gaap-11:AssetsCurrent</cf:qname>
144
- </cf:concept>
145
- </cf:conceptName>
146
- <pf:instantDuration xlink:type="resource" xlink:label="fCurrentAssets" boundary="end" variable="docType" />
147
-
148
- </generic:link>
149
-
150
- </link:linkbase>