robotframework 6.1.1__zip → 7.0__zip

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 (307) hide show
  1. {robotframework-6.1.1 → robotframework-7.0}/INSTALL.rst +25 -25
  2. {robotframework-6.1.1 → robotframework-7.0}/PKG-INFO +6 -8
  3. {robotframework-6.1.1 → robotframework-7.0}/README.rst +3 -2
  4. {robotframework-6.1.1 → robotframework-7.0}/setup.py +3 -6
  5. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/__init__.py +4 -1
  6. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/deco.py +60 -14
  7. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/exceptions.py +6 -6
  8. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/interfaces.py +402 -67
  9. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/logger.py +27 -20
  10. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/parsing.py +4 -2
  11. robotframework-7.0/src/robot/api/py.typed +0 -0
  12. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/gatherfailed.py +2 -2
  13. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/languages.py +0 -9
  14. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/settings.py +21 -14
  15. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/storage.js +11 -6
  16. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/htmlfilewriter.py +1 -1
  17. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.css +10 -2
  18. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.html +10 -0
  19. robotframework-7.0/src/robot/htmldata/rebot/common.css +362 -0
  20. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/doc_formatting.css +13 -7
  21. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.css +51 -10
  22. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.html +14 -23
  23. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/model.js +2 -4
  24. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.css +83 -19
  25. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.html +22 -7
  26. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/testdata.js +10 -3
  27. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/view.js +84 -0
  28. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/template.py +3 -3
  29. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/builder.py +0 -8
  30. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/datatypes.py +9 -10
  31. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlutils.py +4 -7
  32. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonbuilder.py +38 -20
  33. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/model.py +21 -28
  34. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/robotbuilder.py +50 -31
  35. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/standardtypes.py +9 -1
  36. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlbuilder.py +35 -20
  37. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlwriter.py +18 -38
  38. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/BuiltIn.py +255 -205
  39. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Collections.py +384 -240
  40. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/DateTime.py +73 -60
  41. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/OperatingSystem.py +6 -5
  42. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Process.py +26 -27
  43. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Remote.py +40 -36
  44. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/String.py +66 -76
  45. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/XML.py +66 -59
  46. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/__init__.py +2 -2
  47. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/__init__.py +5 -5
  48. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/body.py +44 -13
  49. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/configurer.py +15 -11
  50. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/control.py +226 -84
  51. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/filter.py +31 -25
  52. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/itemlist.py +9 -8
  53. robotframework-7.0/src/robot/model/keyword.py +77 -0
  54. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/message.py +19 -10
  55. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modelobject.py +25 -7
  56. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/namepatterns.py +3 -25
  57. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/stats.py +9 -15
  58. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tags.py +1 -1
  59. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testcase.py +15 -27
  60. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testsuite.py +17 -26
  61. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/visitor.py +35 -8
  62. robotframework-7.0/src/robot/output/console/dotted.py +90 -0
  63. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/quiet.py +3 -2
  64. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/verbose.py +61 -61
  65. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/debugfile.py +39 -24
  66. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/filelogger.py +18 -15
  67. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/librarylogger.py +3 -2
  68. robotframework-7.0/src/robot/output/listeners.py +753 -0
  69. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/logger.py +216 -80
  70. robotframework-7.0/src/robot/output/loggerapi.py +215 -0
  71. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/loggerhelper.py +23 -56
  72. robotframework-7.0/src/robot/output/output.py +185 -0
  73. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/stdoutlogsplitter.py +8 -5
  74. robotframework-7.0/src/robot/output/xmllogger.py +459 -0
  75. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/blocklexers.py +17 -13
  76. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/context.py +12 -2
  77. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/lexer.py +1 -1
  78. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/settings.py +6 -3
  79. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/statementlexers.py +39 -10
  80. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokens.py +27 -29
  81. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/blocks.py +19 -6
  82. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/statements.py +193 -94
  83. robotframework-7.0/src/robot/parsing/model/visitor.py +100 -0
  84. {robotframework-6.1.1 → robotframework-7.0}/src/robot/rebot.py +2 -0
  85. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/expandkeywordmatcher.py +1 -1
  86. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsbuildingcontext.py +8 -6
  87. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsmodelbuilders.py +88 -61
  88. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/logreportwriters.py +16 -10
  89. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/outputwriter.py +18 -2
  90. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/resultwriter.py +4 -4
  91. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/stringcache.py +3 -3
  92. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/xunitwriter.py +15 -21
  93. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/__init__.py +3 -2
  94. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/configurer.py +12 -9
  95. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionresult.py +56 -8
  96. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/flattenkeywordmatcher.py +48 -9
  97. robotframework-7.0/src/robot/result/keywordremover.py +207 -0
  98. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/merger.py +1 -1
  99. robotframework-7.0/src/robot/result/model.py +1185 -0
  100. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/modeldeprecation.py +9 -3
  101. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/resultbuilder.py +46 -36
  102. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/xmlelementhandlers.py +83 -43
  103. {robotframework-6.1.1 → robotframework-7.0}/src/robot/run.py +2 -0
  104. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/__init__.py +14 -4
  105. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/__init__.py +2 -1
  106. robotframework-7.0/src/robot/running/arguments/argumentconverter.py +100 -0
  107. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentmapper.py +26 -24
  108. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentparser.py +82 -60
  109. robotframework-7.0/src/robot/running/arguments/argumentresolver.py +158 -0
  110. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentspec.py +83 -116
  111. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentvalidator.py +33 -27
  112. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/customconverters.py +15 -12
  113. robotframework-7.0/src/robot/running/arguments/embedded.py +145 -0
  114. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/typeconverters.py +233 -213
  115. robotframework-7.0/src/robot/running/arguments/typeinfo.py +317 -0
  116. robotframework-7.0/src/robot/running/arguments/typeinfoparser.py +219 -0
  117. robotframework-7.0/src/robot/running/arguments/typevalidator.py +60 -0
  118. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/bodyrunner.py +147 -129
  119. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/builders.py +2 -1
  120. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/parsers.py +10 -11
  121. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/settings.py +9 -17
  122. robotframework-7.0/src/robot/running/builder/transformers.py +535 -0
  123. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/context.py +113 -31
  124. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/dynamicmethods.py +62 -34
  125. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/importer.py +27 -49
  126. robotframework-7.0/src/robot/running/invalidkeyword.py +67 -0
  127. robotframework-7.0/src/robot/running/keywordfinder.py +91 -0
  128. robotframework-7.0/src/robot/running/keywordimplementation.py +164 -0
  129. robotframework-7.0/src/robot/running/librarykeyword.py +392 -0
  130. robotframework-7.0/src/robot/running/librarykeywordrunner.py +250 -0
  131. robotframework-7.0/src/robot/running/libraryscopes.py +115 -0
  132. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/model.py +195 -377
  133. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/namespace.py +124 -137
  134. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/outputcapture.py +20 -12
  135. robotframework-7.0/src/robot/running/resourcemodel.py +448 -0
  136. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/statusreporter.py +16 -13
  137. robotframework-7.0/src/robot/running/suiterunner.py +265 -0
  138. robotframework-7.0/src/robot/running/testlibraries.py +500 -0
  139. robotframework-7.0/src/robot/running/userkeywordrunner.py +260 -0
  140. {robotframework-6.1.1 → robotframework-7.0}/src/robot/testdoc.py +18 -13
  141. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/__init__.py +53 -35
  142. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/connectioncache.py +64 -59
  143. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/dotdict.py +3 -0
  144. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encodingsniffer.py +1 -1
  145. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/escaping.py +19 -19
  146. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/importer.py +2 -2
  147. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markupwriters.py +23 -15
  148. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/misc.py +1 -2
  149. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/normalizing.py +9 -24
  150. robotframework-7.0/src/robot/utils/notset.py +33 -0
  151. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/platform.py +15 -5
  152. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotio.py +9 -9
  153. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotpath.py +1 -0
  154. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottime.py +122 -90
  155. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottypes.py +21 -31
  156. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/setter.py +0 -5
  157. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/text.py +7 -4
  158. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/unic.py +2 -2
  159. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/__init__.py +2 -2
  160. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/assigner.py +17 -19
  161. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/evaluation.py +20 -17
  162. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/filesetter.py +80 -80
  163. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/replacer.py +33 -36
  164. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/scopes.py +17 -12
  165. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/search.py +66 -41
  166. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/store.py +14 -16
  167. robotframework-7.0/src/robot/variables/tablesetter.py +164 -0
  168. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/variables.py +1 -1
  169. {robotframework-6.1.1 → robotframework-7.0}/src/robot/version.py +1 -1
  170. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/PKG-INFO +6 -8
  171. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/SOURCES.txt +10 -8
  172. {robotframework-6.1.1 → robotframework-7.0}/tasks.py +6 -6
  173. robotframework-6.1.1/src/robot/htmldata/rebot/common.css +0 -239
  174. robotframework-6.1.1/src/robot/libraries/Reserved.py +0 -48
  175. robotframework-6.1.1/src/robot/model/keyword.py +0 -173
  176. robotframework-6.1.1/src/robot/output/console/dotted.py +0 -90
  177. robotframework-6.1.1/src/robot/output/listenerarguments.py +0 -165
  178. robotframework-6.1.1/src/robot/output/listenermethods.py +0 -113
  179. robotframework-6.1.1/src/robot/output/listeners.py +0 -174
  180. robotframework-6.1.1/src/robot/output/output.py +0 -95
  181. robotframework-6.1.1/src/robot/output/xmllogger.py +0 -354
  182. robotframework-6.1.1/src/robot/parsing/model/visitor.py +0 -67
  183. robotframework-6.1.1/src/robot/result/keywordremover.py +0 -183
  184. robotframework-6.1.1/src/robot/result/model.py +0 -957
  185. robotframework-6.1.1/src/robot/running/arguments/argumentconverter.py +0 -79
  186. robotframework-6.1.1/src/robot/running/arguments/argumentresolver.py +0 -131
  187. robotframework-6.1.1/src/robot/running/arguments/embedded.py +0 -146
  188. robotframework-6.1.1/src/robot/running/arguments/typevalidator.py +0 -56
  189. robotframework-6.1.1/src/robot/running/builder/transformers.py +0 -642
  190. robotframework-6.1.1/src/robot/running/handlers.py +0 -321
  191. robotframework-6.1.1/src/robot/running/handlerstore.py +0 -66
  192. robotframework-6.1.1/src/robot/running/librarykeywordrunner.py +0 -238
  193. robotframework-6.1.1/src/robot/running/libraryscopes.py +0 -97
  194. robotframework-6.1.1/src/robot/running/modelcombiner.py +0 -32
  195. robotframework-6.1.1/src/robot/running/suiterunner.py +0 -248
  196. robotframework-6.1.1/src/robot/running/testlibraries.py +0 -423
  197. robotframework-6.1.1/src/robot/running/usererrorhandler.py +0 -75
  198. robotframework-6.1.1/src/robot/running/userkeyword.py +0 -111
  199. robotframework-6.1.1/src/robot/running/userkeywordrunner.py +0 -274
  200. robotframework-6.1.1/src/robot/variables/tablesetter.py +0 -156
  201. {robotframework-6.1.1 → robotframework-7.0}/AUTHORS.rst +0 -0
  202. {robotframework-6.1.1 → robotframework-7.0}/BUILD.rst +0 -0
  203. {robotframework-6.1.1 → robotframework-7.0}/CONTRIBUTING.rst +0 -0
  204. {robotframework-6.1.1 → robotframework-7.0}/COPYRIGHT.txt +0 -0
  205. {robotframework-6.1.1 → robotframework-7.0}/LICENSE.txt +0 -0
  206. {robotframework-6.1.1 → robotframework-7.0}/MANIFEST.in +0 -0
  207. {robotframework-6.1.1 → robotframework-7.0}/setup.cfg +0 -0
  208. {robotframework-6.1.1 → robotframework-7.0}/src/robot/__init__.py +0 -0
  209. {robotframework-6.1.1 → robotframework-7.0}/src/robot/__main__.py +0 -0
  210. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/__init__.py +0 -0
  211. {robotframework-6.1.1 → robotframework-7.0}/src/robot/errors.py +0 -0
  212. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/__init__.py +0 -0
  213. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/__init__.py +0 -0
  214. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/js_disabled.css +0 -0
  215. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/jsonwriter.py +0 -0
  216. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/__init__.py +0 -0
  217. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
  218. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.min.js +0 -0
  219. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
  220. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
  221. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
  222. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/__init__.py +0 -0
  223. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
  224. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/print.css +0 -0
  225. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/pygments.css +0 -0
  226. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/__init__.py +0 -0
  227. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/fileloading.js +0 -0
  228. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.js +0 -0
  229. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/print.css +0 -0
  230. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/util.js +0 -0
  231. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/__init__.py +0 -0
  232. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.css +0 -0
  233. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.html +0 -0
  234. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdoc.py +0 -0
  235. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/__init__.py +0 -0
  236. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/consoleviewer.py +0 -0
  237. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlwriter.py +0 -0
  238. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonwriter.py +0 -0
  239. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/output.py +0 -0
  240. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/writer.py +0 -0
  241. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Dialogs.py +0 -0
  242. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Easter.py +0 -0
  243. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Screenshot.py +0 -0
  244. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Telnet.py +0 -0
  245. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/dialogs_py.py +0 -0
  246. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/fixture.py +0 -0
  247. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/metadata.py +0 -0
  248. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modifier.py +0 -0
  249. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/statistics.py +0 -0
  250. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/suitestatistics.py +0 -0
  251. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagsetter.py +0 -0
  252. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagstatistics.py +0 -0
  253. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/totalstatistics.py +0 -0
  254. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/__init__.py +0 -0
  255. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/__init__.py +0 -0
  256. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/highlighting.py +0 -0
  257. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/pyloggingconf.py +0 -0
  258. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/__init__.py +0 -0
  259. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/__init__.py +0 -0
  260. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokenizer.py +0 -0
  261. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/__init__.py +0 -0
  262. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/__init__.py +0 -0
  263. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/blockparsers.py +0 -0
  264. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/fileparser.py +0 -0
  265. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/parser.py +0 -0
  266. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/suitestructure.py +0 -0
  267. {robotframework-6.1.1 → robotframework-7.0}/src/robot/pythonpathsetter.py +0 -0
  268. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/__init__.py +0 -0
  269. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsexecutionresult.py +0 -0
  270. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jswriter.py +0 -0
  271. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionerrors.py +0 -0
  272. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/messagefilter.py +0 -0
  273. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/suiteteardownfailed.py +0 -0
  274. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/visitor.py +0 -0
  275. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/__init__.py +0 -0
  276. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/randomizer.py +0 -0
  277. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/runkwregister.py +0 -0
  278. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/signalhandler.py +0 -0
  279. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/status.py +0 -0
  280. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/__init__.py +0 -0
  281. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/posix.py +0 -0
  282. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/windows.py +0 -0
  283. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/application.py +0 -0
  284. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/argumentparser.py +0 -0
  285. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/asserts.py +0 -0
  286. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/charwidth.py +0 -0
  287. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/compress.py +0 -0
  288. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encoding.py +0 -0
  289. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/error.py +0 -0
  290. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/etreewrapper.py +0 -0
  291. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/filereader.py +0 -0
  292. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/frange.py +0 -0
  293. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/htmlformatters.py +0 -0
  294. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markuputils.py +0 -0
  295. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/match.py +0 -0
  296. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/recommendations.py +0 -0
  297. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/restreader.py +0 -0
  298. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotenv.py +0 -0
  299. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotinspect.py +0 -0
  300. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/sortable.py +0 -0
  301. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/typehints.py +0 -0
  302. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/finders.py +0 -0
  303. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/notfound.py +0 -0
  304. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/resolvable.py +0 -0
  305. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/dependency_links.txt +0 -0
  306. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/entry_points.txt +0 -0
  307. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/top_level.txt +0 -0
@@ -13,59 +13,62 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ from typing import TYPE_CHECKING
17
+
16
18
  from robot.errors import DataError
17
19
 
20
+ if TYPE_CHECKING:
21
+ from .argumentspec import ArgumentSpec
22
+
18
23
 
19
24
  class ArgumentMapper:
20
25
 
21
- def __init__(self, argspec):
22
- """:type argspec: :py:class:`robot.running.arguments.ArgumentSpec`"""
23
- self._argspec = argspec
26
+ def __init__(self, arg_spec: 'ArgumentSpec'):
27
+ self.arg_spec = arg_spec
24
28
 
25
29
  def map(self, positional, named, replace_defaults=True):
26
- template = KeywordCallTemplate(self._argspec)
30
+ template = KeywordCallTemplate(self.arg_spec)
27
31
  template.fill_positional(positional)
28
32
  template.fill_named(named)
29
33
  if replace_defaults:
30
34
  template.replace_defaults()
31
- return template.args, template.kwargs
35
+ return template.positional, template.named
32
36
 
33
37
 
34
38
  class KeywordCallTemplate:
35
39
 
36
- def __init__(self, argspec):
37
- """:type argspec: :py:class:`robot.running.arguments.ArgumentSpec`"""
38
- self._argspec = argspec
39
- self.args = [None if arg not in argspec.defaults
40
- else DefaultValue(argspec.defaults[arg])
41
- for arg in argspec.positional]
42
- self.kwargs = []
40
+ def __init__(self, spec: 'ArgumentSpec'):
41
+ self.spec = spec
42
+ self.positional = [DefaultValue(spec.defaults[arg])
43
+ if arg in spec.defaults else None
44
+ for arg in spec.positional]
45
+ self.named = []
43
46
 
44
47
  def fill_positional(self, positional):
45
- self.args[:len(positional)] = positional
48
+ self.positional[:len(positional)] = positional
46
49
 
47
50
  def fill_named(self, named):
48
- spec = self._argspec
51
+ spec = self.spec
49
52
  for name, value in named:
50
53
  if name in spec.positional_or_named:
51
54
  index = spec.positional_or_named.index(name)
52
- self.args[index] = value
55
+ self.positional[index] = value
53
56
  elif spec.var_named or name in spec.named_only:
54
- self.kwargs.append((name, value))
57
+ self.named.append((name, value))
55
58
  else:
56
- raise DataError("Non-existing named argument '%s'." % name)
59
+ raise DataError(f"Non-existing named argument '{name}'.")
57
60
  named_names = {name for name, _ in named}
58
61
  for name in spec.named_only:
59
62
  if name not in named_names:
60
63
  value = DefaultValue(spec.defaults[name])
61
- self.kwargs.append((name, value))
64
+ self.named.append((name, value))
62
65
 
63
66
  def replace_defaults(self):
64
67
  is_default = lambda arg: isinstance(arg, DefaultValue)
65
- while self.args and is_default(self.args[-1]):
66
- self.args.pop()
67
- self.args = [a if not is_default(a) else a.value for a in self.args]
68
- self.kwargs = [(n, v) for n, v in self.kwargs if not is_default(v)]
68
+ while self.positional and is_default(self.positional[-1]):
69
+ self.positional.pop()
70
+ self.positional = [a if not is_default(a) else a.value for a in self.positional]
71
+ self.named = [(n, v) for n, v in self.named if not is_default(v)]
69
72
 
70
73
 
71
74
  class DefaultValue:
@@ -77,5 +80,4 @@ class DefaultValue:
77
80
  try:
78
81
  return variables.replace_scalar(self.value)
79
82
  except DataError as err:
80
- raise DataError('Resolving argument default values failed: %s'
81
- % err.message)
83
+ raise DataError(f'Resolving argument default values failed: {err}')
@@ -15,7 +15,7 @@
15
15
 
16
16
  from abc import ABC, abstractmethod
17
17
  from inspect import isclass, signature, Parameter
18
- from typing import get_type_hints
18
+ from typing import Any, Callable, get_type_hints
19
19
 
20
20
  from robot.errors import DataError
21
21
  from robot.utils import is_string, split_from_equals
@@ -26,35 +26,29 @@ from .argumentspec import ArgumentSpec
26
26
 
27
27
  class ArgumentParser(ABC):
28
28
 
29
- def __init__(self, type='Keyword', error_reporter=None):
30
- self._type = type
31
- self._error_reporter = error_reporter
29
+ def __init__(self, type: str = 'Keyword',
30
+ error_reporter: 'Callable[[str], None] | None' = None):
31
+ self.type = type
32
+ self.error_reporter = error_reporter
32
33
 
33
34
  @abstractmethod
34
- def parse(self, source, name=None):
35
+ def parse(self, source: Any, name: 'str|None' = None) -> ArgumentSpec:
35
36
  raise NotImplementedError
36
37
 
37
- def _report_error(self, error):
38
- if self._error_reporter:
39
- self._error_reporter(error)
38
+ def _report_error(self, error: str):
39
+ if self.error_reporter:
40
+ self.error_reporter(error)
40
41
  else:
41
42
  raise DataError(f'Invalid argument specification: {error}')
42
43
 
43
44
 
44
45
  class PythonArgumentParser(ArgumentParser):
45
46
 
46
- def parse(self, handler, name=None):
47
- spec = ArgumentSpec(name, self._type)
48
- self._set_args(spec, handler)
49
- self._set_types(spec, handler)
50
- return spec
51
-
52
- def _set_args(self, spec, handler):
47
+ def parse(self, method, name=None):
53
48
  try:
54
- sig = signature(handler)
49
+ sig = signature(method)
55
50
  except ValueError: # Can occur with C functions (incl. many builtins).
56
- spec.var_positional = 'args'
57
- return
51
+ return ArgumentSpec(name, self.type, var_positional='args')
58
52
  except TypeError as err: # Occurs if handler isn't actually callable.
59
53
  raise DataError(str(err))
60
54
  parameters = list(sig.parameters.values())
@@ -62,76 +56,104 @@ class PythonArgumentParser(ArgumentParser):
62
56
  # inspecting keywords. `__init__` is got directly from class (i.e. isn't bound)
63
57
  # so we need to handle that case ourselves.
64
58
  # Partial objects do not have __name__ at least in Python =< 3.10.
65
- if getattr(handler, '__name__', None) == '__init__':
59
+ if getattr(method, '__name__', None) == '__init__':
66
60
  parameters = parameters[1:]
67
- setters = {
68
- Parameter.POSITIONAL_ONLY: spec.positional_only.append,
69
- Parameter.POSITIONAL_OR_KEYWORD: spec.positional_or_named.append,
70
- Parameter.VAR_POSITIONAL: lambda name: setattr(spec, 'var_positional', name),
71
- Parameter.KEYWORD_ONLY: spec.named_only.append,
72
- Parameter.VAR_KEYWORD: lambda name: setattr(spec, 'var_named', name),
73
- }
61
+ spec = self._create_spec(parameters, name)
62
+ self._set_types(spec, method)
63
+ return spec
64
+
65
+ def _create_spec(self, parameters, name):
66
+ positional_only = []
67
+ positional_or_named = []
68
+ var_positional = None
69
+ named_only = []
70
+ var_named = None
71
+ defaults = {}
74
72
  for param in parameters:
75
- setters[param.kind](param.name)
73
+ kind = param.kind
74
+ if kind == Parameter.POSITIONAL_ONLY:
75
+ positional_only.append(param.name)
76
+ elif kind == Parameter.POSITIONAL_OR_KEYWORD:
77
+ positional_or_named.append(param.name)
78
+ elif kind == Parameter.VAR_POSITIONAL:
79
+ var_positional = param.name
80
+ elif kind == Parameter.KEYWORD_ONLY:
81
+ named_only.append(param.name)
82
+ elif kind == Parameter.VAR_KEYWORD:
83
+ var_named = param.name
76
84
  if param.default is not param.empty:
77
- spec.defaults[param.name] = param.default
85
+ defaults[param.name] = param.default
86
+ return ArgumentSpec(name, self.type, positional_only, positional_or_named,
87
+ var_positional, named_only, var_named, defaults)
88
+
89
+ def _set_types(self, spec, method):
90
+ types = self._get_types(method)
91
+ if isinstance(types, dict) and 'return' in types:
92
+ spec.return_type = types.pop('return')
93
+ spec.types = types
78
94
 
79
- def _set_types(self, spec, handler):
95
+ def _get_types(self, method):
80
96
  # If types are set using the `@keyword` decorator, use them. Including when
81
- # types are explicitly disabled with `@keyword(types=None)`. Otherwise read
97
+ # types are explicitly disabled with `@keyword(types=None)`. Otherwise get
82
98
  # type hints.
83
- if isclass(handler):
84
- handler = handler.__init__
85
- robot_types = getattr(handler, 'robot_types', ())
86
- if robot_types or robot_types is None:
87
- spec.types = robot_types
88
- else:
89
- spec.types = self._get_type_hints(handler)
90
-
91
- def _get_type_hints(self, handler):
99
+ if isclass(method):
100
+ method = method.__init__
101
+ types = getattr(method, 'robot_types', ())
102
+ if types or types is None:
103
+ return types
92
104
  try:
93
- return get_type_hints(handler)
105
+ return get_type_hints(method)
94
106
  except Exception: # Can raise pretty much anything
95
107
  # Not all functions have `__annotations__`.
96
108
  # https://github.com/robotframework/robotframework/issues/4059
97
- return getattr(handler, '__annotations__', {})
109
+ return getattr(method, '__annotations__', {})
98
110
 
99
111
 
100
112
  class ArgumentSpecParser(ArgumentParser):
101
113
 
102
- def parse(self, argspec, name=None):
103
- spec = ArgumentSpec(name, self._type)
104
- named_only = positional_only_separator_seen = False
105
- for arg in argspec:
114
+ def parse(self, arguments, name=None):
115
+ positional_only = []
116
+ positional_or_named = []
117
+ var_positional = None
118
+ named_only = []
119
+ var_named = None
120
+ defaults = {}
121
+ named_only_separator_seen = positional_only_separator_seen = False
122
+ target = positional_or_named
123
+ for arg in arguments:
106
124
  arg = self._validate_arg(arg)
107
- if spec.var_named:
125
+ if var_named:
108
126
  self._report_error('Only last argument can be kwargs.')
109
127
  elif self._is_positional_only_separator(arg):
110
- if named_only:
111
- self._report_error('Positional-only separator must be before '
112
- 'named-only arguments.')
113
128
  if positional_only_separator_seen:
114
129
  self._report_error('Too many positional-only separators.')
115
- spec.positional_only = spec.positional_or_named
116
- spec.positional_or_named = []
130
+ if named_only_separator_seen:
131
+ self._report_error('Positional-only separator must be before '
132
+ 'named-only arguments.')
133
+ positional_only = positional_or_named
134
+ target = positional_or_named = []
117
135
  positional_only_separator_seen = True
118
136
  elif isinstance(arg, tuple):
119
137
  arg, default = arg
120
- arg = self._add_arg(spec, arg, named_only)
121
- spec.defaults[arg] = default
138
+ arg = self._format_arg(arg)
139
+ target.append(arg)
140
+ defaults[arg] = default
122
141
  elif self._is_var_named(arg):
123
- spec.var_named = self._format_var_named(arg)
142
+ var_named = self._format_var_named(arg)
124
143
  elif self._is_var_positional(arg):
125
- if named_only:
144
+ if named_only_separator_seen:
126
145
  self._report_error('Cannot have multiple varargs.')
127
146
  if not self._is_named_only_separator(arg):
128
- spec.var_positional = self._format_var_positional(arg)
129
- named_only = True
130
- elif spec.defaults and not named_only:
147
+ var_positional = self._format_var_positional(arg)
148
+ named_only_separator_seen = True
149
+ target = named_only
150
+ elif defaults and not named_only_separator_seen:
131
151
  self._report_error('Non-default argument after default arguments.')
132
152
  else:
133
- self._add_arg(spec, arg, named_only)
134
- return spec
153
+ arg = self._format_arg(arg)
154
+ target.append(arg)
155
+ return ArgumentSpec(name, self.type, positional_only, positional_or_named,
156
+ var_positional, named_only, var_named, defaults)
135
157
 
136
158
  @abstractmethod
137
159
  def _validate_arg(self, arg):
@@ -0,0 +1,158 @@
1
+ # Copyright 2008-2015 Nokia Networks
2
+ # Copyright 2016- Robot Framework Foundation
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from typing import TYPE_CHECKING
17
+
18
+ from robot.errors import DataError
19
+ from robot.utils import is_dict_like, is_list_like, split_from_equals
20
+ from robot.variables import is_dict_variable
21
+
22
+ from .argumentvalidator import ArgumentValidator
23
+
24
+ if TYPE_CHECKING:
25
+ from .argumentspec import ArgumentSpec
26
+
27
+
28
+ class ArgumentResolver:
29
+
30
+ def __init__(self, spec: 'ArgumentSpec',
31
+ resolve_named: bool = True,
32
+ resolve_args_until: 'int|None' = None,
33
+ dict_to_kwargs: bool = False):
34
+ self.named_resolver = NamedArgumentResolver(spec) \
35
+ if resolve_named else NullNamedArgumentResolver()
36
+ self.variable_replacer = VariableReplacer(spec, resolve_args_until)
37
+ self.dict_to_kwargs = DictToKwargs(spec, dict_to_kwargs)
38
+ self.argument_validator = ArgumentValidator(spec)
39
+
40
+ def resolve(self, arguments, variables=None):
41
+ if len(arguments) == 2 and is_list_like(arguments[0]) and is_dict_like(arguments[1]):
42
+ positional = list(arguments[0])
43
+ named = list(arguments[1].items())
44
+ else:
45
+ positional, named = self.named_resolver.resolve(arguments, variables)
46
+ positional, named = self.variable_replacer.replace(positional, named, variables)
47
+ positional, named = self.dict_to_kwargs.handle(positional, named)
48
+ self.argument_validator.validate(positional, named, dryrun=variables is None)
49
+ return positional, named
50
+
51
+
52
+ class NamedArgumentResolver:
53
+
54
+ def __init__(self, spec: 'ArgumentSpec'):
55
+ self.spec = spec
56
+
57
+ def resolve(self, arguments, variables=None):
58
+ spec = self.spec
59
+ positional = list(arguments[:len(spec.embedded)])
60
+ named = []
61
+ for arg in arguments[len(spec.embedded):]:
62
+ if is_dict_variable(arg):
63
+ named.append(arg)
64
+ else:
65
+ name, value = self._split_named(arg, named, variables, spec)
66
+ if name is not None:
67
+ named.append((name, value))
68
+ elif named:
69
+ self._raise_positional_after_named()
70
+ else:
71
+ positional.append(value)
72
+ return positional, named
73
+
74
+ def _split_named(self, arg, previous_named, variables, spec):
75
+ if isinstance(arg, tuple):
76
+ if len(arg) == 2 and isinstance(arg[0], str):
77
+ return arg
78
+ elif len(arg) == 1:
79
+ return None, arg[0]
80
+ else:
81
+ return None, arg
82
+ name, value = split_from_equals(arg)
83
+ if value is None or not self._is_named(name, previous_named, variables, spec):
84
+ return None, arg
85
+ return name, value
86
+
87
+ def _is_named(self, name, previous_named, variables, spec):
88
+ if previous_named or spec.var_named:
89
+ return True
90
+ if variables:
91
+ try:
92
+ name = variables.replace_scalar(name)
93
+ except DataError:
94
+ return False
95
+ return name in spec.named
96
+
97
+ def _raise_positional_after_named(self):
98
+ raise DataError(f"{self.spec.type.capitalize()} '{self.spec.name}' "
99
+ f"got positional argument after named arguments.")
100
+
101
+
102
+ class NullNamedArgumentResolver:
103
+
104
+ def resolve(self, arguments, variables=None):
105
+ return arguments, []
106
+
107
+
108
+ class DictToKwargs:
109
+
110
+ def __init__(self, spec: 'ArgumentSpec', enabled: bool = False):
111
+ self.maxargs = spec.maxargs
112
+ self.enabled = enabled and bool(spec.var_named)
113
+
114
+ def handle(self, positional, named):
115
+ if self.enabled and self._extra_arg_has_kwargs(positional, named):
116
+ named = positional.pop().items()
117
+ return positional, named
118
+
119
+ def _extra_arg_has_kwargs(self, positional, named):
120
+ if named or len(positional) != self.maxargs + 1:
121
+ return False
122
+ return is_dict_like(positional[-1])
123
+
124
+
125
+ class VariableReplacer:
126
+
127
+ def __init__(self, spec: 'ArgumentSpec', resolve_until: 'int|None' = None):
128
+ self.spec = spec
129
+ self.resolve_until = resolve_until
130
+
131
+ def replace(self, positional, named, variables=None):
132
+ # `variables` is None in dry-run mode and when using Libdoc.
133
+ if variables:
134
+ if self.spec.embedded:
135
+ embedded = len(self.spec.embedded)
136
+ positional = [
137
+ variables.replace_scalar(emb) for emb in positional[:embedded]
138
+ ] + variables.replace_list(positional[embedded:])
139
+ else:
140
+ positional = variables.replace_list(positional, self.resolve_until)
141
+ named = list(self._replace_named(named, variables.replace_scalar))
142
+ else:
143
+ # If `var` isn't a tuple, it's a &{dict} variables.
144
+ named = [var if isinstance(var, tuple) else (var, var) for var in named]
145
+ return positional, named
146
+
147
+ def _replace_named(self, named, replace_scalar):
148
+ for item in named:
149
+ for name, value in self._get_replaced_named(item, replace_scalar):
150
+ if not isinstance(name, str):
151
+ raise DataError('Argument names must be strings.')
152
+ yield name, value
153
+
154
+ def _get_replaced_named(self, item, replace_scalar):
155
+ if not isinstance(item, tuple):
156
+ return replace_scalar(item).items()
157
+ name, value = item
158
+ return [(replace_scalar(name), replace_scalar(value))]