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.
- {robotframework-6.1.1 → robotframework-7.0}/INSTALL.rst +25 -25
- {robotframework-6.1.1 → robotframework-7.0}/PKG-INFO +6 -8
- {robotframework-6.1.1 → robotframework-7.0}/README.rst +3 -2
- {robotframework-6.1.1 → robotframework-7.0}/setup.py +3 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/__init__.py +4 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/deco.py +60 -14
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/exceptions.py +6 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/interfaces.py +402 -67
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/logger.py +27 -20
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/api/parsing.py +4 -2
- robotframework-7.0/src/robot/api/py.typed +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/gatherfailed.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/languages.py +0 -9
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/settings.py +21 -14
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/storage.js +11 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/htmlfilewriter.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.css +10 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.html +10 -0
- robotframework-7.0/src/robot/htmldata/rebot/common.css +362 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/doc_formatting.css +13 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.css +51 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.html +14 -23
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/model.js +2 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.css +83 -19
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/report.html +22 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/testdata.js +10 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/view.js +84 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/template.py +3 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/builder.py +0 -8
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/datatypes.py +9 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlutils.py +4 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonbuilder.py +38 -20
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/model.py +21 -28
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/robotbuilder.py +50 -31
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/standardtypes.py +9 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlbuilder.py +35 -20
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/xmlwriter.py +18 -38
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/BuiltIn.py +255 -205
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Collections.py +384 -240
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/DateTime.py +73 -60
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/OperatingSystem.py +6 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Process.py +26 -27
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Remote.py +40 -36
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/String.py +66 -76
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/XML.py +66 -59
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/__init__.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/__init__.py +5 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/body.py +44 -13
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/configurer.py +15 -11
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/control.py +226 -84
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/filter.py +31 -25
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/itemlist.py +9 -8
- robotframework-7.0/src/robot/model/keyword.py +77 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/message.py +19 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modelobject.py +25 -7
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/namepatterns.py +3 -25
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/stats.py +9 -15
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tags.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testcase.py +15 -27
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/testsuite.py +17 -26
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/visitor.py +35 -8
- robotframework-7.0/src/robot/output/console/dotted.py +90 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/quiet.py +3 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/verbose.py +61 -61
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/debugfile.py +39 -24
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/filelogger.py +18 -15
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/librarylogger.py +3 -2
- robotframework-7.0/src/robot/output/listeners.py +753 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/logger.py +216 -80
- robotframework-7.0/src/robot/output/loggerapi.py +215 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/loggerhelper.py +23 -56
- robotframework-7.0/src/robot/output/output.py +185 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/stdoutlogsplitter.py +8 -5
- robotframework-7.0/src/robot/output/xmllogger.py +459 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/blocklexers.py +17 -13
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/context.py +12 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/lexer.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/settings.py +6 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/statementlexers.py +39 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokens.py +27 -29
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/blocks.py +19 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/statements.py +193 -94
- robotframework-7.0/src/robot/parsing/model/visitor.py +100 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/rebot.py +2 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/expandkeywordmatcher.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsbuildingcontext.py +8 -6
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsmodelbuilders.py +88 -61
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/logreportwriters.py +16 -10
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/outputwriter.py +18 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/resultwriter.py +4 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/stringcache.py +3 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/xunitwriter.py +15 -21
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/__init__.py +3 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/configurer.py +12 -9
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionresult.py +56 -8
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/flattenkeywordmatcher.py +48 -9
- robotframework-7.0/src/robot/result/keywordremover.py +207 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/merger.py +1 -1
- robotframework-7.0/src/robot/result/model.py +1185 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/modeldeprecation.py +9 -3
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/resultbuilder.py +46 -36
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/xmlelementhandlers.py +83 -43
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/run.py +2 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/__init__.py +14 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/__init__.py +2 -1
- robotframework-7.0/src/robot/running/arguments/argumentconverter.py +100 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentmapper.py +26 -24
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentparser.py +82 -60
- robotframework-7.0/src/robot/running/arguments/argumentresolver.py +158 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentspec.py +83 -116
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/argumentvalidator.py +33 -27
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/customconverters.py +15 -12
- robotframework-7.0/src/robot/running/arguments/embedded.py +145 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/arguments/typeconverters.py +233 -213
- robotframework-7.0/src/robot/running/arguments/typeinfo.py +317 -0
- robotframework-7.0/src/robot/running/arguments/typeinfoparser.py +219 -0
- robotframework-7.0/src/robot/running/arguments/typevalidator.py +60 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/bodyrunner.py +147 -129
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/builders.py +2 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/parsers.py +10 -11
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/settings.py +9 -17
- robotframework-7.0/src/robot/running/builder/transformers.py +535 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/context.py +113 -31
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/dynamicmethods.py +62 -34
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/importer.py +27 -49
- robotframework-7.0/src/robot/running/invalidkeyword.py +67 -0
- robotframework-7.0/src/robot/running/keywordfinder.py +91 -0
- robotframework-7.0/src/robot/running/keywordimplementation.py +164 -0
- robotframework-7.0/src/robot/running/librarykeyword.py +392 -0
- robotframework-7.0/src/robot/running/librarykeywordrunner.py +250 -0
- robotframework-7.0/src/robot/running/libraryscopes.py +115 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/model.py +195 -377
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/namespace.py +124 -137
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/outputcapture.py +20 -12
- robotframework-7.0/src/robot/running/resourcemodel.py +448 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/statusreporter.py +16 -13
- robotframework-7.0/src/robot/running/suiterunner.py +265 -0
- robotframework-7.0/src/robot/running/testlibraries.py +500 -0
- robotframework-7.0/src/robot/running/userkeywordrunner.py +260 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/testdoc.py +18 -13
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/__init__.py +53 -35
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/connectioncache.py +64 -59
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/dotdict.py +3 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encodingsniffer.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/escaping.py +19 -19
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/importer.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markupwriters.py +23 -15
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/misc.py +1 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/normalizing.py +9 -24
- robotframework-7.0/src/robot/utils/notset.py +33 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/platform.py +15 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotio.py +9 -9
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotpath.py +1 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottime.py +122 -90
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robottypes.py +21 -31
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/setter.py +0 -5
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/text.py +7 -4
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/unic.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/__init__.py +2 -2
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/assigner.py +17 -19
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/evaluation.py +20 -17
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/filesetter.py +80 -80
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/replacer.py +33 -36
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/scopes.py +17 -12
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/search.py +66 -41
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/store.py +14 -16
- robotframework-7.0/src/robot/variables/tablesetter.py +164 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/variables.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/version.py +1 -1
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/PKG-INFO +6 -8
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/SOURCES.txt +10 -8
- {robotframework-6.1.1 → robotframework-7.0}/tasks.py +6 -6
- robotframework-6.1.1/src/robot/htmldata/rebot/common.css +0 -239
- robotframework-6.1.1/src/robot/libraries/Reserved.py +0 -48
- robotframework-6.1.1/src/robot/model/keyword.py +0 -173
- robotframework-6.1.1/src/robot/output/console/dotted.py +0 -90
- robotframework-6.1.1/src/robot/output/listenerarguments.py +0 -165
- robotframework-6.1.1/src/robot/output/listenermethods.py +0 -113
- robotframework-6.1.1/src/robot/output/listeners.py +0 -174
- robotframework-6.1.1/src/robot/output/output.py +0 -95
- robotframework-6.1.1/src/robot/output/xmllogger.py +0 -354
- robotframework-6.1.1/src/robot/parsing/model/visitor.py +0 -67
- robotframework-6.1.1/src/robot/result/keywordremover.py +0 -183
- robotframework-6.1.1/src/robot/result/model.py +0 -957
- robotframework-6.1.1/src/robot/running/arguments/argumentconverter.py +0 -79
- robotframework-6.1.1/src/robot/running/arguments/argumentresolver.py +0 -131
- robotframework-6.1.1/src/robot/running/arguments/embedded.py +0 -146
- robotframework-6.1.1/src/robot/running/arguments/typevalidator.py +0 -56
- robotframework-6.1.1/src/robot/running/builder/transformers.py +0 -642
- robotframework-6.1.1/src/robot/running/handlers.py +0 -321
- robotframework-6.1.1/src/robot/running/handlerstore.py +0 -66
- robotframework-6.1.1/src/robot/running/librarykeywordrunner.py +0 -238
- robotframework-6.1.1/src/robot/running/libraryscopes.py +0 -97
- robotframework-6.1.1/src/robot/running/modelcombiner.py +0 -32
- robotframework-6.1.1/src/robot/running/suiterunner.py +0 -248
- robotframework-6.1.1/src/robot/running/testlibraries.py +0 -423
- robotframework-6.1.1/src/robot/running/usererrorhandler.py +0 -75
- robotframework-6.1.1/src/robot/running/userkeyword.py +0 -111
- robotframework-6.1.1/src/robot/running/userkeywordrunner.py +0 -274
- robotframework-6.1.1/src/robot/variables/tablesetter.py +0 -156
- {robotframework-6.1.1 → robotframework-7.0}/AUTHORS.rst +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/BUILD.rst +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/CONTRIBUTING.rst +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/COPYRIGHT.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/LICENSE.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/MANIFEST.in +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/setup.cfg +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/__main__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/conf/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/errors.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/common/js_disabled.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/jsonwriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/print.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/libdoc/pygments.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/fileloading.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/log.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/print.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/rebot/util.js +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.css +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.html +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdoc.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/consoleviewer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/htmlwriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/jsonwriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/output.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libdocpkg/writer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Dialogs.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Easter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Screenshot.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/Telnet.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/libraries/dialogs_py.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/fixture.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/metadata.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/modifier.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/statistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/suitestatistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagsetter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/tagstatistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/model/totalstatistics.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/console/highlighting.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/output/pyloggingconf.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/lexer/tokenizer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/model/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/blockparsers.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/fileparser.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/parser/parser.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/parsing/suitestructure.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/pythonpathsetter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jsexecutionresult.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/reporting/jswriter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/executionerrors.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/messagefilter.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/suiteteardownfailed.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/result/visitor.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/builder/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/randomizer.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/runkwregister.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/signalhandler.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/status.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/__init__.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/posix.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/running/timeouts/windows.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/application.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/argumentparser.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/asserts.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/charwidth.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/compress.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/encoding.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/error.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/etreewrapper.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/filereader.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/frange.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/htmlformatters.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/markuputils.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/match.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/recommendations.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/restreader.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotenv.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/robotinspect.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/sortable.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/utils/typehints.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/finders.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/notfound.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robot/variables/resolvable.py +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/dependency_links.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/entry_points.txt +0 -0
- {robotframework-6.1.1 → robotframework-7.0}/src/robotframework.egg-info/top_level.txt +0 -0
|
@@ -21,32 +21,32 @@ from itertools import chain
|
|
|
21
21
|
from robot.errors import DataError, KeywordError
|
|
22
22
|
from robot.libraries import STDLIBS
|
|
23
23
|
from robot.output import LOGGER, Message
|
|
24
|
-
from robot.utils import (
|
|
25
|
-
|
|
24
|
+
from robot.utils import (eq, find_file, is_string, normalize, RecommendationFinder,
|
|
25
|
+
seq2str2)
|
|
26
26
|
|
|
27
27
|
from .context import EXECUTION_CONTEXTS
|
|
28
28
|
from .importer import ImportCache, Importer
|
|
29
|
-
from .
|
|
29
|
+
from .invalidkeyword import InvalidKeyword
|
|
30
|
+
from .resourcemodel import Import
|
|
30
31
|
from .runkwregister import RUN_KW_REGISTER
|
|
31
|
-
|
|
32
|
-
from .userkeyword import UserLibrary
|
|
32
|
+
|
|
33
33
|
|
|
34
34
|
IMPORTER = Importer()
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
class Namespace:
|
|
38
|
-
_default_libraries = ('BuiltIn', '
|
|
38
|
+
_default_libraries = ('BuiltIn', 'Easter')
|
|
39
39
|
_library_import_by_path_ends = ('.py', '/', os.sep)
|
|
40
40
|
_variables_import_by_path_ends = _library_import_by_path_ends + ('.yaml', '.yml') + ('.json',)
|
|
41
41
|
|
|
42
42
|
def __init__(self, variables, suite, resource, languages):
|
|
43
|
-
LOGGER.info(f"Initializing namespace for suite '{suite.
|
|
43
|
+
LOGGER.info(f"Initializing namespace for suite '{suite.full_name}'.")
|
|
44
44
|
self.variables = variables
|
|
45
45
|
self.languages = languages
|
|
46
46
|
self._imports = resource.imports
|
|
47
47
|
self._kw_store = KeywordStore(resource, languages)
|
|
48
48
|
self._imported_variable_files = ImportCache()
|
|
49
|
-
self._suite_name = suite.
|
|
49
|
+
self._suite_name = suite.full_name
|
|
50
50
|
self._running_test = False
|
|
51
51
|
|
|
52
52
|
@property
|
|
@@ -68,7 +68,7 @@ class Namespace:
|
|
|
68
68
|
raise DataError(f'{item.setting_name} setting requires value.')
|
|
69
69
|
self._import(item)
|
|
70
70
|
except DataError as err:
|
|
71
|
-
item.
|
|
71
|
+
item.report_error(err.message)
|
|
72
72
|
|
|
73
73
|
def _import(self, import_setting):
|
|
74
74
|
action = import_setting.select(self._import_library,
|
|
@@ -84,11 +84,10 @@ class Namespace:
|
|
|
84
84
|
self._validate_not_importing_init_file(path)
|
|
85
85
|
if overwrite or path not in self._kw_store.resources:
|
|
86
86
|
resource = IMPORTER.import_resource(path, self.languages)
|
|
87
|
-
self.variables.
|
|
88
|
-
|
|
89
|
-
self._kw_store.resources[path] = user_library
|
|
87
|
+
self.variables.set_from_variable_section(resource.variables, overwrite)
|
|
88
|
+
self._kw_store.resources[path] = resource
|
|
90
89
|
self._handle_imports(resource.imports)
|
|
91
|
-
LOGGER.imported("Resource",
|
|
90
|
+
LOGGER.imported("Resource", resource.name,
|
|
92
91
|
importer=str(import_setting.source),
|
|
93
92
|
source=path)
|
|
94
93
|
else:
|
|
@@ -134,13 +133,13 @@ class Namespace:
|
|
|
134
133
|
if notify:
|
|
135
134
|
LOGGER.imported("Library", lib.name,
|
|
136
135
|
args=list(import_setting.args),
|
|
137
|
-
originalname=lib.
|
|
136
|
+
originalname=lib.real_name,
|
|
138
137
|
importer=str(import_setting.source),
|
|
139
|
-
source=lib.source)
|
|
138
|
+
source=str(lib.source or ''))
|
|
140
139
|
self._kw_store.libraries[lib.name] = lib
|
|
141
|
-
lib.start_suite()
|
|
140
|
+
lib.scope_manager.start_suite()
|
|
142
141
|
if self._running_test:
|
|
143
|
-
lib.start_test()
|
|
142
|
+
lib.scope_manager.start_test()
|
|
144
143
|
|
|
145
144
|
def _resolve_name(self, setting):
|
|
146
145
|
name = setting.name
|
|
@@ -179,12 +178,12 @@ class Namespace:
|
|
|
179
178
|
self._running_test = True
|
|
180
179
|
self.variables.start_test()
|
|
181
180
|
for lib in self.libraries:
|
|
182
|
-
lib.start_test()
|
|
181
|
+
lib.scope_manager.start_test()
|
|
183
182
|
|
|
184
183
|
def end_test(self):
|
|
185
184
|
self.variables.end_test()
|
|
186
185
|
for lib in self.libraries:
|
|
187
|
-
lib.end_test()
|
|
186
|
+
lib.scope_manager.end_test()
|
|
188
187
|
self._running_test = True
|
|
189
188
|
|
|
190
189
|
def start_suite(self):
|
|
@@ -192,7 +191,7 @@ class Namespace:
|
|
|
192
191
|
|
|
193
192
|
def end_suite(self, suite):
|
|
194
193
|
for lib in self.libraries:
|
|
195
|
-
lib.end_suite()
|
|
194
|
+
lib.scope_manager.end_suite()
|
|
196
195
|
if not suite.parent:
|
|
197
196
|
IMPORTER.close_global_library_listeners()
|
|
198
197
|
self.variables.end_suite()
|
|
@@ -203,29 +202,29 @@ class Namespace:
|
|
|
203
202
|
def end_user_keyword(self):
|
|
204
203
|
self.variables.end_keyword()
|
|
205
204
|
|
|
206
|
-
def get_library_instance(self,
|
|
207
|
-
return self._kw_store.get_library(
|
|
205
|
+
def get_library_instance(self, name):
|
|
206
|
+
return self._kw_store.get_library(name).instance
|
|
208
207
|
|
|
209
208
|
def get_library_instances(self):
|
|
210
|
-
return dict((name, lib.
|
|
209
|
+
return dict((name, lib.instance)
|
|
211
210
|
for name, lib in self._kw_store.libraries.items())
|
|
212
211
|
|
|
213
|
-
def reload_library(self,
|
|
214
|
-
library = self._kw_store.get_library(
|
|
215
|
-
library.
|
|
212
|
+
def reload_library(self, name_or_instance):
|
|
213
|
+
library = self._kw_store.get_library(name_or_instance)
|
|
214
|
+
library.create_keywords()
|
|
216
215
|
return library
|
|
217
216
|
|
|
218
217
|
def get_runner(self, name, recommend_on_failure=True):
|
|
219
218
|
try:
|
|
220
219
|
return self._kw_store.get_runner(name, recommend_on_failure)
|
|
221
|
-
except DataError as
|
|
222
|
-
return
|
|
220
|
+
except DataError as err:
|
|
221
|
+
return InvalidKeyword(str(name), error=str(err)).create_runner(name)
|
|
223
222
|
|
|
224
223
|
|
|
225
224
|
class KeywordStore:
|
|
226
225
|
|
|
227
|
-
def __init__(self,
|
|
228
|
-
self.
|
|
226
|
+
def __init__(self, suite_file, languages):
|
|
227
|
+
self.suite_file = suite_file
|
|
229
228
|
self.libraries = OrderedDict()
|
|
230
229
|
self.resources = ImportCache()
|
|
231
230
|
self.search_order = ()
|
|
@@ -253,7 +252,7 @@ class KeywordStore:
|
|
|
253
252
|
|
|
254
253
|
def _get_lib_by_instance(self, instance):
|
|
255
254
|
for lib in self.libraries.values():
|
|
256
|
-
if lib.
|
|
255
|
+
if lib._instance is instance:
|
|
257
256
|
return lib
|
|
258
257
|
self._no_library_found(instance)
|
|
259
258
|
|
|
@@ -277,18 +276,18 @@ class KeywordStore:
|
|
|
277
276
|
)
|
|
278
277
|
message = f"No keyword with name '{name}' found."
|
|
279
278
|
if recommend:
|
|
280
|
-
finder = KeywordRecommendationFinder(self.
|
|
281
|
-
self.libraries,
|
|
282
|
-
self.resources)
|
|
279
|
+
finder = KeywordRecommendationFinder(self.suite_file,
|
|
280
|
+
*self.libraries.values(),
|
|
281
|
+
*self.resources.values())
|
|
283
282
|
raise KeywordError(finder.recommend_similar_keywords(name, message))
|
|
284
283
|
else:
|
|
285
284
|
raise KeywordError(message)
|
|
286
285
|
|
|
287
286
|
def _get_runner(self, name):
|
|
288
287
|
if not name:
|
|
289
|
-
raise DataError('Keyword name cannot be empty.'
|
|
288
|
+
raise DataError('Keyword name cannot be empty.')
|
|
290
289
|
if not is_string(name):
|
|
291
|
-
raise DataError('Keyword name must be a string.'
|
|
290
|
+
raise DataError('Keyword name must be a string.')
|
|
292
291
|
runner = self._get_runner_from_suite_file(name)
|
|
293
292
|
if not runner and '.' in name:
|
|
294
293
|
runner = self._get_explicit_runner(name)
|
|
@@ -315,35 +314,35 @@ class KeywordStore:
|
|
|
315
314
|
self._get_runner_from_libraries(name))
|
|
316
315
|
|
|
317
316
|
def _get_runner_from_suite_file(self, name):
|
|
318
|
-
|
|
317
|
+
keywords = self.suite_file.find_keywords(name)
|
|
318
|
+
if not keywords:
|
|
319
319
|
return None
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
runner = handlers[0].create_runner(name, self.languages)
|
|
320
|
+
if len(keywords) > 1:
|
|
321
|
+
keywords = self._select_best_matches(keywords)
|
|
322
|
+
if len(keywords) > 1:
|
|
323
|
+
self._raise_multiple_keywords_found(keywords, name)
|
|
324
|
+
runner = keywords[0].create_runner(name, self.languages)
|
|
326
325
|
ctx = EXECUTION_CONTEXTS.current
|
|
327
326
|
caller = ctx.user_keywords[-1] if ctx.user_keywords else ctx.test
|
|
328
|
-
if caller and runner.source != caller.source:
|
|
327
|
+
if caller and runner.keyword.source != caller.source:
|
|
329
328
|
if self._exists_in_resource_file(name, caller.source):
|
|
330
329
|
message = (
|
|
331
|
-
f"Keyword '{caller.
|
|
330
|
+
f"Keyword '{caller.full_name}' called keyword '{name}' that exists "
|
|
332
331
|
f"both in the same resource file as the caller and in the suite "
|
|
333
332
|
f"file using that resource. The keyword in the suite file is used "
|
|
334
|
-
f"now, but this will change in Robot Framework
|
|
333
|
+
f"now, but this will change in Robot Framework 8.0."
|
|
335
334
|
)
|
|
336
335
|
runner.pre_run_messages += Message(message, level='WARN'),
|
|
337
336
|
return runner
|
|
338
337
|
|
|
339
|
-
def _select_best_matches(self,
|
|
338
|
+
def _select_best_matches(self, keywords):
|
|
340
339
|
# "Normal" matches are considered exact and win over embedded matches.
|
|
341
|
-
normal = [
|
|
340
|
+
normal = [kw for kw in keywords if not kw.embedded]
|
|
342
341
|
if normal:
|
|
343
342
|
return normal
|
|
344
|
-
matches = [
|
|
345
|
-
if not self._is_worse_match_than_others(
|
|
346
|
-
return matches or
|
|
343
|
+
matches = [kw for kw in keywords
|
|
344
|
+
if not self._is_worse_match_than_others(kw, keywords)]
|
|
345
|
+
return matches or keywords
|
|
347
346
|
|
|
348
347
|
def _is_worse_match_than_others(self, candidate, alternatives):
|
|
349
348
|
for other in alternatives:
|
|
@@ -360,135 +359,133 @@ class KeywordStore:
|
|
|
360
359
|
|
|
361
360
|
def _exists_in_resource_file(self, name, source):
|
|
362
361
|
for resource in self.resources.values():
|
|
363
|
-
if resource.source == source and
|
|
362
|
+
if resource.source == source and resource.find_keywords(name):
|
|
364
363
|
return True
|
|
365
364
|
return False
|
|
366
365
|
|
|
367
366
|
def _get_runner_from_resource_files(self, name):
|
|
368
|
-
|
|
369
|
-
for
|
|
370
|
-
if not
|
|
367
|
+
keywords = [kw for resource in self.resources.values()
|
|
368
|
+
for kw in resource.find_keywords(name)]
|
|
369
|
+
if not keywords:
|
|
371
370
|
return None
|
|
372
|
-
if len(
|
|
373
|
-
|
|
374
|
-
if len(
|
|
375
|
-
|
|
376
|
-
if len(
|
|
377
|
-
|
|
378
|
-
if len(
|
|
379
|
-
self._raise_multiple_keywords_found(
|
|
380
|
-
return
|
|
371
|
+
if len(keywords) > 1:
|
|
372
|
+
keywords = self._filter_based_on_search_order(keywords)
|
|
373
|
+
if len(keywords) > 1:
|
|
374
|
+
keywords = self._prioritize_same_file_or_public(keywords)
|
|
375
|
+
if len(keywords) > 1:
|
|
376
|
+
keywords = self._select_best_matches(keywords)
|
|
377
|
+
if len(keywords) > 1:
|
|
378
|
+
self._raise_multiple_keywords_found(keywords, name)
|
|
379
|
+
return keywords[0].create_runner(name, self.languages)
|
|
381
380
|
|
|
382
381
|
def _get_runner_from_libraries(self, name):
|
|
383
|
-
|
|
384
|
-
for
|
|
385
|
-
if not
|
|
382
|
+
keywords = [kw for lib in self.libraries.values()
|
|
383
|
+
for kw in lib.find_keywords(name)]
|
|
384
|
+
if not keywords:
|
|
386
385
|
return None
|
|
387
386
|
pre_run_message = None
|
|
388
|
-
if len(
|
|
389
|
-
|
|
390
|
-
if len(
|
|
391
|
-
|
|
392
|
-
if len(
|
|
393
|
-
|
|
394
|
-
if len(
|
|
395
|
-
self._raise_multiple_keywords_found(
|
|
396
|
-
runner =
|
|
387
|
+
if len(keywords) > 1:
|
|
388
|
+
keywords = self._filter_based_on_search_order(keywords)
|
|
389
|
+
if len(keywords) > 1:
|
|
390
|
+
keywords = self._select_best_matches(keywords)
|
|
391
|
+
if len(keywords) > 1:
|
|
392
|
+
keywords, pre_run_message = self._filter_stdlib_handler(keywords)
|
|
393
|
+
if len(keywords) > 1:
|
|
394
|
+
self._raise_multiple_keywords_found(keywords, name)
|
|
395
|
+
runner = keywords[0].create_runner(name, self.languages)
|
|
397
396
|
if pre_run_message:
|
|
398
397
|
runner.pre_run_messages += (pre_run_message,)
|
|
399
398
|
return runner
|
|
400
399
|
|
|
401
|
-
def _prioritize_same_file_or_public(self,
|
|
400
|
+
def _prioritize_same_file_or_public(self, keywords):
|
|
402
401
|
user_keywords = EXECUTION_CONTEXTS.current.user_keywords
|
|
403
402
|
if user_keywords:
|
|
404
403
|
parent_source = user_keywords[-1].source
|
|
405
|
-
matches = [
|
|
404
|
+
matches = [kw for kw in keywords if kw.source == parent_source]
|
|
406
405
|
if matches:
|
|
407
406
|
return matches
|
|
408
|
-
matches = [
|
|
409
|
-
return matches or
|
|
407
|
+
matches = [kw for kw in keywords if not kw.private]
|
|
408
|
+
return matches or keywords
|
|
410
409
|
|
|
411
|
-
def _filter_based_on_search_order(self,
|
|
412
|
-
for
|
|
413
|
-
matches = [
|
|
410
|
+
def _filter_based_on_search_order(self, keywords):
|
|
411
|
+
for name in self.search_order:
|
|
412
|
+
matches = [kw for kw in keywords if eq(name, kw.owner.name)]
|
|
414
413
|
if matches:
|
|
415
414
|
return matches
|
|
416
|
-
return
|
|
415
|
+
return keywords
|
|
417
416
|
|
|
418
|
-
def _filter_stdlib_handler(self,
|
|
417
|
+
def _filter_stdlib_handler(self, keywords):
|
|
419
418
|
warning = None
|
|
420
|
-
if len(
|
|
421
|
-
return
|
|
419
|
+
if len(keywords) != 2:
|
|
420
|
+
return keywords, warning
|
|
422
421
|
stdlibs_without_remote = STDLIBS - {'Remote'}
|
|
423
|
-
if
|
|
424
|
-
standard, custom =
|
|
425
|
-
elif
|
|
426
|
-
custom, standard =
|
|
422
|
+
if keywords[0].owner.real_name in stdlibs_without_remote:
|
|
423
|
+
standard, custom = keywords
|
|
424
|
+
elif keywords[1].owner.real_name in stdlibs_without_remote:
|
|
425
|
+
custom, standard = keywords
|
|
427
426
|
else:
|
|
428
|
-
return
|
|
429
|
-
if not RUN_KW_REGISTER.is_run_keyword(custom.
|
|
427
|
+
return keywords, warning
|
|
428
|
+
if not RUN_KW_REGISTER.is_run_keyword(custom.owner.real_name, custom.name):
|
|
430
429
|
warning = self._custom_and_standard_keyword_conflict_warning(custom, standard)
|
|
431
430
|
return [custom], warning
|
|
432
431
|
|
|
433
432
|
def _custom_and_standard_keyword_conflict_warning(self, custom, standard):
|
|
434
433
|
custom_with_name = standard_with_name = ''
|
|
435
|
-
if custom.
|
|
436
|
-
custom_with_name = f" imported as '{custom.
|
|
437
|
-
if standard.
|
|
438
|
-
standard_with_name = f" imported as '{standard.
|
|
434
|
+
if custom.owner.name != custom.owner.real_name:
|
|
435
|
+
custom_with_name = f" imported as '{custom.owner.name}'"
|
|
436
|
+
if standard.owner.name != standard.owner.real_name:
|
|
437
|
+
standard_with_name = f" imported as '{standard.owner.name}'"
|
|
439
438
|
return Message(
|
|
440
439
|
f"Keyword '{standard.name}' found both from a custom library "
|
|
441
|
-
f"'{custom.
|
|
442
|
-
f"'{standard.
|
|
440
|
+
f"'{custom.owner.real_name}'{custom_with_name} and a standard library "
|
|
441
|
+
f"'{standard.owner.real_name}'{standard_with_name}. The custom keyword "
|
|
443
442
|
f"is used. To select explicitly, and to get rid of this warning, use "
|
|
444
|
-
f"either '{custom.
|
|
443
|
+
f"either '{custom.full_name}' or '{standard.full_name}'.", level='WARN'
|
|
445
444
|
)
|
|
446
445
|
|
|
447
446
|
def _get_explicit_runner(self, name):
|
|
448
|
-
|
|
447
|
+
kws_and_names = []
|
|
449
448
|
for owner_name, kw_name in self._get_owner_and_kw_names(name):
|
|
450
449
|
for owner in chain(self.libraries.values(), self.resources.values()):
|
|
451
|
-
if eq(owner.name, owner_name)
|
|
452
|
-
for
|
|
453
|
-
|
|
454
|
-
if not
|
|
450
|
+
if eq(owner.name, owner_name):
|
|
451
|
+
for kw in owner.find_keywords(kw_name):
|
|
452
|
+
kws_and_names.append((kw, kw_name))
|
|
453
|
+
if not kws_and_names:
|
|
455
454
|
return None
|
|
456
|
-
if len(
|
|
457
|
-
|
|
455
|
+
if len(kws_and_names) == 1:
|
|
456
|
+
kw, kw_name = kws_and_names[0]
|
|
458
457
|
else:
|
|
459
|
-
|
|
460
|
-
matches = self._select_best_matches(
|
|
458
|
+
keywords = [kw for kw, _ in kws_and_names]
|
|
459
|
+
matches = self._select_best_matches(keywords)
|
|
461
460
|
if len(matches) > 1:
|
|
462
|
-
self._raise_multiple_keywords_found(
|
|
463
|
-
|
|
464
|
-
return
|
|
461
|
+
self._raise_multiple_keywords_found(keywords, name, implicit=False)
|
|
462
|
+
kw, kw_name = kws_and_names[keywords.index(matches[0])]
|
|
463
|
+
return kw.create_runner(kw_name, self.languages)
|
|
465
464
|
|
|
466
465
|
def _get_owner_and_kw_names(self, full_name):
|
|
467
466
|
tokens = full_name.split('.')
|
|
468
467
|
return [('.'.join(tokens[:index]), '.'.join(tokens[index:]))
|
|
469
468
|
for index in range(1, len(tokens))]
|
|
470
469
|
|
|
471
|
-
def _raise_multiple_keywords_found(self,
|
|
472
|
-
if any(
|
|
470
|
+
def _raise_multiple_keywords_found(self, keywords, name, implicit=True):
|
|
471
|
+
if any(kw.embedded for kw in keywords):
|
|
473
472
|
error = f"Multiple keywords matching name '{name}' found"
|
|
474
473
|
else:
|
|
475
474
|
error = f"Multiple keywords with name '{name}' found"
|
|
476
475
|
if implicit:
|
|
477
476
|
error += ". Give the full name of the keyword you want to use"
|
|
478
|
-
names = sorted(
|
|
477
|
+
names = sorted(kw.full_name for kw in keywords)
|
|
479
478
|
raise KeywordError('\n '.join([error+':'] + names))
|
|
480
479
|
|
|
481
480
|
|
|
482
481
|
class KeywordRecommendationFinder:
|
|
483
482
|
|
|
484
|
-
def __init__(self,
|
|
485
|
-
self.
|
|
486
|
-
self.libraries = libraries
|
|
487
|
-
self.resources = resources
|
|
483
|
+
def __init__(self, *owners):
|
|
484
|
+
self.owners = owners
|
|
488
485
|
|
|
489
486
|
def recommend_similar_keywords(self, name, message):
|
|
490
487
|
"""Return keyword names similar to `name`."""
|
|
491
|
-
candidates = self._get_candidates('.' in name)
|
|
488
|
+
candidates = self._get_candidates(use_full_name='.' in name)
|
|
492
489
|
finder = RecommendationFinder(
|
|
493
490
|
lambda name: normalize(candidates.get(name, name), ignore='_')
|
|
494
491
|
)
|
|
@@ -499,21 +496,11 @@ class KeywordRecommendationFinder:
|
|
|
499
496
|
def format_recommendations(message, recommendations):
|
|
500
497
|
return RecommendationFinder().format(message, recommendations)
|
|
501
498
|
|
|
502
|
-
def _get_candidates(self, use_full_name):
|
|
503
|
-
|
|
504
|
-
|
|
499
|
+
def _get_candidates(self, use_full_name=False):
|
|
500
|
+
candidates = {}
|
|
501
|
+
names = sorted((owner.name or '', kw.name)
|
|
502
|
+
for owner in self.owners for kw in owner.keywords)
|
|
503
|
+
for owner, name in names:
|
|
505
504
|
full_name = f'{owner}.{name}' if owner else name
|
|
506
|
-
|
|
507
|
-
return
|
|
508
|
-
|
|
509
|
-
def _get_all_handler_names(self):
|
|
510
|
-
"""Return a list of `(library_name, handler_name)` tuples."""
|
|
511
|
-
handlers = [('', printable_name(handler.name, True))
|
|
512
|
-
for handler in self.user_keywords.handlers]
|
|
513
|
-
for library in chain(self.libraries.values(), self.resources.values()):
|
|
514
|
-
if library.name != 'Reserved':
|
|
515
|
-
handlers.extend(
|
|
516
|
-
((library.name or '',
|
|
517
|
-
printable_name(handler.name, code_style=True))
|
|
518
|
-
for handler in library.handlers))
|
|
519
|
-
return sorted(handlers)
|
|
505
|
+
candidates[full_name] = full_name if use_full_name else name
|
|
506
|
+
return candidates
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
from io import StringIO
|
|
17
16
|
import sys
|
|
17
|
+
from io import StringIO
|
|
18
18
|
|
|
19
19
|
from robot.output import LOGGER
|
|
20
20
|
from robot.utils import console_decode, console_encode
|
|
@@ -23,19 +23,27 @@ from robot.utils import console_decode, console_encode
|
|
|
23
23
|
class OutputCapturer:
|
|
24
24
|
|
|
25
25
|
def __init__(self, library_import=False):
|
|
26
|
-
self.
|
|
27
|
-
self.
|
|
28
|
-
self.
|
|
26
|
+
self.library_import = library_import
|
|
27
|
+
self.stdout = None
|
|
28
|
+
self.stderr = None
|
|
29
|
+
|
|
30
|
+
def start(self):
|
|
31
|
+
self.stdout = StreamCapturer(stdout=True)
|
|
32
|
+
self.stderr = StreamCapturer(stdout=False)
|
|
33
|
+
if self.library_import:
|
|
34
|
+
LOGGER.enable_library_import_logging()
|
|
35
|
+
|
|
36
|
+
def stop(self):
|
|
37
|
+
self._release_and_log()
|
|
38
|
+
if self.library_import:
|
|
39
|
+
LOGGER.disable_library_import_logging()
|
|
29
40
|
|
|
30
41
|
def __enter__(self):
|
|
31
|
-
|
|
32
|
-
LOGGER.enable_library_import_logging()
|
|
42
|
+
self.start()
|
|
33
43
|
return self
|
|
34
44
|
|
|
35
45
|
def __exit__(self, exc_type, exc_value, exc_trace):
|
|
36
|
-
self.
|
|
37
|
-
if self._library_import:
|
|
38
|
-
LOGGER.disable_library_import_logging()
|
|
46
|
+
self.stop()
|
|
39
47
|
return False
|
|
40
48
|
|
|
41
49
|
def _release_and_log(self):
|
|
@@ -47,12 +55,12 @@ class OutputCapturer:
|
|
|
47
55
|
sys.__stderr__.write(console_encode(stderr, stream=sys.__stderr__))
|
|
48
56
|
|
|
49
57
|
def _release(self):
|
|
50
|
-
stdout = self.
|
|
51
|
-
stderr = self.
|
|
58
|
+
stdout = self.stdout.release()
|
|
59
|
+
stderr = self.stderr.release()
|
|
52
60
|
return stdout, stderr
|
|
53
61
|
|
|
54
62
|
|
|
55
|
-
class
|
|
63
|
+
class StreamCapturer:
|
|
56
64
|
|
|
57
65
|
def __init__(self, stdout=True):
|
|
58
66
|
if stdout:
|