robotframework 6.1rc1__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.1rc1 → robotframework-7.0}/INSTALL.rst +25 -25
  2. {robotframework-6.1rc1 → robotframework-7.0}/PKG-INFO +6 -8
  3. {robotframework-6.1rc1 → robotframework-7.0}/README.rst +3 -2
  4. {robotframework-6.1rc1 → robotframework-7.0}/setup.py +3 -6
  5. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/__init__.py +4 -1
  6. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/deco.py +60 -14
  7. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/exceptions.py +6 -6
  8. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/interfaces.py +403 -68
  9. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/logger.py +27 -20
  10. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/parsing.py +4 -2
  11. robotframework-7.0/src/robot/api/py.typed +0 -0
  12. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/gatherfailed.py +2 -2
  13. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/languages.py +61 -25
  14. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/settings.py +21 -14
  15. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/storage.js +11 -6
  16. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/htmlfilewriter.py +1 -1
  17. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.css +10 -2
  18. {robotframework-6.1rc1 → 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.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/doc_formatting.css +13 -7
  21. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.css +51 -10
  22. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.html +14 -23
  23. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/model.js +2 -4
  24. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/report.css +83 -19
  25. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/report.html +22 -7
  26. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/testdata.js +10 -3
  27. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/view.js +84 -0
  28. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/template.py +3 -3
  29. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/builder.py +0 -8
  30. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/datatypes.py +9 -10
  31. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/htmlutils.py +4 -7
  32. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/jsonbuilder.py +38 -20
  33. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/model.py +21 -28
  34. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/robotbuilder.py +50 -31
  35. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/standardtypes.py +9 -1
  36. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/xmlbuilder.py +35 -20
  37. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/xmlwriter.py +18 -38
  38. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/BuiltIn.py +255 -205
  39. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Collections.py +384 -240
  40. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/DateTime.py +73 -60
  41. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/OperatingSystem.py +6 -5
  42. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Process.py +26 -27
  43. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Remote.py +40 -36
  44. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/String.py +66 -76
  45. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/XML.py +66 -59
  46. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/__init__.py +2 -2
  47. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/dialogs_py.py +14 -2
  48. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/__init__.py +5 -5
  49. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/body.py +44 -13
  50. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/configurer.py +19 -15
  51. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/control.py +230 -88
  52. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/filter.py +31 -25
  53. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/itemlist.py +9 -8
  54. robotframework-7.0/src/robot/model/keyword.py +77 -0
  55. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/message.py +19 -10
  56. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/modelobject.py +27 -15
  57. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/modifier.py +1 -1
  58. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/namepatterns.py +3 -25
  59. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/stats.py +9 -15
  60. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tags.py +1 -1
  61. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/testcase.py +15 -27
  62. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/testsuite.py +44 -28
  63. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/visitor.py +35 -8
  64. robotframework-7.0/src/robot/output/console/dotted.py +90 -0
  65. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/quiet.py +3 -2
  66. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/verbose.py +61 -61
  67. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/debugfile.py +39 -24
  68. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/filelogger.py +18 -15
  69. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/librarylogger.py +3 -2
  70. robotframework-7.0/src/robot/output/listeners.py +753 -0
  71. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/logger.py +216 -80
  72. robotframework-7.0/src/robot/output/loggerapi.py +215 -0
  73. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/loggerhelper.py +23 -56
  74. robotframework-7.0/src/robot/output/output.py +185 -0
  75. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/stdoutlogsplitter.py +8 -5
  76. robotframework-7.0/src/robot/output/xmllogger.py +459 -0
  77. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/blocklexers.py +17 -13
  78. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/context.py +12 -2
  79. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/lexer.py +1 -1
  80. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/settings.py +6 -3
  81. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/statementlexers.py +39 -10
  82. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/tokens.py +27 -29
  83. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/blocks.py +19 -6
  84. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/statements.py +193 -94
  85. robotframework-7.0/src/robot/parsing/model/visitor.py +100 -0
  86. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/rebot.py +2 -0
  87. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/expandkeywordmatcher.py +1 -1
  88. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsbuildingcontext.py +8 -6
  89. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsmodelbuilders.py +88 -61
  90. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/logreportwriters.py +16 -10
  91. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/outputwriter.py +18 -2
  92. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/resultwriter.py +4 -4
  93. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/stringcache.py +3 -3
  94. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/xunitwriter.py +15 -21
  95. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/__init__.py +3 -2
  96. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/configurer.py +12 -9
  97. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/executionresult.py +56 -8
  98. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/flattenkeywordmatcher.py +48 -9
  99. robotframework-7.0/src/robot/result/keywordremover.py +207 -0
  100. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/merger.py +1 -1
  101. robotframework-7.0/src/robot/result/model.py +1185 -0
  102. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/modeldeprecation.py +9 -3
  103. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/resultbuilder.py +46 -36
  104. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/xmlelementhandlers.py +83 -43
  105. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/run.py +3 -1
  106. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/__init__.py +14 -4
  107. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/__init__.py +2 -1
  108. robotframework-7.0/src/robot/running/arguments/argumentconverter.py +100 -0
  109. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentmapper.py +26 -24
  110. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentparser.py +85 -61
  111. robotframework-7.0/src/robot/running/arguments/argumentresolver.py +158 -0
  112. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentspec.py +83 -116
  113. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentvalidator.py +33 -27
  114. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/customconverters.py +15 -12
  115. robotframework-7.0/src/robot/running/arguments/embedded.py +145 -0
  116. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/typeconverters.py +268 -220
  117. robotframework-7.0/src/robot/running/arguments/typeinfo.py +317 -0
  118. robotframework-7.0/src/robot/running/arguments/typeinfoparser.py +219 -0
  119. robotframework-7.0/src/robot/running/arguments/typevalidator.py +60 -0
  120. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/bodyrunner.py +147 -129
  121. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/builders.py +17 -26
  122. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/parsers.py +17 -11
  123. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/settings.py +9 -17
  124. robotframework-7.0/src/robot/running/builder/transformers.py +535 -0
  125. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/context.py +113 -31
  126. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/dynamicmethods.py +62 -34
  127. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/importer.py +27 -49
  128. robotframework-7.0/src/robot/running/invalidkeyword.py +67 -0
  129. robotframework-7.0/src/robot/running/keywordfinder.py +91 -0
  130. robotframework-7.0/src/robot/running/keywordimplementation.py +164 -0
  131. robotframework-7.0/src/robot/running/librarykeyword.py +392 -0
  132. robotframework-7.0/src/robot/running/librarykeywordrunner.py +250 -0
  133. robotframework-7.0/src/robot/running/libraryscopes.py +115 -0
  134. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/model.py +198 -337
  135. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/namespace.py +124 -137
  136. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/outputcapture.py +20 -12
  137. robotframework-7.0/src/robot/running/resourcemodel.py +448 -0
  138. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/statusreporter.py +16 -13
  139. robotframework-7.0/src/robot/running/suiterunner.py +265 -0
  140. robotframework-7.0/src/robot/running/testlibraries.py +500 -0
  141. robotframework-7.0/src/robot/running/userkeywordrunner.py +260 -0
  142. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/testdoc.py +18 -13
  143. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/__init__.py +53 -35
  144. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/connectioncache.py +64 -59
  145. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/dotdict.py +3 -0
  146. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/encodingsniffer.py +9 -4
  147. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/escaping.py +19 -19
  148. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/importer.py +2 -2
  149. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/markupwriters.py +23 -15
  150. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/misc.py +1 -2
  151. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/normalizing.py +9 -24
  152. robotframework-7.0/src/robot/utils/notset.py +33 -0
  153. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/platform.py +15 -5
  154. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotio.py +9 -9
  155. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotpath.py +1 -0
  156. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robottime.py +122 -90
  157. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robottypes.py +21 -31
  158. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/setter.py +0 -5
  159. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/text.py +7 -4
  160. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/unic.py +2 -2
  161. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/__init__.py +2 -2
  162. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/assigner.py +17 -19
  163. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/evaluation.py +20 -17
  164. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/filesetter.py +80 -80
  165. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/replacer.py +33 -36
  166. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/scopes.py +17 -12
  167. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/search.py +66 -41
  168. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/store.py +14 -16
  169. robotframework-7.0/src/robot/variables/tablesetter.py +164 -0
  170. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/variables.py +1 -1
  171. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/version.py +1 -1
  172. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/PKG-INFO +6 -8
  173. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/SOURCES.txt +10 -8
  174. {robotframework-6.1rc1 → robotframework-7.0}/tasks.py +6 -6
  175. robotframework-6.1rc1/src/robot/htmldata/rebot/common.css +0 -239
  176. robotframework-6.1rc1/src/robot/libraries/Reserved.py +0 -48
  177. robotframework-6.1rc1/src/robot/model/keyword.py +0 -173
  178. robotframework-6.1rc1/src/robot/output/console/dotted.py +0 -90
  179. robotframework-6.1rc1/src/robot/output/listenerarguments.py +0 -165
  180. robotframework-6.1rc1/src/robot/output/listenermethods.py +0 -113
  181. robotframework-6.1rc1/src/robot/output/listeners.py +0 -174
  182. robotframework-6.1rc1/src/robot/output/output.py +0 -95
  183. robotframework-6.1rc1/src/robot/output/xmllogger.py +0 -354
  184. robotframework-6.1rc1/src/robot/parsing/model/visitor.py +0 -67
  185. robotframework-6.1rc1/src/robot/result/keywordremover.py +0 -183
  186. robotframework-6.1rc1/src/robot/result/model.py +0 -957
  187. robotframework-6.1rc1/src/robot/running/arguments/argumentconverter.py +0 -79
  188. robotframework-6.1rc1/src/robot/running/arguments/argumentresolver.py +0 -131
  189. robotframework-6.1rc1/src/robot/running/arguments/embedded.py +0 -146
  190. robotframework-6.1rc1/src/robot/running/arguments/typevalidator.py +0 -56
  191. robotframework-6.1rc1/src/robot/running/builder/transformers.py +0 -642
  192. robotframework-6.1rc1/src/robot/running/handlers.py +0 -321
  193. robotframework-6.1rc1/src/robot/running/handlerstore.py +0 -66
  194. robotframework-6.1rc1/src/robot/running/librarykeywordrunner.py +0 -238
  195. robotframework-6.1rc1/src/robot/running/libraryscopes.py +0 -97
  196. robotframework-6.1rc1/src/robot/running/modelcombiner.py +0 -32
  197. robotframework-6.1rc1/src/robot/running/suiterunner.py +0 -249
  198. robotframework-6.1rc1/src/robot/running/testlibraries.py +0 -420
  199. robotframework-6.1rc1/src/robot/running/usererrorhandler.py +0 -75
  200. robotframework-6.1rc1/src/robot/running/userkeyword.py +0 -111
  201. robotframework-6.1rc1/src/robot/running/userkeywordrunner.py +0 -274
  202. robotframework-6.1rc1/src/robot/variables/tablesetter.py +0 -156
  203. {robotframework-6.1rc1 → robotframework-7.0}/AUTHORS.rst +0 -0
  204. {robotframework-6.1rc1 → robotframework-7.0}/BUILD.rst +0 -0
  205. {robotframework-6.1rc1 → robotframework-7.0}/CONTRIBUTING.rst +0 -0
  206. {robotframework-6.1rc1 → robotframework-7.0}/COPYRIGHT.txt +0 -0
  207. {robotframework-6.1rc1 → robotframework-7.0}/LICENSE.txt +0 -0
  208. {robotframework-6.1rc1 → robotframework-7.0}/MANIFEST.in +0 -0
  209. {robotframework-6.1rc1 → robotframework-7.0}/setup.cfg +0 -0
  210. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/__init__.py +0 -0
  211. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/__main__.py +0 -0
  212. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/__init__.py +0 -0
  213. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/errors.py +0 -0
  214. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/__init__.py +0 -0
  215. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/__init__.py +0 -0
  216. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/js_disabled.css +0 -0
  217. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/jsonwriter.py +0 -0
  218. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/__init__.py +0 -0
  219. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
  220. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.min.js +0 -0
  221. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
  222. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
  223. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
  224. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/__init__.py +0 -0
  225. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
  226. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/print.css +0 -0
  227. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/pygments.css +0 -0
  228. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/__init__.py +0 -0
  229. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/fileloading.js +0 -0
  230. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.js +0 -0
  231. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/print.css +0 -0
  232. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/util.js +0 -0
  233. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/__init__.py +0 -0
  234. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.css +0 -0
  235. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.html +0 -0
  236. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdoc.py +0 -0
  237. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/__init__.py +0 -0
  238. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/consoleviewer.py +0 -0
  239. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/htmlwriter.py +0 -0
  240. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/jsonwriter.py +0 -0
  241. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/output.py +0 -0
  242. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/writer.py +0 -0
  243. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Dialogs.py +0 -0
  244. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Easter.py +0 -0
  245. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Screenshot.py +0 -0
  246. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Telnet.py +0 -0
  247. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/fixture.py +0 -0
  248. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/metadata.py +0 -0
  249. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/statistics.py +0 -0
  250. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/suitestatistics.py +0 -0
  251. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tagsetter.py +0 -0
  252. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tagstatistics.py +0 -0
  253. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/totalstatistics.py +0 -0
  254. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/__init__.py +0 -0
  255. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/__init__.py +0 -0
  256. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/highlighting.py +0 -0
  257. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/pyloggingconf.py +0 -0
  258. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/__init__.py +0 -0
  259. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/__init__.py +0 -0
  260. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/tokenizer.py +0 -0
  261. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/__init__.py +0 -0
  262. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/__init__.py +0 -0
  263. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/blockparsers.py +0 -0
  264. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/fileparser.py +0 -0
  265. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/parser.py +0 -0
  266. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/suitestructure.py +0 -0
  267. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/pythonpathsetter.py +0 -0
  268. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/__init__.py +0 -0
  269. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsexecutionresult.py +0 -0
  270. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jswriter.py +0 -0
  271. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/executionerrors.py +0 -0
  272. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/messagefilter.py +0 -0
  273. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/suiteteardownfailed.py +0 -0
  274. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/visitor.py +0 -0
  275. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/__init__.py +0 -0
  276. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/randomizer.py +0 -0
  277. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/runkwregister.py +0 -0
  278. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/signalhandler.py +0 -0
  279. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/status.py +0 -0
  280. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/__init__.py +0 -0
  281. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/posix.py +0 -0
  282. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/windows.py +0 -0
  283. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/application.py +0 -0
  284. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/argumentparser.py +0 -0
  285. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/asserts.py +0 -0
  286. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/charwidth.py +0 -0
  287. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/compress.py +0 -0
  288. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/encoding.py +0 -0
  289. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/error.py +0 -0
  290. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/etreewrapper.py +0 -0
  291. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/filereader.py +0 -0
  292. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/frange.py +0 -0
  293. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/htmlformatters.py +0 -0
  294. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/markuputils.py +0 -0
  295. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/match.py +0 -0
  296. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/recommendations.py +0 -0
  297. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/restreader.py +0 -0
  298. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotenv.py +0 -0
  299. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotinspect.py +0 -0
  300. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/sortable.py +0 -0
  301. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/typehints.py +0 -0
  302. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/finders.py +0 -0
  303. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/notfound.py +0 -0
  304. {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/resolvable.py +0 -0
  305. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/dependency_links.txt +0 -0
  306. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/entry_points.txt +0 -0
  307. {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/top_level.txt +0 -0
@@ -13,49 +13,90 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- import sys
17
- from typing import Any, cast, Sequence, TypeVar, TYPE_CHECKING
18
- if sys.version_info >= (3, 8):
19
- from typing import Literal
16
+ import warnings
17
+ from collections import OrderedDict
18
+ from typing import Any, cast, Mapping, Literal, Sequence, TypeVar, TYPE_CHECKING
20
19
 
21
20
  from robot.utils import setter
22
21
 
23
- from .body import Body, BodyItem, BodyItemParent, BaseBranches
24
- from .keyword import Keywords
22
+ from .body import Body, BodyItem, BodyItemParent, BaseBranches, BaseIterations
25
23
  from .modelobject import DataDict
26
24
  from .visitor import SuiteVisitor
27
25
 
28
26
  if TYPE_CHECKING:
29
27
  from robot.model import Keyword, Message
30
28
 
29
+
31
30
  IT = TypeVar('IT', bound='IfBranch|TryBranch')
31
+ FW = TypeVar('FW', bound='ForIteration|WhileIteration')
32
+
33
+
34
+ class Branches(BaseBranches['Keyword', 'For', 'While', 'If', 'Try', 'Var', 'Return',
35
+ 'Continue', 'Break', 'Message', 'Error', IT]):
36
+ __slots__ = ()
37
+
38
+
39
+ class Iterations(BaseIterations['Keyword', 'For', 'While', 'If', 'Try', 'Var', 'Return',
40
+ 'Continue', 'Break', 'Message', 'Error', FW]):
41
+ __slots__ = ()
42
+
43
+
44
+ class ForIteration(BodyItem):
45
+ """Represents one FOR loop iteration."""
46
+ type = BodyItem.ITERATION
47
+ body_class = Body
48
+ repr_args = ('assign',)
49
+ __slots__ = ['assign', 'message', 'status', '_start_time', '_end_time',
50
+ '_elapsed_time']
51
+
52
+ def __init__(self, assign: 'Mapping[str, str]|None' = None,
53
+ parent: BodyItemParent = None):
54
+ self.assign = OrderedDict(assign or ())
55
+ self.parent = parent
56
+ self.body = ()
32
57
 
58
+ @property
59
+ def variables(self) -> 'Mapping[str, str]': # TODO: Remove in RF 8.0.
60
+ """Deprecated since Robot Framework 7.0. Use :attr:`assign` instead."""
61
+ warnings.warn("'ForIteration.variables' is deprecated and will be removed in "
62
+ "Robot Framework 8.0. Use 'ForIteration.assign' instead.")
63
+ return self.assign
64
+
65
+ @setter
66
+ def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
67
+ return self.body_class(self, body)
33
68
 
34
- class Branches(BaseBranches['Keyword', 'For', 'While', 'If', 'Try', 'Return', 'Continue',
35
- 'Break', 'Message', 'Error', IT]):
36
- pass
69
+ def visit(self, visitor: SuiteVisitor):
70
+ visitor.visit_for_iteration(self)
71
+
72
+ @property
73
+ def _log_name(self):
74
+ return ', '.join(f'{name} = {value}' for name, value in self.assign.items())
75
+
76
+ def to_dict(self) -> DataDict:
77
+ return {
78
+ 'type': self.type,
79
+ 'assign': dict(self.assign),
80
+ 'body': self.body.to_dicts()
81
+ }
37
82
 
38
83
 
39
84
  @Body.register
40
85
  class For(BodyItem):
41
- """Represents ``FOR`` loops.
42
-
43
- :attr:`flavor` specifies the flavor, and it can be ``IN``, ``IN RANGE``,
44
- ``IN ENUMERATE`` or ``IN ZIP``.
45
- """
86
+ """Represents ``FOR`` loops."""
46
87
  type = BodyItem.FOR
47
88
  body_class = Body
48
- repr_args = ('variables', 'flavor', 'values', 'start', 'mode', 'fill')
49
- __slots__ = ['variables', 'flavor', 'values', 'start', 'mode', 'fill']
89
+ repr_args = ('assign', 'flavor', 'values', 'start', 'mode', 'fill')
90
+ __slots__ = ['assign', 'flavor', 'values', 'start', 'mode', 'fill']
50
91
 
51
- def __init__(self, variables: Sequence[str] = (),
52
- flavor: "Literal['IN', 'IN RANGE', 'IN ENUMERATE', 'IN ZIP']" = 'IN',
92
+ def __init__(self, assign: Sequence[str] = (),
93
+ flavor: Literal['IN', 'IN RANGE', 'IN ENUMERATE', 'IN ZIP'] = 'IN',
53
94
  values: Sequence[str] = (),
54
95
  start: 'str|None' = None,
55
96
  mode: 'str|None' = None,
56
97
  fill: 'str|None' = None,
57
98
  parent: BodyItemParent = None):
58
- self.variables = tuple(variables)
99
+ self.assign = tuple(assign)
59
100
  self.flavor = flavor
60
101
  self.values = tuple(values)
61
102
  self.start = start
@@ -64,37 +105,29 @@ class For(BodyItem):
64
105
  self.parent = parent
65
106
  self.body = ()
66
107
 
108
+ @property
109
+ def variables(self) -> 'tuple[str, ...]': # TODO: Remove in RF 8.0.
110
+ """Deprecated since Robot Framework 7.0. Use :attr:`assign` instead."""
111
+ warnings.warn("'For.variables' is deprecated and will be removed in "
112
+ "Robot Framework 8.0. Use 'For.assign' instead.")
113
+ return self.assign
114
+
115
+ @variables.setter
116
+ def variables(self, assign: 'tuple[str, ...]'):
117
+ warnings.warn("'For.variables' is deprecated and will be removed in "
118
+ "Robot Framework 8.0. Use 'For.assign' instead.")
119
+ self.assign = assign
120
+
67
121
  @setter
68
122
  def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
69
123
  return self.body_class(self, body)
70
124
 
71
- @property
72
- def keywords(self):
73
- """Deprecated since Robot Framework 4.0. Use :attr:`body` instead."""
74
- return Keywords(self, self.body)
75
-
76
- @keywords.setter
77
- def keywords(self, keywords):
78
- Keywords.raise_deprecation_error()
79
-
80
125
  def visit(self, visitor: SuiteVisitor):
81
126
  visitor.visit_for(self)
82
127
 
83
- def __str__(self):
84
- parts = ['FOR', *self.variables, self.flavor, *self.values]
85
- for name, value in [('start', self.start),
86
- ('mode', self.mode),
87
- ('fill', self.fill)]:
88
- if value is not None:
89
- parts.append(f'{name}={value}')
90
- return ' '.join(parts)
91
-
92
- def _include_in_repr(self, name: str, value: Any) -> bool:
93
- return name not in ('start', 'mode', 'fill') or value is not None
94
-
95
128
  def to_dict(self) -> DataDict:
96
129
  data = {'type': self.type,
97
- 'variables': self.variables,
130
+ 'assign': self.assign,
98
131
  'flavor': self.flavor,
99
132
  'values': self.values}
100
133
  for name, value in [('start', self.start),
@@ -105,6 +138,42 @@ class For(BodyItem):
105
138
  data['body'] = self.body.to_dicts()
106
139
  return data
107
140
 
141
+ def __str__(self):
142
+ parts = ['FOR', *self.assign, self.flavor, *self.values]
143
+ for name, value in [('start', self.start),
144
+ ('mode', self.mode),
145
+ ('fill', self.fill)]:
146
+ if value is not None:
147
+ parts.append(f'{name}={value}')
148
+ return ' '.join(parts)
149
+
150
+ def _include_in_repr(self, name: str, value: Any) -> bool:
151
+ return value is not None or name in ('assign', 'flavor', 'values')
152
+
153
+
154
+ class WhileIteration(BodyItem):
155
+ """Represents one WHILE loop iteration."""
156
+ type = BodyItem.ITERATION
157
+ body_class = Body
158
+ __slots__ = ()
159
+
160
+ def __init__(self, parent: BodyItemParent = None):
161
+ self.parent = parent
162
+ self.body = ()
163
+
164
+ @setter
165
+ def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
166
+ return self.body_class(self, body)
167
+
168
+ def visit(self, visitor: SuiteVisitor):
169
+ visitor.visit_while_iteration(self)
170
+
171
+ def to_dict(self) -> DataDict:
172
+ return {
173
+ 'type': self.type,
174
+ 'body': self.body.to_dicts()
175
+ }
176
+
108
177
 
109
178
  @Body.register
110
179
  class While(BodyItem):
@@ -133,18 +202,6 @@ class While(BodyItem):
133
202
  def visit(self, visitor: SuiteVisitor):
134
203
  visitor.visit_while(self)
135
204
 
136
- def __str__(self) -> str:
137
- parts = ['WHILE']
138
- if self.condition is not None:
139
- parts.append(self.condition)
140
- if self.limit is not None:
141
- parts.append(f'limit={self.limit}')
142
- if self.on_limit is not None:
143
- parts.append(f'limit={self.on_limit}')
144
- if self.on_limit_message is not None:
145
- parts.append(f'on_limit_message={self.on_limit_message}')
146
- return ' '.join(parts)
147
-
148
205
  def _include_in_repr(self, name: str, value: Any) -> bool:
149
206
  return name == 'condition' or value is not None
150
207
 
@@ -152,12 +209,25 @@ class While(BodyItem):
152
209
  data: DataDict = {'type': self.type}
153
210
  for name, value in [('condition', self.condition),
154
211
  ('limit', self.limit),
212
+ ('on_limit', self.on_limit),
155
213
  ('on_limit_message', self.on_limit_message)]:
156
214
  if value is not None:
157
215
  data[name] = value
158
216
  data['body'] = self.body.to_dicts()
159
217
  return data
160
218
 
219
+ def __str__(self) -> str:
220
+ parts = ['WHILE']
221
+ if self.condition is not None:
222
+ parts.append(self.condition)
223
+ if self.limit is not None:
224
+ parts.append(f'limit={self.limit}')
225
+ if self.on_limit is not None:
226
+ parts.append(f'on_limit={self.on_limit}')
227
+ if self.on_limit_message is not None:
228
+ parts.append(f'on_limit_message={self.on_limit_message}')
229
+ return ' '.join(parts)
230
+
161
231
 
162
232
  class IfBranch(BodyItem):
163
233
  """Represents individual ``IF``, ``ELSE IF`` or ``ELSE`` branch."""
@@ -186,6 +256,16 @@ class IfBranch(BodyItem):
186
256
  return self._get_id(self.parent)
187
257
  return self._get_id(self.parent.parent)
188
258
 
259
+ def visit(self, visitor: SuiteVisitor):
260
+ visitor.visit_if_branch(self)
261
+
262
+ def to_dict(self) -> DataDict:
263
+ data = {'type': self.type}
264
+ if self.condition:
265
+ data['condition'] = self.condition
266
+ data['body'] = self.body.to_dicts()
267
+ return data
268
+
189
269
  def __str__(self) -> str:
190
270
  if self.type == self.IF:
191
271
  return f'IF {self.condition}'
@@ -193,17 +273,6 @@ class IfBranch(BodyItem):
193
273
  return f'ELSE IF {self.condition}'
194
274
  return 'ELSE'
195
275
 
196
- def visit(self, visitor: SuiteVisitor):
197
- visitor.visit_if_branch(self)
198
-
199
- def to_dict(self) -> DataDict:
200
- data = {'type': self.type,
201
- 'condition': self.condition,
202
- 'body': self.body.to_dicts()}
203
- if self.type == self.ELSE:
204
- data.pop('condition')
205
- return data
206
-
207
276
 
208
277
  @Body.register
209
278
  class If(BodyItem):
@@ -237,23 +306,36 @@ class If(BodyItem):
237
306
  class TryBranch(BodyItem):
238
307
  """Represents individual ``TRY``, ``EXCEPT``, ``ELSE`` or ``FINALLY`` branch."""
239
308
  body_class = Body
240
- repr_args = ('type', 'patterns', 'pattern_type', 'variable')
241
- __slots__ = ['type', 'patterns', 'pattern_type', 'variable']
309
+ repr_args = ('type', 'patterns', 'pattern_type', 'assign')
310
+ __slots__ = ['type', 'patterns', 'pattern_type', 'assign']
242
311
 
243
312
  def __init__(self, type: str = BodyItem.TRY,
244
313
  patterns: Sequence[str] = (),
245
314
  pattern_type: 'str|None' = None,
246
- variable: 'str|None' = None,
315
+ assign: 'str|None' = None,
247
316
  parent: BodyItemParent = None):
248
- if (patterns or pattern_type or variable) and type != BodyItem.EXCEPT:
249
- raise TypeError(f"'{type}' branches do not accept patterns or variables.")
317
+ if (patterns or pattern_type or assign) and type != BodyItem.EXCEPT:
318
+ raise TypeError(f"'{type}' branches do not accept patterns or assignment.")
250
319
  self.type = type
251
320
  self.patterns = tuple(patterns)
252
321
  self.pattern_type = pattern_type
253
- self.variable = variable
322
+ self.assign = assign
254
323
  self.parent = parent
255
324
  self.body = ()
256
325
 
326
+ @property
327
+ def variable(self) -> 'str|None': # TODO: Remove in RF 8.0.
328
+ """Deprecated since Robot Framework 7.0. Use :attr:`assign` instead."""
329
+ warnings.warn("'TryBranch.variable' is deprecated and will be removed in "
330
+ "Robot Framework 8.0. Use 'TryBranch.assign' instead.")
331
+ return self.assign
332
+
333
+ @variable.setter
334
+ def variable(self, assign: 'str|None'):
335
+ warnings.warn("'TryBranch.variable' is deprecated and will be removed in "
336
+ "Robot Framework 8.0. Use 'TryBranch.assign' instead.")
337
+ self.assign = assign
338
+
257
339
  @setter
258
340
  def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
259
341
  return self.body_class(self, body)
@@ -267,19 +349,6 @@ class TryBranch(BodyItem):
267
349
  return self._get_id(self.parent)
268
350
  return self._get_id(self.parent.parent)
269
351
 
270
- def __str__(self) -> str:
271
- if self.type != BodyItem.EXCEPT:
272
- return self.type
273
- parts = ['EXCEPT', *self.patterns]
274
- if self.pattern_type:
275
- parts.append(f'type={self.pattern_type}')
276
- if self.variable:
277
- parts.extend(['AS', self.variable])
278
- return ' '.join(parts)
279
-
280
- def _include_in_repr(self, name: str, value: Any) -> bool:
281
- return bool(value)
282
-
283
352
  def visit(self, visitor: SuiteVisitor):
284
353
  visitor.visit_try_branch(self)
285
354
 
@@ -289,11 +358,24 @@ class TryBranch(BodyItem):
289
358
  data['patterns'] = self.patterns
290
359
  if self.pattern_type:
291
360
  data['pattern_type'] = self.pattern_type
292
- if self.variable:
293
- data['variable'] = self.variable
361
+ if self.assign:
362
+ data['assign'] = self.assign
294
363
  data['body'] = self.body.to_dicts()
295
364
  return data
296
365
 
366
+ def __str__(self) -> str:
367
+ if self.type != BodyItem.EXCEPT:
368
+ return self.type
369
+ parts = ['EXCEPT', *self.patterns]
370
+ if self.pattern_type:
371
+ parts.append(f'type={self.pattern_type}')
372
+ if self.assign:
373
+ parts.extend(['AS', self.assign])
374
+ return ' '.join(parts)
375
+
376
+ def _include_in_repr(self, name: str, value: Any) -> bool:
377
+ return bool(value)
378
+
297
379
 
298
380
  @Body.register
299
381
  class Try(BodyItem):
@@ -330,7 +412,7 @@ class Try(BodyItem):
330
412
  return None
331
413
 
332
414
  @property
333
- def finally_branch(self):
415
+ def finally_branch(self) -> 'TryBranch|None':
334
416
  if self.body and self.body[-1].type == BodyItem.FINALLY:
335
417
  return cast(TryBranch, self.body[-1])
336
418
  return None
@@ -348,6 +430,49 @@ class Try(BodyItem):
348
430
  'body': self.body.to_dicts()}
349
431
 
350
432
 
433
+ @Body.register
434
+ class Var(BodyItem):
435
+ """Represents ``VAR``."""
436
+ type = BodyItem.VAR
437
+ repr_args = ('name', 'value', 'scope', 'separator')
438
+ __slots__ = ['name', 'value', 'scope', 'separator']
439
+
440
+ def __init__(self, name: str = '',
441
+ value: 'str|Sequence[str]' = (),
442
+ scope: 'str|None' = None,
443
+ separator: 'str|None' = None,
444
+ parent: BodyItemParent = None):
445
+ self.name = name
446
+ self.value = (value,) if isinstance(value, str) else tuple(value)
447
+ self.scope = scope
448
+ self.separator = separator
449
+ self.parent = parent
450
+
451
+ def visit(self, visitor: SuiteVisitor):
452
+ visitor.visit_var(self)
453
+
454
+ def to_dict(self) -> DataDict:
455
+ data = {'type': self.type,
456
+ 'name': self.name,
457
+ 'value': self.value}
458
+ if self.scope is not None:
459
+ data['scope'] = self.scope
460
+ if self.separator is not None:
461
+ data['separator'] = self.separator
462
+ return data
463
+
464
+ def __str__(self):
465
+ parts = ['VAR', self.name, *self.value]
466
+ if self.separator is not None:
467
+ parts.append(f'separator={self.separator}')
468
+ if self.scope is not None:
469
+ parts.append(f'scope={self.scope}')
470
+ return ' '.join(parts)
471
+
472
+ def _include_in_repr(self, name: str, value: Any) -> bool:
473
+ return value is not None or name in ('name', 'value')
474
+
475
+
351
476
  @Body.register
352
477
  class Return(BodyItem):
353
478
  """Represents ``RETURN``."""
@@ -364,8 +489,16 @@ class Return(BodyItem):
364
489
  visitor.visit_return(self)
365
490
 
366
491
  def to_dict(self) -> DataDict:
367
- return {'type': self.type,
368
- 'values': self.values}
492
+ data = {'type': self.type}
493
+ if self.values:
494
+ data['values'] = self.values
495
+ return data
496
+
497
+ def __str__(self):
498
+ return ' '.join(['RETURN', *self.values])
499
+
500
+ def _include_in_repr(self, name: str, value: Any) -> bool:
501
+ return bool(value)
369
502
 
370
503
 
371
504
  @Body.register
@@ -383,6 +516,9 @@ class Continue(BodyItem):
383
516
  def to_dict(self) -> DataDict:
384
517
  return {'type': self.type}
385
518
 
519
+ def __str__(self):
520
+ return 'CONTINUE'
521
+
386
522
 
387
523
  @Body.register
388
524
  class Break(BodyItem):
@@ -399,6 +535,9 @@ class Break(BodyItem):
399
535
  def to_dict(self) -> DataDict:
400
536
  return {'type': self.type}
401
537
 
538
+ def __str__(self):
539
+ return 'BREAK'
540
+
402
541
 
403
542
  @Body.register
404
543
  class Error(BodyItem):
@@ -421,3 +560,6 @@ class Error(BodyItem):
421
560
  def to_dict(self) -> DataDict:
422
561
  return {'type': self.type,
423
562
  'values': self.values}
563
+
564
+ def __str__(self):
565
+ return ' '.join(['ERROR', *self.values])
@@ -18,7 +18,7 @@ from typing import Sequence, TYPE_CHECKING
18
18
  from robot.utils import setter
19
19
 
20
20
  from .tags import TagPatterns
21
- from .namepatterns import SuiteNamePatterns, TestNamePatterns
21
+ from .namepatterns import NamePatterns
22
22
  from .visitor import SuiteVisitor
23
23
 
24
24
  if TYPE_CHECKING:
@@ -46,8 +46,8 @@ class EmptySuiteRemover(SuiteVisitor):
46
46
  class Filter(EmptySuiteRemover):
47
47
 
48
48
  def __init__(self,
49
- include_suites: 'SuiteNamePatterns|Sequence[str]|None' = None,
50
- include_tests: 'TestNamePatterns|Sequence[str]|None' = None,
49
+ include_suites: 'NamePatterns|Sequence[str]|None' = None,
50
+ include_tests: 'NamePatterns|Sequence[str]|None' = None,
51
51
  include_tags: 'TagPatterns|Sequence[str]|None' = None,
52
52
  exclude_tags: 'TagPatterns|Sequence[str]|None' = None):
53
53
  super().__init__()
@@ -57,12 +57,12 @@ class Filter(EmptySuiteRemover):
57
57
  self.exclude_tags = exclude_tags
58
58
 
59
59
  @setter
60
- def include_suites(self, suites) -> 'SuiteNamePatterns|None':
61
- return self._patterns_or_none(suites, SuiteNamePatterns)
60
+ def include_suites(self, suites) -> 'NamePatterns|None':
61
+ return self._patterns_or_none(suites, NamePatterns)
62
62
 
63
63
  @setter
64
- def include_tests(self, tests) -> 'TestNamePatterns|None':
65
- return self._patterns_or_none(tests, TestNamePatterns)
64
+ def include_tests(self, tests) -> 'NamePatterns|None':
65
+ return self._patterns_or_none(tests, NamePatterns)
66
66
 
67
67
  @setter
68
68
  def include_tags(self, tags) -> 'TagPatterns|None':
@@ -80,27 +80,33 @@ class Filter(EmptySuiteRemover):
80
80
  def start_suite(self, suite: 'TestSuite'):
81
81
  if not self:
82
82
  return False
83
- if hasattr(suite, 'starttime'):
84
- suite.starttime = suite.endtime = None
83
+ if hasattr(suite, 'start_time'):
84
+ suite.start_time = suite.end_time = suite.elapsed_time = None
85
85
  if self.include_suites is not None:
86
- if self.include_suites.match(suite.name, suite.longname):
87
- suite.visit(Filter(include_tests=self.include_tests,
88
- include_tags=self.include_tags,
89
- exclude_tags=self.exclude_tags))
90
- return False
91
- suite.tests = []
92
- return True
93
- if self.include_tests is not None:
94
- suite.tests = [t for t in suite.tests
95
- if self.include_tests.match(t.name, t.longname)]
96
- if self.include_tags is not None:
97
- suite.tests = [t for t in suite.tests
98
- if self.include_tags.match(t.tags)]
99
- if self.exclude_tags is not None:
100
- suite.tests = [t for t in suite.tests
101
- if not self.exclude_tags.match(t.tags)]
86
+ return self._filter_based_on_suite_name(suite)
87
+ suite.tests = [t for t in suite.tests if self._test_included(t)]
102
88
  return bool(suite.suites)
103
89
 
90
+ def _filter_based_on_suite_name(self, suite: 'TestSuite') -> bool:
91
+ if self.include_suites.match(suite.name, suite.full_name):
92
+ suite.visit(Filter(include_tests=self.include_tests,
93
+ include_tags=self.include_tags,
94
+ exclude_tags=self.exclude_tags))
95
+ return False
96
+ suite.tests = []
97
+ return True
98
+
99
+ def _test_included(self, test: 'TestCase') -> bool:
100
+ tests, include, exclude \
101
+ = self.include_tests, self.include_tags, self.exclude_tags
102
+ if exclude is not None and exclude.match(test.tags):
103
+ return False
104
+ if include is not None and include.match(test.tags):
105
+ return True
106
+ if tests is not None and tests.match(test.name, test.full_name):
107
+ return True
108
+ return include is None and tests is None
109
+
104
110
  def __bool__(self) -> bool:
105
111
  return bool(self.include_suites is not None or
106
112
  self.include_tests is not None or
@@ -108,14 +108,14 @@ class ItemList(MutableSequence[T]):
108
108
  index += 1
109
109
 
110
110
  @overload
111
- def __getitem__(self, index: int) -> T:
111
+ def __getitem__(self, index: int, /) -> T:
112
112
  ...
113
113
 
114
114
  @overload
115
- def __getitem__(self: Self, index: slice) -> Self:
115
+ def __getitem__(self: Self, index: slice, /) -> Self:
116
116
  ...
117
117
 
118
- def __getitem__(self, index):
118
+ def __getitem__(self: Self, index: 'int|slice', /) -> 'T|Self':
119
119
  if isinstance(index, slice):
120
120
  return self._create_new_from(self._items[index])
121
121
  return self._items[index]
@@ -129,23 +129,24 @@ class ItemList(MutableSequence[T]):
129
129
  return new
130
130
 
131
131
  @overload
132
- def __setitem__(self, index: int, item: 'T|DataDict'):
132
+ def __setitem__(self, index: int, item: 'T|DataDict', /):
133
133
  ...
134
134
 
135
135
  @overload
136
- def __setitem__(self, index: slice, item: 'Iterable[T|DataDict]'):
136
+ def __setitem__(self, index: slice, items: 'Iterable[T|DataDict]', /):
137
137
  ...
138
138
 
139
- def __setitem__(self, index, item):
139
+ def __setitem__(self, index: 'int|slice',
140
+ item: 'T|DataDict|Iterable[T|DataDict]', /):
140
141
  if isinstance(index, slice):
141
142
  self._items[index] = [self._check_type_and_set_attrs(i) for i in item]
142
143
  else:
143
144
  self._items[index] = self._check_type_and_set_attrs(item)
144
145
 
145
- def __delitem__(self, index: 'int|slice'):
146
+ def __delitem__(self, index: 'int|slice', /):
146
147
  del self._items[index]
147
148
 
148
- def __contains__(self, item: object) -> bool:
149
+ def __contains__(self, item: Any, /) -> bool:
149
150
  return item in self._items
150
151
 
151
152
  def __len__(self) -> int:
@@ -0,0 +1,77 @@
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 Any, Dict, List, Sequence, Tuple, TYPE_CHECKING, Union
17
+
18
+ from .body import Body, BodyItem, BodyItemParent
19
+ from .modelobject import DataDict
20
+
21
+ if TYPE_CHECKING:
22
+ from .visitor import SuiteVisitor
23
+
24
+
25
+ Arguments = Union[Sequence[Union[Any, Tuple[Any], Tuple[str, Any]]],
26
+ Tuple[List[Any], Dict[str, Any]]]
27
+
28
+
29
+ @Body.register
30
+ class Keyword(BodyItem):
31
+ """Base model for a single keyword.
32
+
33
+ Extended by :class:`robot.running.model.Keyword` and
34
+ :class:`robot.result.model.Keyword`.
35
+
36
+ Arguments from normal data are always strings, but other types are possible in
37
+ programmatic usage. See the docstrings of the extending classes for more details.
38
+ """
39
+ repr_args = ('name', 'args', 'assign')
40
+ __slots__ = ['name', 'args', 'assign', 'type']
41
+
42
+ def __init__(self, name: 'str|None' = '',
43
+ args: Arguments = (),
44
+ assign: Sequence[str] = (),
45
+ type: str = BodyItem.KEYWORD,
46
+ parent: BodyItemParent = None):
47
+ self.name = name
48
+ self.args = tuple(args)
49
+ self.assign = tuple(assign)
50
+ self.type = type
51
+ self.parent = parent
52
+
53
+ @property
54
+ def id(self) -> 'str|None':
55
+ if not self:
56
+ return None
57
+ return super().id
58
+
59
+ def visit(self, visitor: 'SuiteVisitor'):
60
+ """:mod:`Visitor interface <robot.model.visitor>` entry-point."""
61
+ if self:
62
+ visitor.visit_keyword(self)
63
+
64
+ def __bool__(self) -> bool:
65
+ return self.name is not None
66
+
67
+ def __str__(self) -> str:
68
+ parts = list(self.assign) + [self.name] + list(self.args)
69
+ return ' '.join(str(p) for p in parts)
70
+
71
+ def to_dict(self) -> DataDict:
72
+ data: DataDict = {'name': self.name}
73
+ if self.args:
74
+ data['args'] = self.args
75
+ if self.assign:
76
+ data['assign'] = self.assign
77
+ return data