robotframework 6.1.1__zip → 7.0a1__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 (288) hide show
  1. {robotframework-6.1.1/src/robotframework.egg-info → robotframework-7.0a1}/PKG-INFO +3 -6
  2. {robotframework-6.1.1 → robotframework-7.0a1}/setup.py +2 -5
  3. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/api/interfaces.py +35 -48
  4. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/api/parsing.py +4 -2
  5. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/conf/gatherfailed.py +2 -2
  6. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/conf/languages.py +0 -9
  7. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/conf/settings.py +8 -5
  8. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/log.css +4 -0
  9. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/log.html +9 -1
  10. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/model.js +2 -4
  11. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/testdata.js +10 -3
  12. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/template.py +3 -3
  13. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/builder.py +0 -8
  14. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/datatypes.py +9 -10
  15. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/htmlutils.py +4 -7
  16. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/jsonbuilder.py +14 -10
  17. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/model.py +13 -25
  18. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/robotbuilder.py +13 -3
  19. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/xmlbuilder.py +8 -8
  20. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/xmlwriter.py +12 -38
  21. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/BuiltIn.py +215 -189
  22. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/Collections.py +2 -9
  23. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/DateTime.py +1 -1
  24. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/OperatingSystem.py +4 -3
  25. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/Process.py +26 -27
  26. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/Remote.py +40 -36
  27. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/String.py +4 -4
  28. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/XML.py +7 -8
  29. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/__init__.py +2 -2
  30. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/__init__.py +4 -4
  31. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/body.py +14 -6
  32. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/configurer.py +15 -11
  33. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/control.py +151 -81
  34. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/filter.py +31 -25
  35. robotframework-7.0a1/src/robot/model/keyword.py +70 -0
  36. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/message.py +19 -10
  37. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/namepatterns.py +3 -25
  38. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/stats.py +9 -15
  39. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/tags.py +1 -1
  40. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/testcase.py +12 -21
  41. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/testsuite.py +16 -22
  42. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/visitor.py +35 -8
  43. robotframework-7.0a1/src/robot/output/console/dotted.py +90 -0
  44. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/console/quiet.py +3 -2
  45. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/console/verbose.py +60 -60
  46. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/debugfile.py +36 -23
  47. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/filelogger.py +16 -13
  48. robotframework-7.0a1/src/robot/output/listeners.py +586 -0
  49. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/logger.py +164 -77
  50. robotframework-7.0a1/src/robot/output/loggerapi.py +152 -0
  51. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/loggerhelper.py +23 -56
  52. robotframework-7.0a1/src/robot/output/output.py +158 -0
  53. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/stdoutlogsplitter.py +8 -5
  54. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/xmllogger.py +163 -109
  55. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/blocklexers.py +17 -13
  56. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/context.py +12 -2
  57. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/lexer.py +1 -1
  58. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/settings.py +6 -3
  59. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/statementlexers.py +39 -10
  60. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/tokens.py +27 -29
  61. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/model/blocks.py +19 -6
  62. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/model/statements.py +184 -84
  63. robotframework-7.0a1/src/robot/parsing/model/visitor.py +102 -0
  64. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/expandkeywordmatcher.py +1 -1
  65. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/jsbuildingcontext.py +8 -6
  66. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/jsmodelbuilders.py +88 -61
  67. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/stringcache.py +4 -3
  68. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/xunitwriter.py +15 -21
  69. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/__init__.py +3 -2
  70. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/configurer.py +12 -9
  71. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/flattenkeywordmatcher.py +8 -8
  72. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/keywordremover.py +71 -54
  73. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/merger.py +1 -1
  74. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/model.py +400 -316
  75. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/modeldeprecation.py +9 -3
  76. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/resultbuilder.py +21 -23
  77. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/xmlelementhandlers.py +76 -40
  78. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/__init__.py +1 -1
  79. robotframework-7.0a1/src/robot/running/arguments/argumentconverter.py +101 -0
  80. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/argumentmapper.py +16 -14
  81. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/argumentresolver.py +41 -33
  82. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/argumentspec.py +24 -90
  83. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/argumentvalidator.py +34 -27
  84. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/customconverters.py +14 -11
  85. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/embedded.py +23 -26
  86. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/typeconverters.py +175 -213
  87. robotframework-7.0a1/src/robot/running/arguments/typeinfo.py +367 -0
  88. robotframework-7.0a1/src/robot/running/arguments/typevalidator.py +62 -0
  89. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/bodyrunner.py +83 -68
  90. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/builder/parsers.py +8 -10
  91. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/builder/settings.py +9 -17
  92. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/builder/transformers.py +166 -308
  93. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/context.py +80 -25
  94. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/handlers.py +11 -16
  95. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/handlerstore.py +1 -1
  96. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/librarykeywordrunner.py +9 -17
  97. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/model.py +109 -32
  98. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/namespace.py +18 -19
  99. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/statusreporter.py +13 -12
  100. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/suiterunner.py +15 -17
  101. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/testlibraries.py +33 -40
  102. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/usererrorhandler.py +8 -8
  103. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/userkeyword.py +13 -8
  104. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/userkeywordrunner.py +18 -21
  105. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/testdoc.py +18 -13
  106. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/__init__.py +50 -35
  107. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/connectioncache.py +64 -59
  108. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/encodingsniffer.py +1 -1
  109. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/escaping.py +11 -9
  110. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/markupwriters.py +20 -13
  111. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/normalizing.py +9 -24
  112. robotframework-7.0a1/src/robot/utils/notset.py +33 -0
  113. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/platform.py +15 -5
  114. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/robotpath.py +1 -0
  115. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/robottime.py +120 -88
  116. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/robottypes.py +16 -31
  117. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/setter.py +0 -5
  118. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/text.py +7 -4
  119. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/unic.py +2 -2
  120. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/__init__.py +2 -2
  121. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/assigner.py +17 -19
  122. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/evaluation.py +20 -17
  123. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/filesetter.py +80 -80
  124. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/replacer.py +33 -36
  125. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/scopes.py +3 -3
  126. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/search.py +66 -41
  127. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/store.py +14 -16
  128. robotframework-7.0a1/src/robot/variables/tablesetter.py +164 -0
  129. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/variables.py +1 -1
  130. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/version.py +1 -1
  131. {robotframework-6.1.1 → robotframework-7.0a1/src/robotframework.egg-info}/PKG-INFO +3 -6
  132. {robotframework-6.1.1 → robotframework-7.0a1}/src/robotframework.egg-info/SOURCES.txt +3 -4
  133. {robotframework-6.1.1 → robotframework-7.0a1}/tasks.py +6 -6
  134. robotframework-6.1.1/src/robot/libraries/Reserved.py +0 -48
  135. robotframework-6.1.1/src/robot/model/keyword.py +0 -173
  136. robotframework-6.1.1/src/robot/output/console/dotted.py +0 -90
  137. robotframework-6.1.1/src/robot/output/listenerarguments.py +0 -165
  138. robotframework-6.1.1/src/robot/output/listenermethods.py +0 -113
  139. robotframework-6.1.1/src/robot/output/listeners.py +0 -174
  140. robotframework-6.1.1/src/robot/output/output.py +0 -95
  141. robotframework-6.1.1/src/robot/parsing/model/visitor.py +0 -67
  142. robotframework-6.1.1/src/robot/running/arguments/argumentconverter.py +0 -79
  143. robotframework-6.1.1/src/robot/running/arguments/typevalidator.py +0 -56
  144. robotframework-6.1.1/src/robot/running/modelcombiner.py +0 -32
  145. robotframework-6.1.1/src/robot/variables/tablesetter.py +0 -156
  146. {robotframework-6.1.1 → robotframework-7.0a1}/AUTHORS.rst +0 -0
  147. {robotframework-6.1.1 → robotframework-7.0a1}/BUILD.rst +0 -0
  148. {robotframework-6.1.1 → robotframework-7.0a1}/CONTRIBUTING.rst +0 -0
  149. {robotframework-6.1.1 → robotframework-7.0a1}/COPYRIGHT.txt +0 -0
  150. {robotframework-6.1.1 → robotframework-7.0a1}/INSTALL.rst +0 -0
  151. {robotframework-6.1.1 → robotframework-7.0a1}/LICENSE.txt +0 -0
  152. {robotframework-6.1.1 → robotframework-7.0a1}/MANIFEST.in +0 -0
  153. {robotframework-6.1.1 → robotframework-7.0a1}/README.rst +0 -0
  154. {robotframework-6.1.1 → robotframework-7.0a1}/setup.cfg +0 -0
  155. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/__init__.py +0 -0
  156. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/__main__.py +0 -0
  157. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/api/__init__.py +0 -0
  158. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/api/deco.py +0 -0
  159. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/api/exceptions.py +0 -0
  160. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/api/logger.py +0 -0
  161. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/conf/__init__.py +0 -0
  162. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/errors.py +0 -0
  163. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/__init__.py +0 -0
  164. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/common/__init__.py +0 -0
  165. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/common/js_disabled.css +0 -0
  166. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/common/storage.js +0 -0
  167. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/htmlfilewriter.py +0 -0
  168. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/jsonwriter.py +0 -0
  169. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/lib/__init__.py +0 -0
  170. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
  171. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.min.js +0 -0
  172. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
  173. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
  174. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
  175. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/__init__.py +0 -0
  176. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
  177. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/libdoc.css +0 -0
  178. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/libdoc.html +0 -0
  179. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/print.css +0 -0
  180. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/pygments.css +0 -0
  181. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/__init__.py +0 -0
  182. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/common.css +0 -0
  183. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/doc_formatting.css +0 -0
  184. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/fileloading.js +0 -0
  185. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/log.js +0 -0
  186. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/print.css +0 -0
  187. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/report.css +0 -0
  188. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/report.html +0 -0
  189. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/util.js +0 -0
  190. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/rebot/view.js +0 -0
  191. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/testdoc/__init__.py +0 -0
  192. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/testdoc/testdoc.css +0 -0
  193. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/htmldata/testdoc/testdoc.html +0 -0
  194. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdoc.py +0 -0
  195. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/__init__.py +0 -0
  196. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/consoleviewer.py +0 -0
  197. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/htmlwriter.py +0 -0
  198. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/jsonwriter.py +0 -0
  199. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/output.py +0 -0
  200. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/standardtypes.py +0 -0
  201. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libdocpkg/writer.py +0 -0
  202. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/Dialogs.py +0 -0
  203. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/Easter.py +0 -0
  204. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/Screenshot.py +0 -0
  205. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/Telnet.py +0 -0
  206. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/libraries/dialogs_py.py +0 -0
  207. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/fixture.py +0 -0
  208. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/itemlist.py +0 -0
  209. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/metadata.py +0 -0
  210. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/modelobject.py +0 -0
  211. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/modifier.py +0 -0
  212. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/statistics.py +0 -0
  213. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/suitestatistics.py +0 -0
  214. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/tagsetter.py +0 -0
  215. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/tagstatistics.py +0 -0
  216. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/model/totalstatistics.py +0 -0
  217. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/__init__.py +0 -0
  218. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/console/__init__.py +0 -0
  219. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/console/highlighting.py +0 -0
  220. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/librarylogger.py +0 -0
  221. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/output/pyloggingconf.py +0 -0
  222. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/__init__.py +0 -0
  223. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/__init__.py +0 -0
  224. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/lexer/tokenizer.py +0 -0
  225. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/model/__init__.py +0 -0
  226. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/parser/__init__.py +0 -0
  227. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/parser/blockparsers.py +0 -0
  228. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/parser/fileparser.py +0 -0
  229. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/parser/parser.py +0 -0
  230. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/parsing/suitestructure.py +0 -0
  231. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/pythonpathsetter.py +0 -0
  232. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/rebot.py +0 -0
  233. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/__init__.py +0 -0
  234. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/jsexecutionresult.py +0 -0
  235. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/jswriter.py +0 -0
  236. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/logreportwriters.py +0 -0
  237. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/outputwriter.py +0 -0
  238. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/reporting/resultwriter.py +0 -0
  239. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/executionerrors.py +0 -0
  240. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/executionresult.py +0 -0
  241. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/messagefilter.py +0 -0
  242. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/suiteteardownfailed.py +0 -0
  243. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/result/visitor.py +0 -0
  244. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/run.py +0 -0
  245. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/__init__.py +0 -0
  246. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/arguments/argumentparser.py +0 -0
  247. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/builder/__init__.py +0 -0
  248. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/builder/builders.py +0 -0
  249. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/dynamicmethods.py +0 -0
  250. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/importer.py +0 -0
  251. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/libraryscopes.py +0 -0
  252. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/outputcapture.py +0 -0
  253. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/randomizer.py +0 -0
  254. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/runkwregister.py +0 -0
  255. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/signalhandler.py +0 -0
  256. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/status.py +0 -0
  257. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/timeouts/__init__.py +0 -0
  258. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/timeouts/posix.py +0 -0
  259. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/running/timeouts/windows.py +0 -0
  260. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/application.py +0 -0
  261. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/argumentparser.py +0 -0
  262. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/asserts.py +0 -0
  263. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/charwidth.py +0 -0
  264. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/compress.py +0 -0
  265. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/dotdict.py +0 -0
  266. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/encoding.py +0 -0
  267. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/error.py +0 -0
  268. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/etreewrapper.py +0 -0
  269. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/filereader.py +0 -0
  270. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/frange.py +0 -0
  271. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/htmlformatters.py +0 -0
  272. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/importer.py +0 -0
  273. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/markuputils.py +0 -0
  274. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/match.py +0 -0
  275. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/misc.py +0 -0
  276. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/recommendations.py +0 -0
  277. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/restreader.py +0 -0
  278. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/robotenv.py +0 -0
  279. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/robotinspect.py +0 -0
  280. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/robotio.py +0 -0
  281. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/sortable.py +0 -0
  282. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/utils/typehints.py +0 -0
  283. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/finders.py +0 -0
  284. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/notfound.py +0 -0
  285. {robotframework-6.1.1 → robotframework-7.0a1}/src/robot/variables/resolvable.py +0 -0
  286. {robotframework-6.1.1 → robotframework-7.0a1}/src/robotframework.egg-info/dependency_links.txt +0 -0
  287. {robotframework-6.1.1 → robotframework-7.0a1}/src/robotframework.egg-info/entry_points.txt +0 -0
  288. {robotframework-6.1.1 → robotframework-7.0a1}/src/robotframework.egg-info/top_level.txt +0 -0
@@ -171,11 +171,11 @@ class JsonConverter:
171
171
  'relativeSource': self._get_relative_source(suite.source),
172
172
  'id': suite.id,
173
173
  'name': self._escape(suite.name),
174
- 'fullName': self._escape(suite.longname),
174
+ 'fullName': self._escape(suite.full_name),
175
175
  'doc': self._html(suite.doc),
176
176
  'metadata': [(self._escape(name), self._html(value))
177
177
  for name, value in suite.metadata.items()],
178
- 'numberOfTests': suite.test_count ,
178
+ 'numberOfTests': suite.test_count,
179
179
  'suites': self._convert_suites(suite),
180
180
  'tests': self._convert_tests(suite),
181
181
  'keywords': list(self._convert_keywords((suite.setup, suite.teardown)))
@@ -205,7 +205,7 @@ class JsonConverter:
205
205
  test.body.append(test.teardown)
206
206
  return {
207
207
  'name': self._escape(test.name),
208
- 'fullName': self._escape(test.longname),
208
+ 'fullName': self._escape(test.full_name),
209
209
  'id': test.id,
210
210
  'doc': self._html(test.doc),
211
211
  'tags': [self._escape(t) for t in test.tags],
@@ -217,10 +217,8 @@ class JsonConverter:
217
217
  for kw in keywords:
218
218
  if not kw:
219
219
  continue
220
- if kw.type == kw.SETUP:
221
- yield self._convert_keyword(kw, 'SETUP')
222
- elif kw.type == kw.TEARDOWN:
223
- yield self._convert_keyword(kw, 'TEARDOWN')
220
+ if kw.type in kw.KEYWORD_TYPES:
221
+ yield self._convert_keyword(kw)
224
222
  elif kw.type == kw.FOR:
225
223
  yield self._convert_for(kw)
226
224
  elif kw.type == kw.WHILE:
@@ -229,11 +227,11 @@ class JsonConverter:
229
227
  yield from self._convert_if(kw)
230
228
  elif kw.type == kw.TRY_EXCEPT_ROOT:
231
229
  yield from self._convert_try(kw)
232
- else:
233
- yield self._convert_keyword(kw, 'KEYWORD')
230
+ elif kw.type == kw.VAR:
231
+ yield self._convert_var(kw)
234
232
 
235
233
  def _convert_for(self, data):
236
- name = '%s %s %s' % (', '.join(data.variables), data.flavor,
234
+ name = '%s %s %s' % (', '.join(data.assign), data.flavor,
237
235
  seq2str2(data.values))
238
236
  return {'type': 'FOR', 'name': self._escape(name), 'arguments': ''}
239
237
 
@@ -250,15 +248,22 @@ class JsonConverter:
250
248
  for branch in data.body:
251
249
  if branch.type == branch.EXCEPT:
252
250
  patterns = ', '.join(branch.patterns)
253
- as_var = f'AS {branch.variable}' if branch.variable else ''
251
+ as_var = f'AS {branch.assign}' if branch.assign else ''
254
252
  name = f'{patterns} {as_var}'.strip()
255
253
  else:
256
254
  name = ''
257
255
  yield {'type': branch.type, 'name': name, 'arguments': ''}
258
256
 
259
- def _convert_keyword(self, kw, kw_type):
257
+ def _convert_var(self, data):
258
+ if data.name[0] == '$' and len(data.value) == 1:
259
+ value = data.value[0]
260
+ else:
261
+ value = '[' + ', '.join(data.value) + ']'
262
+ return {'type': 'VAR', 'name': f'{data.name} = {value}'}
263
+
264
+ def _convert_keyword(self, kw):
260
265
  return {
261
- 'type': kw_type,
266
+ 'type': kw.type,
262
267
  'name': self._escape(self._get_kw_name(kw)),
263
268
  'arguments': self._escape(', '.join(kw.args))
264
269
  }
@@ -33,6 +33,8 @@ or::
33
33
  assert Matcher('H?llo').match('Hillo')
34
34
  """
35
35
 
36
+ import warnings
37
+
36
38
  from .argumentparser import ArgumentParser, cmdline2list
37
39
  from .application import Application
38
40
  from .compress import compress_text
@@ -52,6 +54,7 @@ from .match import eq, Matcher, MultiMatcher
52
54
  from .misc import (classproperty, isatty, parse_re_flags, plural_or_not,
53
55
  printable_name, seq2str, seq2str2, test_or_task)
54
56
  from .normalizing import normalize, normalize_whitespace, NormalizedDict
57
+ from .notset import NOT_SET
55
58
  from .platform import PY_VERSION, PYPY, UNIXY, WINDOWS, RERAISED_EXCEPTIONS
56
59
  from .recommendations import RecommendationFinder
57
60
  from .robotenv import get_env_var, set_env_var, del_env_var, get_env_vars
@@ -61,7 +64,7 @@ from .robotpath import abspath, find_file, get_link_path, normpath
61
64
  from .robottime import (elapsed_time_to_string, format_time, get_elapsed_time,
62
65
  get_time, get_timestamp, secs_to_timestamp,
63
66
  secs_to_timestr, timestamp_to_secs, timestr_to_secs,
64
- parse_time)
67
+ parse_time, parse_timestamp)
65
68
  from .robottypes import (has_args, is_bytes, is_dict_like, is_falsy, is_integer,
66
69
  is_list_like, is_number, is_pathlike, is_string, is_truthy,
67
70
  is_union, type_name, type_repr, typeddict_types)
@@ -79,37 +82,49 @@ def read_rest_data(rstfile):
79
82
  return read_rest_data(rstfile)
80
83
 
81
84
 
82
- # Quietly deprecated utils. Should be deprecated loudly in RF 7.0.
83
- # https://github.com/robotframework/robotframework/issues/4501
84
-
85
- from .robottypes import FALSE_STRINGS, TRUE_STRINGS
86
-
87
-
88
- # Deprecated Python 2/3 compatibility layer. Not needed by Robot Framework itself
89
- # after RF 5.0 when Python 2 support was dropped. Should be deprecated loudly in
90
- # RF 7.0. Notice that there's also `PY2` in the `platform` submodule.
91
- # https://github.com/robotframework/robotframework/issues/4501
92
-
93
- from io import StringIO
94
-
95
-
96
- PY3 = True
97
- PY2 = JYTHON = IRONPYTHON = False
98
- is_unicode = is_string
99
- unicode = str
100
- unic = safe_str
101
- roundup = round
102
-
103
-
104
- def py2to3(cls):
105
- """Deprecated since RF 5.0. Use Python 3 features directly instead."""
106
- if hasattr(cls, '__unicode__'):
107
- cls.__str__ = lambda self: self.__unicode__()
108
- if hasattr(cls, '__nonzero__'):
109
- cls.__bool__ = lambda self: self.__nonzero__()
110
- return cls
111
-
112
-
113
- def py3to2(cls):
114
- """Deprecated since RF 5.0. Never done anything when used on Python 3."""
115
- return cls
85
+ def unic(item):
86
+ # Cannot be deprecated using '__getattr__' because a module with same name exists.
87
+ warnings.warn("'robot.utils.unic' is deprecated and will be removed in "
88
+ "Robot Framework 8.0.")
89
+ return safe_str(item)
90
+
91
+
92
+ def __getattr__(name):
93
+ # Deprecated utils mostly related to the old Python 2/3 compatibility layer.
94
+ # See also 'unic' above 'PY2' in the 'platform' module. TODO: Remove in RF 8.0.
95
+ # https://github.com/robotframework/robotframework/issues/4501
96
+
97
+ from io import StringIO
98
+ from .robottypes import FALSE_STRINGS, TRUE_STRINGS
99
+
100
+ def py2to3(cls):
101
+ if hasattr(cls, '__unicode__'):
102
+ cls.__str__ = lambda self: self.__unicode__()
103
+ if hasattr(cls, '__nonzero__'):
104
+ cls.__bool__ = lambda self: self.__nonzero__()
105
+ return cls
106
+
107
+ def py3to2(cls):
108
+ return cls
109
+
110
+ deprecated = {
111
+ 'FALSE_STRINGS': FALSE_STRINGS,
112
+ 'TRUE_STRINGS': TRUE_STRINGS,
113
+ 'StringIO': StringIO,
114
+ 'PY3': True,
115
+ 'PY2': False,
116
+ 'JYTHON': False,
117
+ 'IRONPYTHON': False,
118
+ 'is_unicode': is_string,
119
+ 'unicode': str,
120
+ 'roundup': round,
121
+ 'py2to3': py2to3,
122
+ 'py3to2': py3to2,
123
+ }
124
+
125
+ if name in deprecated:
126
+ warnings.warn(f"'robot.utils.{name}' is deprecated and will be removed in "
127
+ f"Robot Framework 8.0.")
128
+ return deprecated[name]
129
+
130
+ raise AssertionError(f"'robot.utils' has no attribute '{name}'.")
@@ -13,17 +13,21 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ from typing import Any
17
+
16
18
  from .normalizing import NormalizedDict
17
- from .robottypes import is_string
19
+
20
+
21
+ Connection = Any
18
22
 
19
23
 
20
24
  class ConnectionCache:
21
25
  """Cache for libraries to use with concurrent connections, processes, etc.
22
26
 
23
27
  The cache stores the registered connections (or other objects) and allows
24
- switching between them using generated indices or user given aliases.
25
- This is useful with any library where there's need for multiple concurrent
26
- connections, processes, etc.
28
+ switching between them using generated indices, user given aliases or
29
+ connection objects themselves. This is useful with any library having a need
30
+ for multiple concurrent connections, processes, etc.
27
31
 
28
32
  This class is used also outside the core framework by SeleniumLibrary,
29
33
  SSHLibrary, etc. Backwards compatibility is thus important when doing changes.
@@ -33,10 +37,10 @@ class ConnectionCache:
33
37
  self._no_current = NoConnection(no_current_msg)
34
38
  self.current = self._no_current #: Current active connection.
35
39
  self._connections = []
36
- self._aliases = NormalizedDict()
40
+ self._aliases = NormalizedDict[int]()
37
41
 
38
42
  @property
39
- def current_index(self):
43
+ def current_index(self) -> 'int|None':
40
44
  if not self:
41
45
  return None
42
46
  for index, conn in enumerate(self):
@@ -44,11 +48,13 @@ class ConnectionCache:
44
48
  return index + 1
45
49
 
46
50
  @current_index.setter
47
- def current_index(self, index):
48
- self.current = self._connections[index - 1] \
49
- if index is not None else self._no_current
51
+ def current_index(self, index: 'int|None'):
52
+ if index is None:
53
+ self.current = self._no_current
54
+ else:
55
+ self.current = self._connections[index - 1]
50
56
 
51
- def register(self, connection, alias=None):
57
+ def register(self, connection: Connection, alias: 'str|None' = None):
52
58
  """Registers given connection with optional alias and returns its index.
53
59
 
54
60
  Given connection is set to be the :attr:`current` connection.
@@ -62,52 +68,74 @@ class ConnectionCache:
62
68
  self.current = connection
63
69
  self._connections.append(connection)
64
70
  index = len(self._connections)
65
- if is_string(alias):
71
+ if alias:
66
72
  self._aliases[alias] = index
67
73
  return index
68
74
 
69
- def switch(self, alias_or_index):
70
- """Switches to the connection specified by the given alias or index.
75
+ def switch(self, identifier: 'int|str|Connection') -> Connection:
76
+ """Switches to the connection specified using the ``identifier``.
71
77
 
72
- Updates :attr:`current` and also returns its new value.
78
+ Identifier can be an index, an alias, or a registered connection.
79
+ Raises an error if no matching connection is found.
73
80
 
74
- Alias is whatever was given to :meth:`register` method and indices
75
- are returned by it. Index can be given either as an integer or
76
- as a string that can be converted to an integer. Raises an error
77
- if no connection with the given index or alias found.
81
+ Updates :attr:`current` and also returns its new value.
78
82
  """
79
- self.current = self.get_connection(alias_or_index)
83
+ self.current = self.get_connection(identifier)
80
84
  return self.current
81
85
 
82
- def get_connection(self, alias_or_index=None):
83
- """Get the connection specified by the given alias or index..
86
+ def get_connection(self, identifier: 'int|str|Connection|None' = None) -> Connection:
87
+ """Returns the connection specified using the ``identifier``.
84
88
 
85
- If ``alias_or_index`` is ``None``, returns the current connection
86
- if it is active, or raises an error if it is not.
87
-
88
- Alias is whatever was given to :meth:`register` method and indices
89
- are returned by it. Index can be given either as an integer or
90
- as a string that can be converted to an integer. Raises an error
91
- if no connection with the given index or alias found.
89
+ Identifier can be an index (integer or string), an alias, a registered
90
+ connection or ``None``. If the identifier is ``None``, returns the
91
+ current connection if it is active and raises an error if it is not.
92
+ Raises an error also if no matching connection is found.
92
93
  """
93
- if alias_or_index is None:
94
+ if identifier is None:
94
95
  if not self:
95
96
  self.current.raise_error()
96
97
  return self.current
97
98
  try:
98
- index = self.resolve_alias_or_index(alias_or_index)
99
+ index = self.get_connection_index(identifier)
99
100
  except ValueError as err:
100
101
  raise RuntimeError(err.args[0])
101
102
  return self._connections[index-1]
102
103
 
103
- __getitem__ = get_connection
104
+ def get_connection_index(self, identifier: 'int|str|Connection') -> int:
105
+ """Returns the index of the connection specified using the ``identifier``.
106
+
107
+ Identifier can be an index (integer or string), an alias, or a registered
108
+ connection.
104
109
 
105
- def close_all(self, closer_method='close'):
106
- """Closes connections using given closer method and empties cache.
110
+ New in Robot Framework 7.0. :meth:`resolve_alias_or_index` can be used
111
+ with earlier versions.
112
+ """
113
+ if isinstance(identifier, str) and identifier in self._aliases:
114
+ return self._aliases[identifier]
115
+ if identifier in self._connections:
116
+ return self._connections.index(identifier) + 1
117
+ try:
118
+ index = int(identifier)
119
+ except (ValueError, TypeError):
120
+ index = -1
121
+ if 0 < index <= len(self._connections):
122
+ return index
123
+ raise ValueError(f"Non-existing index or alias '{identifier}'.")
124
+
125
+ def resolve_alias_or_index(self, alias_or_index):
126
+ """Deprecated in RF 7.0. Use :meth:`get_connection_index` instead."""
127
+ # This was initially added for SeleniumLibrary in RF 3.1.2.
128
+ # https://github.com/robotframework/robotframework/issues/3125
129
+ # The new method was added in RF 7.0. We can loudly deprecate this
130
+ # earliest in RF 8.0.
131
+ return self.get_connection_index(alias_or_index)
132
+
133
+ def close_all(self, closer_method: str = 'close'):
134
+ """Closes connections using the specified closer method and empties cache.
107
135
 
108
136
  If simply calling the closer method is not adequate for closing
109
137
  connections, clients should close connections themselves and use
110
- :meth:`empty_cache` afterwards.
138
+ :meth:`empty_cache` afterward.
111
139
  """
112
140
  for conn in self._connections:
113
141
  getattr(conn, closer_method)()
@@ -123,6 +151,8 @@ class ConnectionCache:
123
151
  self._connections = []
124
152
  self._aliases = NormalizedDict()
125
153
 
154
+ __getitem__ = get_connection
155
+
126
156
  def __iter__(self):
127
157
  return iter(self._connections)
128
158
 
@@ -132,31 +162,6 @@ class ConnectionCache:
132
162
  def __bool__(self):
133
163
  return self.current is not self._no_current
134
164
 
135
- def resolve_alias_or_index(self, alias_or_index):
136
- for resolver in self._resolve_alias, self._resolve_index, self._is_connection:
137
- try:
138
- return resolver(alias_or_index)
139
- except ValueError:
140
- pass
141
- raise ValueError(f"Non-existing index or alias '{alias_or_index}'.")
142
-
143
- def _resolve_alias(self, alias):
144
- if is_string(alias) and alias in self._aliases:
145
- return self._aliases[alias]
146
- raise ValueError
147
-
148
- def _resolve_index(self, index):
149
- try:
150
- index = int(index)
151
- except TypeError:
152
- raise ValueError
153
- if not 0 < index <= len(self._connections):
154
- raise ValueError
155
- return index
156
-
157
- def _is_connection(self, conn):
158
- return self._connections.index(conn) + 1
159
-
160
165
 
161
166
  class NoConnection:
162
167
 
@@ -75,7 +75,7 @@ def _get_unixy_encoding():
75
75
 
76
76
 
77
77
  def _get_stream_output_encoding():
78
- # Python 3.6+ uses UTF-8 as encoding with output streams.
78
+ # Python uses UTF-8 as encoding with output streams.
79
79
  # We want the real console encoding regardless the platform.
80
80
  if WINDOWS:
81
81
  return None
@@ -94,27 +94,29 @@ unescape = Unescaper().unescape
94
94
 
95
95
 
96
96
  def split_from_equals(string):
97
- from robot.variables import VariableIterator
97
+ from robot.variables import VariableMatches
98
98
  if not is_string(string) or '=' not in string:
99
99
  return string, None
100
- variables = VariableIterator(string, ignore_errors=True)
101
- if not variables and '\\' not in string:
100
+ matches = VariableMatches(string, ignore_errors=True)
101
+ if not matches and '\\' not in string:
102
102
  return tuple(string.split('=', 1))
103
103
  try:
104
- index = _find_split_index(string, variables)
104
+ index = _find_split_index(string, matches)
105
105
  except ValueError:
106
106
  return string, None
107
107
  return string[:index], string[index+1:]
108
108
 
109
109
 
110
- def _find_split_index(string, variables):
110
+ def _find_split_index(string, matches):
111
+ remaining = string
111
112
  relative_index = 0
112
- for before, match, string in variables:
113
+ for match in matches:
113
114
  try:
114
- return _find_split_index_from_part(before) + relative_index
115
+ return _find_split_index_from_part(match.before) + relative_index
115
116
  except ValueError:
116
- relative_index += len(before) + len(match)
117
- return _find_split_index_from_part(string) + relative_index
117
+ remaining = match.after
118
+ relative_index += match.end
119
+ return _find_split_index_from_part(remaining) + relative_index
118
120
 
119
121
 
120
122
  def _find_split_index_from_part(string):
@@ -36,17 +36,18 @@ class _MarkupWriter:
36
36
  def _preamble(self):
37
37
  pass
38
38
 
39
- def start(self, name, attrs=None, newline=True):
40
- attrs = self._format_attrs(attrs)
39
+ def start(self, name, attrs=None, newline=True, write_empty=None):
40
+ attrs = self._format_attrs(attrs, write_empty)
41
41
  self._start(name, attrs, newline)
42
42
 
43
43
  def _start(self, name, attrs, newline):
44
44
  self._write(f'<{name} {attrs}>' if attrs else f'<{name}>', newline)
45
45
 
46
- def _format_attrs(self, attrs):
46
+ def _format_attrs(self, attrs, write_empty):
47
47
  if not attrs:
48
48
  return ''
49
- write_empty = self._write_empty
49
+ if write_empty is None:
50
+ write_empty = self._write_empty
50
51
  return ' '.join(f"{name}=\"{attribute_escape(value or '')}\""
51
52
  for name, value in self._order_attrs(attrs)
52
53
  if write_empty or value)
@@ -64,9 +65,12 @@ class _MarkupWriter:
64
65
  def end(self, name, newline=True):
65
66
  self._write(f'</{name}>', newline)
66
67
 
67
- def element(self, name, content=None, attrs=None, escape=True, newline=True):
68
- attrs = self._format_attrs(attrs)
69
- if self._write_empty or content or attrs:
68
+ def element(self, name, content=None, attrs=None, escape=True, newline=True,
69
+ write_empty=None):
70
+ attrs = self._format_attrs(attrs, write_empty)
71
+ if write_empty is None:
72
+ write_empty = self._write_empty
73
+ if write_empty or content or attrs:
70
74
  self._start(name, attrs, newline=False)
71
75
  self.content(content, escape)
72
76
  self.end(name, newline)
@@ -98,15 +102,18 @@ class XmlWriter(_MarkupWriter):
98
102
  def _escape(self, text):
99
103
  return xml_escape(text)
100
104
 
101
- def element(self, name, content=None, attrs=None, escape=True, newline=True):
105
+ def element(self, name, content=None, attrs=None, escape=True, newline=True,
106
+ write_empty=None):
102
107
  if content:
103
- super().element(name, content, attrs, escape, newline)
108
+ super().element(name, content, attrs, escape, newline, write_empty)
104
109
  else:
105
- self._self_closing_element(name, attrs, newline)
110
+ self._self_closing_element(name, attrs, newline, write_empty)
106
111
 
107
- def _self_closing_element(self, name, attrs, newline):
108
- attrs = self._format_attrs(attrs)
109
- if self._write_empty or attrs:
112
+ def _self_closing_element(self, name, attrs, newline, write_empty):
113
+ attrs = self._format_attrs(attrs, write_empty)
114
+ if write_empty is None:
115
+ write_empty = self._write_empty
116
+ if write_empty or attrs:
110
117
  self._write(f'<{name} {attrs}/>' if attrs else f'<{name}/>', newline)
111
118
 
112
119
 
@@ -14,47 +14,32 @@
14
14
  # limitations under the License.
15
15
 
16
16
  import re
17
- from collections.abc import Iterable, Iterator, Mapping, Sequence
18
- from typing import Any, MutableMapping, overload, TypeVar
17
+ from collections.abc import Iterator, Mapping, Sequence
18
+ from typing import Any, MutableMapping, TypeVar
19
19
 
20
20
 
21
21
  V = TypeVar('V')
22
22
  Self = TypeVar('Self', bound='NormalizedDict')
23
23
 
24
24
 
25
- @overload
26
25
  def normalize(string: str, ignore: 'Sequence[str]' = (), caseless: bool = True,
27
26
  spaceless: bool = True) -> str:
28
- ...
29
-
30
-
31
- @overload
32
- def normalize(string: bytes, ignore: 'Sequence[bytes]' = (), caseless: bool = True,
33
- spaceless: bool = True) -> bytes:
34
- ...
35
-
36
-
37
- # TODO: Remove bytes support in RF 7.0. There shouldn't be needs for that with Python 3.
38
- def normalize(string, ignore=(), caseless=True, spaceless=True):
39
27
  """Normalize the ``string`` according to the given spec.
40
28
 
41
- By default, string is turned to lower case and all whitespace is removed.
42
- Additional characters can be removed by giving them in ``ignore`` list.
29
+ By default, string is turned to lower case (actually case-folded) and all
30
+ whitespace is removed. Additional characters can be removed by giving them
31
+ in ``ignore`` list.
43
32
  """
44
- empty = '' if isinstance(string, str) else b''
45
- if isinstance(ignore, bytes):
46
- # Iterating bytes in Python3 yields integers.
47
- ignore = [bytes([i]) for i in ignore]
48
33
  if spaceless:
49
- string = empty.join(string.split())
34
+ string = ''.join(string.split())
50
35
  if caseless:
51
- string = string.lower()
52
- ignore = [i.lower() for i in ignore]
36
+ string = string.casefold()
37
+ ignore = [i.casefold() for i in ignore]
53
38
  # both if statements below enhance performance a little
54
39
  if ignore:
55
40
  for ign in ignore:
56
41
  if ign in string:
57
- string = string.replace(ign, empty)
42
+ string = string.replace(ign, '')
58
43
  return string
59
44
 
60
45
 
@@ -0,0 +1,33 @@
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
+ class NotSet:
17
+ """Represents value that is not set.
18
+
19
+ Can be used instead of the standard ``None`` in cases where ``None``
20
+ itself is a valid value.
21
+
22
+ Use the constant ``robot.utils.NOT_SET`` instead of creating new instances
23
+ of the class.
24
+
25
+ New in Robot Framework 7.0.
26
+ """
27
+
28
+ def __repr__(self):
29
+ return ''
30
+
31
+
32
+ NOT_SET = NotSet()
33
+
@@ -23,11 +23,6 @@ UNIXY = os.sep == '/'
23
23
  WINDOWS = not UNIXY
24
24
  RERAISED_EXCEPTIONS = (KeyboardInterrupt, SystemExit, MemoryError)
25
25
 
26
- # Part of the deprecated Python 2/3 compatibility layer. For more details see
27
- # the comment in `utils/__init__.py`. This constant was added to support
28
- # SSHLibrary: https://github.com/robotframework/SSHLibrary/issues/401
29
- PY2 = False
30
-
31
26
 
32
27
  def isatty(stream):
33
28
  # first check if buffer was detached
@@ -39,3 +34,18 @@ def isatty(stream):
39
34
  return stream.isatty()
40
35
  except ValueError: # Occurs if file is closed.
41
36
  return False
37
+
38
+
39
+ def __getattr__(name):
40
+ # Part of the deprecated Python 2/3 compatibility layer. For more details see
41
+ # the comment in `utils/__init__.py`. The 'PY2' constant exists here to support
42
+ # SSHLibrary: https://github.com/robotframework/SSHLibrary/issues/401
43
+
44
+ import warnings
45
+
46
+ if name == 'PY2':
47
+ warnings.warn("'robot.utils.platform.PY2' is deprecated and will be removed "
48
+ "in Robot Framework 8.0.")
49
+ return False
50
+
51
+ raise AttributeError(f"'robot.utils.platform' has no attribute '{name}'.")
@@ -44,6 +44,7 @@ def normpath(path, case_normalize=False):
44
44
  That includes Windows and also OSX in default configuration.
45
45
  4. Turn ``c:`` into ``c:\\`` on Windows instead of keeping it as ``c:``.
46
46
  """
47
+ # FIXME: Support pathlib.Path
47
48
  if not is_string(path):
48
49
  path = system_decode(path)
49
50
  path = safe_str(path) # Handles NFC normalization on OSX