robotframework 6.1.1__zip → 7.0__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. {robotframework-6.1.1 → robotframework-7.0}/INSTALL.rst +25 -25
  2. {robotframework-6.1.1 → robotframework-7.0}/PKG-INFO +6 -8
  3. {robotframework-6.1.1 → robotframework-7.0}/README.rst +3 -2
  4. {robotframework-6.1.1 → robotframework-7.0}/setup.py +3 -6
  5. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/__init__.py +4 -1
  6. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/deco.py +60 -14
  7. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/exceptions.py +6 -6
  8. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/interfaces.py +402 -67
  9. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/logger.py +27 -20
  10. {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/parsing.py +4 -2
  11. robotframework-7.0/src/robot/api/py.typed +0 -0
  12. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/gatherfailed.py +2 -2
  13. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/languages.py +0 -9
  14. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/settings.py +21 -14
  15. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/storage.js +11 -6
  16. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/htmlfilewriter.py +1 -1
  17. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.css +10 -2
  18. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.html +10 -0
  19. robotframework-7.0/src/robot/htmldata/rebot/common.css +362 -0
  20. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/doc_formatting.css +13 -7
  21. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.css +51 -10
  22. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.html +14 -23
  23. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/model.js +2 -4
  24. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.css +83 -19
  25. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.html +22 -7
  26. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/testdata.js +10 -3
  27. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/view.js +84 -0
  28. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/template.py +3 -3
  29. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/builder.py +0 -8
  30. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/datatypes.py +9 -10
  31. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlutils.py +4 -7
  32. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonbuilder.py +38 -20
  33. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/model.py +21 -28
  34. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/robotbuilder.py +50 -31
  35. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/standardtypes.py +9 -1
  36. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlbuilder.py +35 -20
  37. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlwriter.py +18 -38
  38. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/BuiltIn.py +255 -205
  39. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Collections.py +384 -240
  40. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/DateTime.py +73 -60
  41. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/OperatingSystem.py +6 -5
  42. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Process.py +26 -27
  43. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Remote.py +40 -36
  44. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/String.py +66 -76
  45. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/XML.py +66 -59
  46. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/__init__.py +2 -2
  47. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/__init__.py +5 -5
  48. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/body.py +44 -13
  49. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/configurer.py +15 -11
  50. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/control.py +226 -84
  51. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/filter.py +31 -25
  52. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/itemlist.py +9 -8
  53. robotframework-7.0/src/robot/model/keyword.py +77 -0
  54. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/message.py +19 -10
  55. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modelobject.py +25 -7
  56. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/namepatterns.py +3 -25
  57. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/stats.py +9 -15
  58. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tags.py +1 -1
  59. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testcase.py +15 -27
  60. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testsuite.py +17 -26
  61. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/visitor.py +35 -8
  62. robotframework-7.0/src/robot/output/console/dotted.py +90 -0
  63. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/quiet.py +3 -2
  64. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/verbose.py +61 -61
  65. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/debugfile.py +39 -24
  66. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/filelogger.py +18 -15
  67. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/librarylogger.py +3 -2
  68. robotframework-7.0/src/robot/output/listeners.py +753 -0
  69. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/logger.py +216 -80
  70. robotframework-7.0/src/robot/output/loggerapi.py +215 -0
  71. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/loggerhelper.py +23 -56
  72. robotframework-7.0/src/robot/output/output.py +185 -0
  73. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/stdoutlogsplitter.py +8 -5
  74. robotframework-7.0/src/robot/output/xmllogger.py +459 -0
  75. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/blocklexers.py +17 -13
  76. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/context.py +12 -2
  77. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/lexer.py +1 -1
  78. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/settings.py +6 -3
  79. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/statementlexers.py +39 -10
  80. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokens.py +27 -29
  81. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/blocks.py +19 -6
  82. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/statements.py +193 -94
  83. robotframework-7.0/src/robot/parsing/model/visitor.py +100 -0
  84. {robotframework-6.1.1 → robotframework-7.0}/src/robot/rebot.py +2 -0
  85. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/expandkeywordmatcher.py +1 -1
  86. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsbuildingcontext.py +8 -6
  87. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsmodelbuilders.py +88 -61
  88. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/logreportwriters.py +16 -10
  89. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/outputwriter.py +18 -2
  90. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/resultwriter.py +4 -4
  91. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/stringcache.py +3 -3
  92. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/xunitwriter.py +15 -21
  93. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/__init__.py +3 -2
  94. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/configurer.py +12 -9
  95. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionresult.py +56 -8
  96. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/flattenkeywordmatcher.py +48 -9
  97. robotframework-7.0/src/robot/result/keywordremover.py +207 -0
  98. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/merger.py +1 -1
  99. robotframework-7.0/src/robot/result/model.py +1185 -0
  100. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/modeldeprecation.py +9 -3
  101. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/resultbuilder.py +46 -36
  102. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/xmlelementhandlers.py +83 -43
  103. {robotframework-6.1.1 → robotframework-7.0}/src/robot/run.py +2 -0
  104. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/__init__.py +14 -4
  105. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/__init__.py +2 -1
  106. robotframework-7.0/src/robot/running/arguments/argumentconverter.py +100 -0
  107. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentmapper.py +26 -24
  108. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentparser.py +82 -60
  109. robotframework-7.0/src/robot/running/arguments/argumentresolver.py +158 -0
  110. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentspec.py +83 -116
  111. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentvalidator.py +33 -27
  112. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/customconverters.py +15 -12
  113. robotframework-7.0/src/robot/running/arguments/embedded.py +145 -0
  114. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/typeconverters.py +233 -213
  115. robotframework-7.0/src/robot/running/arguments/typeinfo.py +317 -0
  116. robotframework-7.0/src/robot/running/arguments/typeinfoparser.py +219 -0
  117. robotframework-7.0/src/robot/running/arguments/typevalidator.py +60 -0
  118. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/bodyrunner.py +147 -129
  119. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/builders.py +2 -1
  120. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/parsers.py +10 -11
  121. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/settings.py +9 -17
  122. robotframework-7.0/src/robot/running/builder/transformers.py +535 -0
  123. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/context.py +113 -31
  124. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/dynamicmethods.py +62 -34
  125. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/importer.py +27 -49
  126. robotframework-7.0/src/robot/running/invalidkeyword.py +67 -0
  127. robotframework-7.0/src/robot/running/keywordfinder.py +91 -0
  128. robotframework-7.0/src/robot/running/keywordimplementation.py +164 -0
  129. robotframework-7.0/src/robot/running/librarykeyword.py +392 -0
  130. robotframework-7.0/src/robot/running/librarykeywordrunner.py +250 -0
  131. robotframework-7.0/src/robot/running/libraryscopes.py +115 -0
  132. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/model.py +195 -377
  133. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/namespace.py +124 -137
  134. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/outputcapture.py +20 -12
  135. robotframework-7.0/src/robot/running/resourcemodel.py +448 -0
  136. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/statusreporter.py +16 -13
  137. robotframework-7.0/src/robot/running/suiterunner.py +265 -0
  138. robotframework-7.0/src/robot/running/testlibraries.py +500 -0
  139. robotframework-7.0/src/robot/running/userkeywordrunner.py +260 -0
  140. {robotframework-6.1.1 → robotframework-7.0}/src/robot/testdoc.py +18 -13
  141. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/__init__.py +53 -35
  142. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/connectioncache.py +64 -59
  143. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/dotdict.py +3 -0
  144. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encodingsniffer.py +1 -1
  145. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/escaping.py +19 -19
  146. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/importer.py +2 -2
  147. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markupwriters.py +23 -15
  148. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/misc.py +1 -2
  149. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/normalizing.py +9 -24
  150. robotframework-7.0/src/robot/utils/notset.py +33 -0
  151. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/platform.py +15 -5
  152. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotio.py +9 -9
  153. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotpath.py +1 -0
  154. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottime.py +122 -90
  155. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottypes.py +21 -31
  156. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/setter.py +0 -5
  157. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/text.py +7 -4
  158. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/unic.py +2 -2
  159. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/__init__.py +2 -2
  160. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/assigner.py +17 -19
  161. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/evaluation.py +20 -17
  162. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/filesetter.py +80 -80
  163. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/replacer.py +33 -36
  164. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/scopes.py +17 -12
  165. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/search.py +66 -41
  166. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/store.py +14 -16
  167. robotframework-7.0/src/robot/variables/tablesetter.py +164 -0
  168. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/variables.py +1 -1
  169. {robotframework-6.1.1 → robotframework-7.0}/src/robot/version.py +1 -1
  170. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/PKG-INFO +6 -8
  171. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/SOURCES.txt +10 -8
  172. {robotframework-6.1.1 → robotframework-7.0}/tasks.py +6 -6
  173. robotframework-6.1.1/src/robot/htmldata/rebot/common.css +0 -239
  174. robotframework-6.1.1/src/robot/libraries/Reserved.py +0 -48
  175. robotframework-6.1.1/src/robot/model/keyword.py +0 -173
  176. robotframework-6.1.1/src/robot/output/console/dotted.py +0 -90
  177. robotframework-6.1.1/src/robot/output/listenerarguments.py +0 -165
  178. robotframework-6.1.1/src/robot/output/listenermethods.py +0 -113
  179. robotframework-6.1.1/src/robot/output/listeners.py +0 -174
  180. robotframework-6.1.1/src/robot/output/output.py +0 -95
  181. robotframework-6.1.1/src/robot/output/xmllogger.py +0 -354
  182. robotframework-6.1.1/src/robot/parsing/model/visitor.py +0 -67
  183. robotframework-6.1.1/src/robot/result/keywordremover.py +0 -183
  184. robotframework-6.1.1/src/robot/result/model.py +0 -957
  185. robotframework-6.1.1/src/robot/running/arguments/argumentconverter.py +0 -79
  186. robotframework-6.1.1/src/robot/running/arguments/argumentresolver.py +0 -131
  187. robotframework-6.1.1/src/robot/running/arguments/embedded.py +0 -146
  188. robotframework-6.1.1/src/robot/running/arguments/typevalidator.py +0 -56
  189. robotframework-6.1.1/src/robot/running/builder/transformers.py +0 -642
  190. robotframework-6.1.1/src/robot/running/handlers.py +0 -321
  191. robotframework-6.1.1/src/robot/running/handlerstore.py +0 -66
  192. robotframework-6.1.1/src/robot/running/librarykeywordrunner.py +0 -238
  193. robotframework-6.1.1/src/robot/running/libraryscopes.py +0 -97
  194. robotframework-6.1.1/src/robot/running/modelcombiner.py +0 -32
  195. robotframework-6.1.1/src/robot/running/suiterunner.py +0 -248
  196. robotframework-6.1.1/src/robot/running/testlibraries.py +0 -423
  197. robotframework-6.1.1/src/robot/running/usererrorhandler.py +0 -75
  198. robotframework-6.1.1/src/robot/running/userkeyword.py +0 -111
  199. robotframework-6.1.1/src/robot/running/userkeywordrunner.py +0 -274
  200. robotframework-6.1.1/src/robot/variables/tablesetter.py +0 -156
  201. {robotframework-6.1.1 → robotframework-7.0}/AUTHORS.rst +0 -0
  202. {robotframework-6.1.1 → robotframework-7.0}/BUILD.rst +0 -0
  203. {robotframework-6.1.1 → robotframework-7.0}/CONTRIBUTING.rst +0 -0
  204. {robotframework-6.1.1 → robotframework-7.0}/COPYRIGHT.txt +0 -0
  205. {robotframework-6.1.1 → robotframework-7.0}/LICENSE.txt +0 -0
  206. {robotframework-6.1.1 → robotframework-7.0}/MANIFEST.in +0 -0
  207. {robotframework-6.1.1 → robotframework-7.0}/setup.cfg +0 -0
  208. {robotframework-6.1.1 → robotframework-7.0}/src/robot/__init__.py +0 -0
  209. {robotframework-6.1.1 → robotframework-7.0}/src/robot/__main__.py +0 -0
  210. {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/__init__.py +0 -0
  211. {robotframework-6.1.1 → robotframework-7.0}/src/robot/errors.py +0 -0
  212. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/__init__.py +0 -0
  213. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/__init__.py +0 -0
  214. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/js_disabled.css +0 -0
  215. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/jsonwriter.py +0 -0
  216. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/__init__.py +0 -0
  217. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
  218. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.min.js +0 -0
  219. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
  220. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
  221. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
  222. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/__init__.py +0 -0
  223. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
  224. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/print.css +0 -0
  225. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/pygments.css +0 -0
  226. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/__init__.py +0 -0
  227. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/fileloading.js +0 -0
  228. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.js +0 -0
  229. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/print.css +0 -0
  230. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/util.js +0 -0
  231. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/__init__.py +0 -0
  232. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.css +0 -0
  233. {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.html +0 -0
  234. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdoc.py +0 -0
  235. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/__init__.py +0 -0
  236. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/consoleviewer.py +0 -0
  237. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlwriter.py +0 -0
  238. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonwriter.py +0 -0
  239. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/output.py +0 -0
  240. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/writer.py +0 -0
  241. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Dialogs.py +0 -0
  242. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Easter.py +0 -0
  243. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Screenshot.py +0 -0
  244. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Telnet.py +0 -0
  245. {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/dialogs_py.py +0 -0
  246. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/fixture.py +0 -0
  247. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/metadata.py +0 -0
  248. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modifier.py +0 -0
  249. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/statistics.py +0 -0
  250. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/suitestatistics.py +0 -0
  251. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagsetter.py +0 -0
  252. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagstatistics.py +0 -0
  253. {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/totalstatistics.py +0 -0
  254. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/__init__.py +0 -0
  255. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/__init__.py +0 -0
  256. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/highlighting.py +0 -0
  257. {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/pyloggingconf.py +0 -0
  258. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/__init__.py +0 -0
  259. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/__init__.py +0 -0
  260. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokenizer.py +0 -0
  261. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/__init__.py +0 -0
  262. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/__init__.py +0 -0
  263. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/blockparsers.py +0 -0
  264. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/fileparser.py +0 -0
  265. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/parser.py +0 -0
  266. {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/suitestructure.py +0 -0
  267. {robotframework-6.1.1 → robotframework-7.0}/src/robot/pythonpathsetter.py +0 -0
  268. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/__init__.py +0 -0
  269. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsexecutionresult.py +0 -0
  270. {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jswriter.py +0 -0
  271. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionerrors.py +0 -0
  272. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/messagefilter.py +0 -0
  273. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/suiteteardownfailed.py +0 -0
  274. {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/visitor.py +0 -0
  275. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/__init__.py +0 -0
  276. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/randomizer.py +0 -0
  277. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/runkwregister.py +0 -0
  278. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/signalhandler.py +0 -0
  279. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/status.py +0 -0
  280. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/__init__.py +0 -0
  281. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/posix.py +0 -0
  282. {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/windows.py +0 -0
  283. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/application.py +0 -0
  284. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/argumentparser.py +0 -0
  285. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/asserts.py +0 -0
  286. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/charwidth.py +0 -0
  287. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/compress.py +0 -0
  288. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encoding.py +0 -0
  289. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/error.py +0 -0
  290. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/etreewrapper.py +0 -0
  291. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/filereader.py +0 -0
  292. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/frange.py +0 -0
  293. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/htmlformatters.py +0 -0
  294. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markuputils.py +0 -0
  295. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/match.py +0 -0
  296. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/recommendations.py +0 -0
  297. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/restreader.py +0 -0
  298. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotenv.py +0 -0
  299. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotinspect.py +0 -0
  300. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/sortable.py +0 -0
  301. {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/typehints.py +0 -0
  302. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/finders.py +0 -0
  303. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/notfound.py +0 -0
  304. {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/resolvable.py +0 -0
  305. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/dependency_links.txt +0 -0
  306. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/entry_points.txt +0 -0
  307. {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/top_level.txt +0 -0
@@ -1,423 +0,0 @@
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 functools import partial
17
- import inspect
18
- import os
19
-
20
- from robot.errors import DataError
21
- from robot.libraries import STDLIBS
22
- from robot.output import LOGGER
23
- from robot.utils import (getdoc, get_error_details, Importer, is_dict_like, is_init,
24
- is_list_like, normalize, seq2str2, type_name)
25
-
26
- from .arguments import EmbeddedArguments, CustomArgumentConverters
27
- from .context import EXECUTION_CONTEXTS
28
- from .dynamicmethods import (GetKeywordArguments, GetKeywordDocumentation,
29
- GetKeywordNames, GetKeywordTags, RunKeyword)
30
- from .handlers import Handler, InitHandler, DynamicHandler, EmbeddedArgumentsHandler
31
- from .handlerstore import HandlerStore
32
- from .libraryscopes import LibraryScope
33
- from .outputcapture import OutputCapturer
34
-
35
-
36
- def TestLibrary(name, args=None, variables=None, create_handlers=True, logger=LOGGER):
37
- if name in STDLIBS:
38
- import_name = 'robot.libraries.' + name
39
- else:
40
- import_name = name
41
- with OutputCapturer(library_import=True):
42
- importer = Importer('library', logger=LOGGER)
43
- libcode, source = importer.import_class_or_module(import_name,
44
- return_source=True)
45
- libclass = _get_lib_class(libcode)
46
- lib = libclass(libcode, name, args or [], source, logger, variables)
47
- if create_handlers:
48
- lib.create_handlers()
49
- return lib
50
-
51
-
52
- def _get_lib_class(libcode):
53
- if inspect.ismodule(libcode):
54
- return _ModuleLibrary
55
- if GetKeywordNames(libcode):
56
- if RunKeyword(libcode):
57
- return _DynamicLibrary
58
- else:
59
- return _HybridLibrary
60
- return _ClassLibrary
61
-
62
-
63
- class _BaseTestLibrary:
64
- get_handler_error_level = 'INFO'
65
-
66
- def __init__(self, libcode, name, args, source, logger, variables):
67
- if os.path.exists(name):
68
- name = os.path.splitext(os.path.basename(os.path.abspath(name)))[0]
69
- self._libcode = libcode
70
- self._libinst = None
71
- self.version = self._get_version(libcode)
72
- self.name = name
73
- self.orig_name = name # Stores original name when importing WITH NAME
74
- self.source = source
75
- self.logger = logger
76
- self.converters = self._get_converters(libcode)
77
- self.handlers = HandlerStore()
78
- self.has_listener = None # Set when first instance is created
79
- self._doc = None
80
- self.doc_format = self._get_doc_format(libcode)
81
- self.scope = LibraryScope(libcode, self)
82
- self.init = self._create_init_handler(libcode)
83
- self.positional_args, self.named_args \
84
- = self.init.resolve_arguments(args, variables)
85
-
86
- def __len__(self):
87
- return len(self.handlers)
88
-
89
- def __bool__(self):
90
- return bool(self.handlers) or self.has_listener
91
-
92
- @property
93
- def doc(self):
94
- if self._doc is None:
95
- self._doc = getdoc(self.get_instance())
96
- return self._doc
97
-
98
- @property
99
- def lineno(self):
100
- if inspect.ismodule(self._libcode):
101
- return 1
102
- try:
103
- lines, start_lineno = inspect.getsourcelines(self._libcode)
104
- except (TypeError, OSError, IOError):
105
- return -1
106
- for increment, line in enumerate(lines):
107
- if line.strip().startswith('class '):
108
- return start_lineno + increment
109
- return start_lineno
110
-
111
- def create_handlers(self):
112
- self._create_handlers(self.get_instance())
113
- self.reset_instance()
114
-
115
- def handlers_for(self, name):
116
- return self.handlers.get_handlers(name)
117
-
118
- def reload(self):
119
- self.handlers = HandlerStore()
120
- self._create_handlers(self.get_instance())
121
-
122
- def start_suite(self):
123
- self.scope.start_suite()
124
-
125
- def end_suite(self):
126
- self.scope.end_suite()
127
-
128
- def start_test(self):
129
- self.scope.start_test()
130
-
131
- def end_test(self):
132
- self.scope.end_test()
133
-
134
- def report_error(self, message, details=None, level='ERROR',
135
- details_level='INFO'):
136
- prefix = 'Error in' if level in ('ERROR', 'WARN') else 'In'
137
- self.logger.write("%s library '%s': %s" % (prefix, self.name, message),
138
- level)
139
- if details:
140
- self.logger.write('Details:\n%s' % details, details_level)
141
-
142
- def _get_version(self, libcode):
143
- return self._get_attr(libcode, 'ROBOT_LIBRARY_VERSION') \
144
- or self._get_attr(libcode, '__version__')
145
-
146
- def _get_attr(self, object, attr, default='', upper=False):
147
- value = str(getattr(object, attr, default))
148
- if upper:
149
- value = normalize(value, ignore='_').upper()
150
- return value
151
-
152
- def _get_doc_format(self, libcode):
153
- return self._get_attr(libcode, 'ROBOT_LIBRARY_DOC_FORMAT', upper=True)
154
-
155
- def _create_init_handler(self, libcode):
156
- return InitHandler(self, self._resolve_init_method(libcode))
157
-
158
- def _resolve_init_method(self, libcode):
159
- init = getattr(libcode, '__init__', None)
160
- return init if is_init(init) else None
161
-
162
- def _get_converters(self, libcode):
163
- converters = getattr(libcode, 'ROBOT_LIBRARY_CONVERTERS', None)
164
- if not converters:
165
- return None
166
- if not is_dict_like(converters):
167
- self.report_error(f'Argument converters must be given as a dictionary, '
168
- f'got {type_name(converters)}.')
169
- return None
170
- return CustomArgumentConverters.from_dict(converters, self)
171
-
172
- def reset_instance(self, instance=None):
173
- prev = self._libinst
174
- if not self.scope.is_global:
175
- self._libinst = instance
176
- return prev
177
-
178
- def get_instance(self, create=True):
179
- if not create:
180
- return self._libinst
181
- if self._libinst is None:
182
- self._libinst = self._get_instance(self._libcode)
183
- if self.has_listener is None:
184
- self.has_listener = bool(self.get_listeners(self._libinst))
185
- return self._libinst
186
-
187
- def _get_instance(self, libcode):
188
- with OutputCapturer(library_import=True):
189
- try:
190
- return libcode(*self.positional_args, **dict(self.named_args))
191
- except:
192
- self._raise_creating_instance_failed()
193
-
194
- def get_listeners(self, libinst=None):
195
- if libinst is None:
196
- libinst = self.get_instance()
197
- listeners = getattr(libinst, 'ROBOT_LIBRARY_LISTENER', None)
198
- if listeners is None:
199
- return []
200
- if is_list_like(listeners):
201
- return listeners
202
- return [listeners]
203
-
204
- def register_listeners(self):
205
- if self.has_listener:
206
- try:
207
- listeners = EXECUTION_CONTEXTS.current.output.library_listeners
208
- listeners.register(self.get_listeners(), self)
209
- except DataError as err:
210
- self.has_listener = False
211
- # Error should have information about suite where the
212
- # problem occurred but we don't have such info here.
213
- self.report_error("Registering listeners failed: %s" % err)
214
-
215
- def unregister_listeners(self, close=False):
216
- if self.has_listener:
217
- listeners = EXECUTION_CONTEXTS.current.output.library_listeners
218
- listeners.unregister(self, close)
219
-
220
- def close_global_listeners(self):
221
- if self.scope.is_global:
222
- for listener in self.get_listeners():
223
- self._close_listener(listener)
224
-
225
- def _close_listener(self, listener):
226
- method = (getattr(listener, 'close', None) or
227
- getattr(listener, '_close', None))
228
- try:
229
- if method:
230
- method()
231
- except Exception:
232
- message, details = get_error_details()
233
- name = getattr(listener, '__name__', None) or type_name(listener)
234
- self.report_error("Calling method '%s' of listener '%s' failed: %s"
235
- % (method.__name__, name, message), details)
236
-
237
- def _create_handlers(self, libcode):
238
- try:
239
- names = self._get_handler_names(libcode)
240
- except Exception:
241
- message, details = get_error_details()
242
- raise DataError("Getting keyword names from library '%s' failed: %s"
243
- % (self.name, message), details)
244
- for name in names:
245
- method = self._try_to_get_handler_method(libcode, name)
246
- if method:
247
- handler, embedded = self._try_to_create_handler(name, method)
248
- if handler:
249
- try:
250
- self.handlers.add(handler, embedded)
251
- except DataError as err:
252
- self._adding_keyword_failed(handler.name, err)
253
- else:
254
- self.logger.debug("Created keyword '%s'" % handler.name)
255
-
256
- def _get_handler_names(self, libcode):
257
- def has_robot_name(name):
258
- try:
259
- handler = self._get_handler_method(libcode, name)
260
- except DataError:
261
- return False
262
- return hasattr(handler, 'robot_name')
263
-
264
- auto_keywords = getattr(libcode, 'ROBOT_AUTO_KEYWORDS', True)
265
- if auto_keywords:
266
- predicate = lambda name: name[:1] != '_' or has_robot_name(name)
267
- else:
268
- predicate = has_robot_name
269
- return [name for name in dir(libcode) if predicate(name)]
270
-
271
- def _try_to_get_handler_method(self, libcode, name):
272
- try:
273
- return self._get_handler_method(libcode, name)
274
- except DataError as err:
275
- self._adding_keyword_failed(name, err, self.get_handler_error_level)
276
- return None
277
-
278
- def _adding_keyword_failed(self, name, error, level='ERROR'):
279
- self.report_error(
280
- "Adding keyword '%s' failed: %s" % (name, error.message),
281
- error.details,
282
- level=level,
283
- details_level='DEBUG'
284
- )
285
-
286
- def _get_handler_method(self, libcode, name):
287
- try:
288
- method = getattr(libcode, name)
289
- except Exception:
290
- message, details = get_error_details()
291
- raise DataError(f'Getting handler method failed: {message}', details)
292
- return self._validate_handler_method(method)
293
-
294
- def _validate_handler_method(self, method):
295
- # isroutine returns false for partial objects. This may change in the future.
296
- if not (inspect.isroutine(method) or isinstance(method, partial)):
297
- raise DataError('Not a method or function.')
298
- if getattr(method, 'robot_not_keyword', False):
299
- raise DataError('Not exposed as a keyword.')
300
- return method
301
-
302
- def _try_to_create_handler(self, name, method):
303
- try:
304
- handler = self._create_handler(name, method)
305
- except DataError as err:
306
- self._adding_keyword_failed(name, err)
307
- return None, False
308
- try:
309
- return self._get_possible_embedded_args_handler(handler)
310
- except DataError as err:
311
- self._adding_keyword_failed(handler.name, err)
312
- return None, False
313
-
314
- def _create_handler(self, handler_name, handler_method):
315
- return Handler(self, handler_name, handler_method)
316
-
317
- def _get_possible_embedded_args_handler(self, handler):
318
- embedded = EmbeddedArguments.from_name(handler.name)
319
- if embedded:
320
- self._validate_embedded_count(embedded, handler.arguments)
321
- return EmbeddedArgumentsHandler(embedded, handler), True
322
- return handler, False
323
-
324
- def _validate_embedded_count(self, embedded, arguments):
325
- if not (arguments.minargs <= len(embedded.args) <= arguments.maxargs):
326
- raise DataError('Embedded argument count does not match number of '
327
- 'accepted arguments.')
328
-
329
- def _raise_creating_instance_failed(self):
330
- msg, details = get_error_details()
331
- if self.positional_args or self.named_args:
332
- args = self.positional_args + ['%s=%s' % item for item in self.named_args]
333
- args_text = 'arguments %s' % seq2str2(args)
334
- else:
335
- args_text = 'no arguments'
336
- raise DataError("Initializing library '%s' with %s failed: %s\n%s"
337
- % (self.name, args_text, msg, details))
338
-
339
-
340
- class _ClassLibrary(_BaseTestLibrary):
341
-
342
- def _get_handler_method(self, libinst, name):
343
- for item in (libinst,) + inspect.getmro(libinst.__class__):
344
- # `isroutine` is used before `getattr` to avoid calling properties.
345
- if (name in getattr(item, '__dict__', ())
346
- and inspect.isroutine(item.__dict__[name])):
347
- try:
348
- method = getattr(libinst, name)
349
- except Exception:
350
- message, traceback = get_error_details()
351
- raise DataError(f'Getting handler method failed: {message}',
352
- traceback)
353
- return self._validate_handler_method(method)
354
- raise DataError('Not a method or function.')
355
-
356
-
357
- class _ModuleLibrary(_BaseTestLibrary):
358
-
359
- def _get_handler_method(self, libcode, name):
360
- method = _BaseTestLibrary._get_handler_method(self, libcode, name)
361
- if hasattr(libcode, '__all__') and name not in libcode.__all__:
362
- raise DataError('Not exposed as a keyword.')
363
- return method
364
-
365
- def get_instance(self, create=True):
366
- if not create:
367
- return self._libcode
368
- if self.has_listener is None:
369
- self.has_listener = bool(self.get_listeners(self._libcode))
370
- return self._libcode
371
-
372
- def _create_init_handler(self, libcode):
373
- return InitHandler(self)
374
-
375
-
376
- class _HybridLibrary(_BaseTestLibrary):
377
- get_handler_error_level = 'ERROR'
378
-
379
- def _get_handler_names(self, instance):
380
- return GetKeywordNames(instance)()
381
-
382
-
383
- class _DynamicLibrary(_BaseTestLibrary):
384
- get_handler_error_level = 'ERROR'
385
-
386
- def __init__(self, libcode, name, args, source, logger, variables=None):
387
- _BaseTestLibrary.__init__(self, libcode, name, args, source, logger,
388
- variables)
389
-
390
- @property
391
- def doc(self):
392
- if self._doc is None:
393
- self._doc = (self._get_kw_doc('__intro__') or
394
- _BaseTestLibrary.doc.fget(self))
395
- return self._doc
396
-
397
- def _get_kw_doc(self, name):
398
- getter = GetKeywordDocumentation(self.get_instance())
399
- return getter(name)
400
-
401
- def _get_kw_args(self, name):
402
- getter = GetKeywordArguments(self.get_instance())
403
- return getter(name)
404
-
405
- def _get_kw_tags(self, name):
406
- getter = GetKeywordTags(self.get_instance())
407
- return getter(name)
408
-
409
- def _get_handler_names(self, instance):
410
- return GetKeywordNames(instance)()
411
-
412
- def _get_handler_method(self, instance, name):
413
- return RunKeyword(instance)
414
-
415
- def _create_handler(self, name, method):
416
- argspec = self._get_kw_args(name)
417
- tags = self._get_kw_tags(name)
418
- doc = self._get_kw_doc(name)
419
- return DynamicHandler(self, name, method, doc, argspec, tags)
420
-
421
- def _create_init_handler(self, libcode):
422
- docgetter = lambda: self._get_kw_doc('__init__')
423
- return InitHandler(self, self._resolve_init_method(libcode), docgetter)
@@ -1,75 +0,0 @@
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 robot.model import Tags
17
- from robot.result import Keyword as KeywordResult
18
- from robot.variables import VariableAssignment
19
-
20
- from .arguments import ArgumentSpec
21
- from .statusreporter import StatusReporter
22
-
23
-
24
- class UserErrorHandler:
25
- """Created if creating handlers fail. Running it raises DataError.
26
-
27
- The idea is not to raise DataError at processing time and prevent all
28
- tests in affected test case file from executing. Instead, UserErrorHandler
29
- is created and if it is ever run DataError is raised then.
30
- """
31
- supports_embedded_arguments = False
32
-
33
- def __init__(self, error, name, libname=None, source=None, lineno=None):
34
- """
35
- :param robot.errors.DataError error: Occurred error.
36
- :param str name: Name of the affected keyword.
37
- :param str libname: Name of the affected library or resource.
38
- :param str source: Path to the source file.
39
- :param int lineno: Line number of the failing keyword.
40
- """
41
- self.error = error
42
- self.name = name
43
- self.libname = libname
44
- self.source = source
45
- self.lineno = lineno
46
- self.arguments = ArgumentSpec()
47
- self.timeout = None
48
- self.tags = Tags()
49
-
50
- @property
51
- def longname(self):
52
- return f'{self.libname}.{self.name}' if self.libname else self.name
53
-
54
- @property
55
- def doc(self):
56
- return f'*Creating keyword failed:* {self.error}'
57
-
58
- @property
59
- def shortdoc(self):
60
- return self.doc.splitlines()[0]
61
-
62
- def create_runner(self, name, languages=None):
63
- return self
64
-
65
- def run(self, kw, context, run=True):
66
- result = KeywordResult(kwname=self.name,
67
- libname=self.libname,
68
- args=kw.args,
69
- assign=tuple(VariableAssignment(kw.assign)),
70
- type=kw.type)
71
- with StatusReporter(kw, result, context, run):
72
- if run:
73
- raise self.error
74
-
75
- dry_run = run
@@ -1,111 +0,0 @@
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
- import os
17
-
18
- from robot.errors import DataError
19
- from robot.output import LOGGER
20
- from robot.utils import getshortdoc
21
-
22
- from .arguments import EmbeddedArguments, UserKeywordArgumentParser
23
- from .handlerstore import HandlerStore
24
- from .userkeywordrunner import UserKeywordRunner, EmbeddedArgumentsRunner
25
- from .usererrorhandler import UserErrorHandler
26
-
27
-
28
- class UserLibrary:
29
-
30
- def __init__(self, resource, resource_file=True):
31
- source = resource.source
32
- basename = os.path.basename(source) if source else None
33
- self.name = os.path.splitext(basename)[0] if resource_file else None
34
- self.doc = resource.doc
35
- self.handlers = HandlerStore()
36
- self.source = source
37
- for kw in resource.keywords:
38
- try:
39
- handler = self._create_handler(kw)
40
- except DataError as error:
41
- handler = UserErrorHandler(error, kw.name, self.name, source, kw.lineno)
42
- self._log_creating_failed(handler, error)
43
- embedded = isinstance(handler, EmbeddedArgumentsHandler)
44
- try:
45
- self.handlers.add(handler, embedded)
46
- except DataError as error:
47
- self._log_creating_failed(handler, error)
48
-
49
- def _create_handler(self, kw):
50
- if kw.error:
51
- raise DataError(kw.error)
52
- embedded = EmbeddedArguments.from_name(kw.name)
53
- if not embedded:
54
- return UserKeywordHandler(kw, self.name)
55
- return EmbeddedArgumentsHandler(kw, self.name, embedded)
56
-
57
- def _log_creating_failed(self, handler, error):
58
- LOGGER.error(f"Error in file '{self.source}' on line {handler.lineno}: "
59
- f"Creating keyword '{handler.name}' failed: {error.message}")
60
-
61
- def handlers_for(self, name):
62
- return self.handlers.get_handlers(name)
63
-
64
-
65
- # TODO: Should be merged with running.model.UserKeyword
66
-
67
- class UserKeywordHandler:
68
- supports_embedded_args = False
69
-
70
- def __init__(self, keyword, libname):
71
- self.name = keyword.name
72
- self.libname = libname
73
- self.doc = keyword.doc
74
- self.source = keyword.source
75
- self.lineno = keyword.lineno
76
- self.tags = keyword.tags
77
- self.arguments = UserKeywordArgumentParser().parse(tuple(keyword.args),
78
- self.longname)
79
- self.timeout = keyword.timeout
80
- self.body = keyword.body
81
- self.return_value = tuple(keyword.return_)
82
- self.teardown = keyword.teardown if keyword.has_teardown else None
83
-
84
- @property
85
- def longname(self):
86
- return '%s.%s' % (self.libname, self.name) if self.libname else self.name
87
-
88
- @property
89
- def shortdoc(self):
90
- return getshortdoc(self.doc)
91
-
92
- @property
93
- def private(self):
94
- return bool(self.tags and self.tags.robot('private'))
95
-
96
- def create_runner(self, name, languages=None):
97
- return UserKeywordRunner(self)
98
-
99
-
100
- class EmbeddedArgumentsHandler(UserKeywordHandler):
101
- supports_embedded_args = True
102
-
103
- def __init__(self, keyword, libname, embedded):
104
- super().__init__(keyword, libname)
105
- self.embedded = embedded
106
-
107
- def matches(self, name):
108
- return self.embedded.match(name) is not None
109
-
110
- def create_runner(self, name, languages=None):
111
- return EmbeddedArgumentsRunner(self, name)