robotframework 6.1rc1__zip → 7.0__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {robotframework-6.1rc1 → robotframework-7.0}/INSTALL.rst +25 -25
- {robotframework-6.1rc1 → robotframework-7.0}/PKG-INFO +6 -8
- {robotframework-6.1rc1 → robotframework-7.0}/README.rst +3 -2
- {robotframework-6.1rc1 → robotframework-7.0}/setup.py +3 -6
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/__init__.py +4 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/deco.py +60 -14
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/exceptions.py +6 -6
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/interfaces.py +403 -68
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/logger.py +27 -20
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/api/parsing.py +4 -2
- robotframework-7.0/src/robot/api/py.typed +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/gatherfailed.py +2 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/languages.py +61 -25
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/settings.py +21 -14
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/storage.js +11 -6
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/htmlfilewriter.py +1 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.css +10 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/libdoc.html +10 -0
- robotframework-7.0/src/robot/htmldata/rebot/common.css +362 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/doc_formatting.css +13 -7
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.css +51 -10
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.html +14 -23
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/model.js +2 -4
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/report.css +83 -19
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/report.html +22 -7
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/testdata.js +10 -3
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/view.js +84 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/template.py +3 -3
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/builder.py +0 -8
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/datatypes.py +9 -10
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/htmlutils.py +4 -7
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/jsonbuilder.py +38 -20
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/model.py +21 -28
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/robotbuilder.py +50 -31
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/standardtypes.py +9 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/xmlbuilder.py +35 -20
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/xmlwriter.py +18 -38
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/BuiltIn.py +255 -205
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Collections.py +384 -240
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/DateTime.py +73 -60
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/OperatingSystem.py +6 -5
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Process.py +26 -27
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Remote.py +40 -36
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/String.py +66 -76
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/XML.py +66 -59
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/__init__.py +2 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/dialogs_py.py +14 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/__init__.py +5 -5
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/body.py +44 -13
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/configurer.py +19 -15
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/control.py +230 -88
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/filter.py +31 -25
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/itemlist.py +9 -8
- robotframework-7.0/src/robot/model/keyword.py +77 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/message.py +19 -10
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/modelobject.py +27 -15
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/modifier.py +1 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/namepatterns.py +3 -25
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/stats.py +9 -15
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tags.py +1 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/testcase.py +15 -27
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/testsuite.py +44 -28
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/visitor.py +35 -8
- robotframework-7.0/src/robot/output/console/dotted.py +90 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/quiet.py +3 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/verbose.py +61 -61
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/debugfile.py +39 -24
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/filelogger.py +18 -15
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/librarylogger.py +3 -2
- robotframework-7.0/src/robot/output/listeners.py +753 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/logger.py +216 -80
- robotframework-7.0/src/robot/output/loggerapi.py +215 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/loggerhelper.py +23 -56
- robotframework-7.0/src/robot/output/output.py +185 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/stdoutlogsplitter.py +8 -5
- robotframework-7.0/src/robot/output/xmllogger.py +459 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/blocklexers.py +17 -13
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/context.py +12 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/lexer.py +1 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/settings.py +6 -3
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/statementlexers.py +39 -10
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/tokens.py +27 -29
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/blocks.py +19 -6
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/statements.py +193 -94
- robotframework-7.0/src/robot/parsing/model/visitor.py +100 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/rebot.py +2 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/expandkeywordmatcher.py +1 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsbuildingcontext.py +8 -6
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsmodelbuilders.py +88 -61
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/logreportwriters.py +16 -10
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/outputwriter.py +18 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/resultwriter.py +4 -4
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/stringcache.py +3 -3
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/xunitwriter.py +15 -21
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/__init__.py +3 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/configurer.py +12 -9
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/executionresult.py +56 -8
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/flattenkeywordmatcher.py +48 -9
- robotframework-7.0/src/robot/result/keywordremover.py +207 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/merger.py +1 -1
- robotframework-7.0/src/robot/result/model.py +1185 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/modeldeprecation.py +9 -3
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/resultbuilder.py +46 -36
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/xmlelementhandlers.py +83 -43
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/run.py +3 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/__init__.py +14 -4
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/__init__.py +2 -1
- robotframework-7.0/src/robot/running/arguments/argumentconverter.py +100 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentmapper.py +26 -24
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentparser.py +85 -61
- robotframework-7.0/src/robot/running/arguments/argumentresolver.py +158 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentspec.py +83 -116
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/argumentvalidator.py +33 -27
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/customconverters.py +15 -12
- robotframework-7.0/src/robot/running/arguments/embedded.py +145 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/arguments/typeconverters.py +268 -220
- 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.1rc1 → robotframework-7.0}/src/robot/running/bodyrunner.py +147 -129
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/builders.py +17 -26
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/parsers.py +17 -11
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/settings.py +9 -17
- robotframework-7.0/src/robot/running/builder/transformers.py +535 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/context.py +113 -31
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/dynamicmethods.py +62 -34
- {robotframework-6.1rc1 → 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.1rc1 → robotframework-7.0}/src/robot/running/model.py +198 -337
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/namespace.py +124 -137
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/outputcapture.py +20 -12
- robotframework-7.0/src/robot/running/resourcemodel.py +448 -0
- {robotframework-6.1rc1 → 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.1rc1 → robotframework-7.0}/src/robot/testdoc.py +18 -13
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/__init__.py +53 -35
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/connectioncache.py +64 -59
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/dotdict.py +3 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/encodingsniffer.py +9 -4
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/escaping.py +19 -19
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/importer.py +2 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/markupwriters.py +23 -15
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/misc.py +1 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/normalizing.py +9 -24
- robotframework-7.0/src/robot/utils/notset.py +33 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/platform.py +15 -5
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotio.py +9 -9
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotpath.py +1 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robottime.py +122 -90
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robottypes.py +21 -31
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/setter.py +0 -5
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/text.py +7 -4
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/unic.py +2 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/__init__.py +2 -2
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/assigner.py +17 -19
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/evaluation.py +20 -17
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/filesetter.py +80 -80
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/replacer.py +33 -36
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/scopes.py +17 -12
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/search.py +66 -41
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/store.py +14 -16
- robotframework-7.0/src/robot/variables/tablesetter.py +164 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/variables.py +1 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/version.py +1 -1
- {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/PKG-INFO +6 -8
- {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/SOURCES.txt +10 -8
- {robotframework-6.1rc1 → robotframework-7.0}/tasks.py +6 -6
- robotframework-6.1rc1/src/robot/htmldata/rebot/common.css +0 -239
- robotframework-6.1rc1/src/robot/libraries/Reserved.py +0 -48
- robotframework-6.1rc1/src/robot/model/keyword.py +0 -173
- robotframework-6.1rc1/src/robot/output/console/dotted.py +0 -90
- robotframework-6.1rc1/src/robot/output/listenerarguments.py +0 -165
- robotframework-6.1rc1/src/robot/output/listenermethods.py +0 -113
- robotframework-6.1rc1/src/robot/output/listeners.py +0 -174
- robotframework-6.1rc1/src/robot/output/output.py +0 -95
- robotframework-6.1rc1/src/robot/output/xmllogger.py +0 -354
- robotframework-6.1rc1/src/robot/parsing/model/visitor.py +0 -67
- robotframework-6.1rc1/src/robot/result/keywordremover.py +0 -183
- robotframework-6.1rc1/src/robot/result/model.py +0 -957
- robotframework-6.1rc1/src/robot/running/arguments/argumentconverter.py +0 -79
- robotframework-6.1rc1/src/robot/running/arguments/argumentresolver.py +0 -131
- robotframework-6.1rc1/src/robot/running/arguments/embedded.py +0 -146
- robotframework-6.1rc1/src/robot/running/arguments/typevalidator.py +0 -56
- robotframework-6.1rc1/src/robot/running/builder/transformers.py +0 -642
- robotframework-6.1rc1/src/robot/running/handlers.py +0 -321
- robotframework-6.1rc1/src/robot/running/handlerstore.py +0 -66
- robotframework-6.1rc1/src/robot/running/librarykeywordrunner.py +0 -238
- robotframework-6.1rc1/src/robot/running/libraryscopes.py +0 -97
- robotframework-6.1rc1/src/robot/running/modelcombiner.py +0 -32
- robotframework-6.1rc1/src/robot/running/suiterunner.py +0 -249
- robotframework-6.1rc1/src/robot/running/testlibraries.py +0 -420
- robotframework-6.1rc1/src/robot/running/usererrorhandler.py +0 -75
- robotframework-6.1rc1/src/robot/running/userkeyword.py +0 -111
- robotframework-6.1rc1/src/robot/running/userkeywordrunner.py +0 -274
- robotframework-6.1rc1/src/robot/variables/tablesetter.py +0 -156
- {robotframework-6.1rc1 → robotframework-7.0}/AUTHORS.rst +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/BUILD.rst +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/CONTRIBUTING.rst +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/COPYRIGHT.txt +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/LICENSE.txt +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/MANIFEST.in +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/setup.cfg +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/__main__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/conf/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/errors.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/common/js_disabled.css +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/jsonwriter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.min.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/print.css +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/libdoc/pygments.css +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/fileloading.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/log.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/print.css +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/rebot/util.js +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.css +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/htmldata/testdoc/testdoc.html +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdoc.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/consoleviewer.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/htmlwriter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/jsonwriter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/output.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libdocpkg/writer.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Dialogs.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Easter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Screenshot.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/libraries/Telnet.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/fixture.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/metadata.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/statistics.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/suitestatistics.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tagsetter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/tagstatistics.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/model/totalstatistics.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/console/highlighting.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/output/pyloggingconf.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/lexer/tokenizer.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/model/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/blockparsers.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/fileparser.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/parser/parser.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/parsing/suitestructure.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/pythonpathsetter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jsexecutionresult.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/reporting/jswriter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/executionerrors.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/messagefilter.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/suiteteardownfailed.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/result/visitor.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/builder/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/randomizer.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/runkwregister.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/signalhandler.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/status.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/__init__.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/posix.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/running/timeouts/windows.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/application.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/argumentparser.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/asserts.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/charwidth.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/compress.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/encoding.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/error.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/etreewrapper.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/filereader.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/frange.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/htmlformatters.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/markuputils.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/match.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/recommendations.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/restreader.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotenv.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/robotinspect.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/sortable.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/utils/typehints.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/finders.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/notfound.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robot/variables/resolvable.py +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/dependency_links.txt +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/entry_points.txt +0 -0
- {robotframework-6.1rc1 → robotframework-7.0}/src/robotframework.egg-info/top_level.txt +0 -0
|
@@ -1,321 +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 copy import copy
|
|
17
|
-
import inspect
|
|
18
|
-
|
|
19
|
-
from robot.utils import (getdoc, getshortdoc, is_list_like, normpath, printable_name,
|
|
20
|
-
split_tags_from_doc, type_name)
|
|
21
|
-
from robot.errors import DataError
|
|
22
|
-
from robot.model import Tags
|
|
23
|
-
|
|
24
|
-
from .arguments import ArgumentSpec, DynamicArgumentParser, PythonArgumentParser
|
|
25
|
-
from .dynamicmethods import GetKeywordSource, GetKeywordTypes
|
|
26
|
-
from .librarykeywordrunner import (EmbeddedArgumentsRunner,
|
|
27
|
-
LibraryKeywordRunner, RunKeywordRunner)
|
|
28
|
-
from .runkwregister import RUN_KW_REGISTER
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def Handler(library, name, method):
|
|
32
|
-
if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):
|
|
33
|
-
return _RunKeywordHandler(library, name, method)
|
|
34
|
-
return _PythonHandler(library, name, method)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def DynamicHandler(library, name, method, doc, argspec, tags=None):
|
|
38
|
-
if RUN_KW_REGISTER.is_run_keyword(library.orig_name, name):
|
|
39
|
-
return _DynamicRunKeywordHandler(library, name, method, doc, argspec, tags)
|
|
40
|
-
return _DynamicHandler(library, name, method, doc, argspec, tags)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def InitHandler(library, method=None, docgetter=None):
|
|
44
|
-
return _PythonInitHandler(library, '__init__', method, docgetter)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class _RunnableHandler:
|
|
48
|
-
supports_embedded_args = False
|
|
49
|
-
|
|
50
|
-
def __init__(self, library, handler_name, handler_method, doc='', tags=None):
|
|
51
|
-
self.library = library
|
|
52
|
-
self._handler_name = handler_name
|
|
53
|
-
self.name = self._get_name(handler_name, handler_method)
|
|
54
|
-
self.arguments = self._parse_arguments(handler_method)
|
|
55
|
-
self._method = self._get_initial_handler(library, handler_name,
|
|
56
|
-
handler_method)
|
|
57
|
-
doc, tags_from_doc = split_tags_from_doc(doc or '')
|
|
58
|
-
tags_from_attr = self._get_tags_from_attribute(handler_method)
|
|
59
|
-
self._doc = doc
|
|
60
|
-
self.tags = Tags(tuple(tags_from_doc) +
|
|
61
|
-
tuple(tags_from_attr) +
|
|
62
|
-
tuple(tags or ()))
|
|
63
|
-
|
|
64
|
-
def _get_name(self, handler_name, handler_method):
|
|
65
|
-
robot_name = getattr(handler_method, 'robot_name', None)
|
|
66
|
-
name = robot_name or printable_name(handler_name, code_style=True)
|
|
67
|
-
if not name:
|
|
68
|
-
raise DataError('Keyword name cannot be empty.')
|
|
69
|
-
return name
|
|
70
|
-
|
|
71
|
-
def _parse_arguments(self, handler_method):
|
|
72
|
-
raise NotImplementedError
|
|
73
|
-
|
|
74
|
-
def _get_tags_from_attribute(self, handler_method):
|
|
75
|
-
tags = getattr(handler_method, 'robot_tags', ())
|
|
76
|
-
if not is_list_like(tags):
|
|
77
|
-
raise DataError(f"Expected tags to be list-like, got {type_name(tags)}.")
|
|
78
|
-
return tags
|
|
79
|
-
|
|
80
|
-
def _get_initial_handler(self, library, name, method):
|
|
81
|
-
if library.scope.is_global:
|
|
82
|
-
return self._get_global_handler(method, name)
|
|
83
|
-
return None
|
|
84
|
-
|
|
85
|
-
def resolve_arguments(self, args, variables=None, languages=None):
|
|
86
|
-
return self.arguments.resolve(args, variables, self.library.converters,
|
|
87
|
-
languages=languages)
|
|
88
|
-
|
|
89
|
-
@property
|
|
90
|
-
def doc(self):
|
|
91
|
-
return self._doc
|
|
92
|
-
|
|
93
|
-
@property
|
|
94
|
-
def longname(self):
|
|
95
|
-
return f'{self.library.name}.{self.name}'
|
|
96
|
-
|
|
97
|
-
@property
|
|
98
|
-
def shortdoc(self):
|
|
99
|
-
return getshortdoc(self.doc)
|
|
100
|
-
|
|
101
|
-
@property
|
|
102
|
-
def libname(self):
|
|
103
|
-
return self.library.name
|
|
104
|
-
|
|
105
|
-
@property
|
|
106
|
-
def source(self):
|
|
107
|
-
return self.library.source
|
|
108
|
-
|
|
109
|
-
@property
|
|
110
|
-
def lineno(self):
|
|
111
|
-
return -1
|
|
112
|
-
|
|
113
|
-
def create_runner(self, name, languages=None):
|
|
114
|
-
return LibraryKeywordRunner(self, languages=languages)
|
|
115
|
-
|
|
116
|
-
def current_handler(self):
|
|
117
|
-
if self._method:
|
|
118
|
-
return self._method
|
|
119
|
-
return self._get_handler(self.library.get_instance(), self._handler_name)
|
|
120
|
-
|
|
121
|
-
def _get_global_handler(self, method, name):
|
|
122
|
-
return method
|
|
123
|
-
|
|
124
|
-
def _get_handler(self, lib_instance, handler_name):
|
|
125
|
-
try:
|
|
126
|
-
return getattr(lib_instance, handler_name)
|
|
127
|
-
except AttributeError:
|
|
128
|
-
# Occurs with old-style classes.
|
|
129
|
-
if handler_name == '__init__':
|
|
130
|
-
return None
|
|
131
|
-
raise
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
class _PythonHandler(_RunnableHandler):
|
|
135
|
-
|
|
136
|
-
def __init__(self, library, handler_name, handler_method):
|
|
137
|
-
super().__init__(library, handler_name, handler_method, getdoc(handler_method))
|
|
138
|
-
|
|
139
|
-
def _parse_arguments(self, handler_method):
|
|
140
|
-
return PythonArgumentParser().parse(handler_method, self.longname)
|
|
141
|
-
|
|
142
|
-
@property
|
|
143
|
-
def source(self):
|
|
144
|
-
handler = self.current_handler()
|
|
145
|
-
# `getsourcefile` can return None and raise TypeError.
|
|
146
|
-
try:
|
|
147
|
-
source = inspect.getsourcefile(inspect.unwrap(handler))
|
|
148
|
-
except TypeError:
|
|
149
|
-
source = None
|
|
150
|
-
return normpath(source) if source else self.library.source
|
|
151
|
-
|
|
152
|
-
@property
|
|
153
|
-
def lineno(self):
|
|
154
|
-
handler = self.current_handler()
|
|
155
|
-
try:
|
|
156
|
-
lines, start_lineno = inspect.getsourcelines(inspect.unwrap(handler))
|
|
157
|
-
except (TypeError, OSError, IOError):
|
|
158
|
-
return -1
|
|
159
|
-
for increment, line in enumerate(lines):
|
|
160
|
-
if line.strip().startswith('def '):
|
|
161
|
-
return start_lineno + increment
|
|
162
|
-
return start_lineno
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
class _DynamicHandler(_RunnableHandler):
|
|
166
|
-
|
|
167
|
-
def __init__(self, library, handler_name, dynamic_method, doc='', argspec=None,
|
|
168
|
-
tags=None):
|
|
169
|
-
self._argspec = argspec
|
|
170
|
-
self._run_keyword_method_name = dynamic_method.name
|
|
171
|
-
self._supports_kwargs = dynamic_method.supports_kwargs
|
|
172
|
-
# Cannot use super() here due to multi-inheritance in _DynamicRunKeywordHandler
|
|
173
|
-
_RunnableHandler.__init__(self, library, handler_name, dynamic_method.method,
|
|
174
|
-
doc, tags)
|
|
175
|
-
self._source_info = None
|
|
176
|
-
|
|
177
|
-
def _parse_arguments(self, handler_method):
|
|
178
|
-
spec = DynamicArgumentParser().parse(self._argspec, self.longname)
|
|
179
|
-
if not self._supports_kwargs:
|
|
180
|
-
name = self._run_keyword_method_name
|
|
181
|
-
if spec.var_named:
|
|
182
|
-
raise DataError(f"Too few '{name}' method parameters for "
|
|
183
|
-
f"**kwargs support.")
|
|
184
|
-
if spec.named_only:
|
|
185
|
-
raise DataError(f"Too few '{name}' method parameters for "
|
|
186
|
-
f"keyword-only arguments support.")
|
|
187
|
-
get_keyword_types = GetKeywordTypes(self.library.get_instance())
|
|
188
|
-
spec.types = get_keyword_types(self._handler_name)
|
|
189
|
-
return spec
|
|
190
|
-
|
|
191
|
-
@property
|
|
192
|
-
def source(self):
|
|
193
|
-
if self._source_info is None:
|
|
194
|
-
self._source_info = self._get_source_info()
|
|
195
|
-
return self._source_info[0]
|
|
196
|
-
|
|
197
|
-
def _get_source_info(self):
|
|
198
|
-
get_keyword_source = GetKeywordSource(self.library.get_instance())
|
|
199
|
-
try:
|
|
200
|
-
source = get_keyword_source(self._handler_name)
|
|
201
|
-
except DataError as err:
|
|
202
|
-
self.library.report_error(
|
|
203
|
-
f"Getting source information for keyword '{self.name}' failed: {err}",
|
|
204
|
-
err.details
|
|
205
|
-
)
|
|
206
|
-
source = None
|
|
207
|
-
if source and ':' in source and source.rsplit(':', 1)[1].isdigit():
|
|
208
|
-
source, lineno = source.rsplit(':', 1)
|
|
209
|
-
lineno = int(lineno)
|
|
210
|
-
else:
|
|
211
|
-
lineno = -1
|
|
212
|
-
return normpath(source) if source else self.library.source, lineno
|
|
213
|
-
|
|
214
|
-
@property
|
|
215
|
-
def lineno(self):
|
|
216
|
-
if self._source_info is None:
|
|
217
|
-
self._source_info = self._get_source_info()
|
|
218
|
-
return self._source_info[1]
|
|
219
|
-
|
|
220
|
-
def resolve_arguments(self, arguments, variables=None, languages=None):
|
|
221
|
-
positional, named = super().resolve_arguments(arguments, variables, languages)
|
|
222
|
-
if not self._supports_kwargs:
|
|
223
|
-
positional, named = self.arguments.map(positional, named)
|
|
224
|
-
return positional, named
|
|
225
|
-
|
|
226
|
-
def _get_handler(self, lib_instance, handler_name):
|
|
227
|
-
runner = getattr(lib_instance, self._run_keyword_method_name)
|
|
228
|
-
return self._get_dynamic_handler(runner, handler_name)
|
|
229
|
-
|
|
230
|
-
def _get_global_handler(self, method, name):
|
|
231
|
-
return self._get_dynamic_handler(method, name)
|
|
232
|
-
|
|
233
|
-
def _get_dynamic_handler(self, runner, name):
|
|
234
|
-
def handler(*positional, **kwargs):
|
|
235
|
-
if self._supports_kwargs:
|
|
236
|
-
return runner(name, positional, kwargs)
|
|
237
|
-
else:
|
|
238
|
-
return runner(name, positional)
|
|
239
|
-
return handler
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
class _RunKeywordHandler(_PythonHandler):
|
|
243
|
-
|
|
244
|
-
def create_runner(self, name, languages=None):
|
|
245
|
-
dry_run = RUN_KW_REGISTER.get_dry_run(self.library.orig_name, self.name)
|
|
246
|
-
return RunKeywordRunner(self, execute_in_dry_run=dry_run)
|
|
247
|
-
|
|
248
|
-
@property
|
|
249
|
-
def _args_to_process(self):
|
|
250
|
-
return RUN_KW_REGISTER.get_args_to_process(self.library.orig_name, self.name)
|
|
251
|
-
|
|
252
|
-
def resolve_arguments(self, args, variables=None, languages=None):
|
|
253
|
-
return self.arguments.resolve(args, variables, self.library.converters,
|
|
254
|
-
resolve_named=False,
|
|
255
|
-
resolve_variables_until=self._args_to_process)
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
class _DynamicRunKeywordHandler(_DynamicHandler, _RunKeywordHandler):
|
|
259
|
-
_parse_arguments = _RunKeywordHandler._parse_arguments
|
|
260
|
-
resolve_arguments = _RunKeywordHandler.resolve_arguments
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
class _PythonInitHandler(_PythonHandler):
|
|
264
|
-
|
|
265
|
-
def __init__(self, library, handler_name, handler_method, docgetter):
|
|
266
|
-
super().__init__(library, handler_name, handler_method)
|
|
267
|
-
self._docgetter = docgetter
|
|
268
|
-
|
|
269
|
-
def _get_name(self, handler_name, handler_method):
|
|
270
|
-
return '__init__'
|
|
271
|
-
|
|
272
|
-
@property
|
|
273
|
-
def doc(self):
|
|
274
|
-
if self._docgetter:
|
|
275
|
-
self._doc = self._docgetter() or self._doc
|
|
276
|
-
self._docgetter = None
|
|
277
|
-
return self._doc
|
|
278
|
-
|
|
279
|
-
def _parse_arguments(self, init_method):
|
|
280
|
-
parser = PythonArgumentParser(type='Library')
|
|
281
|
-
return parser.parse(init_method or (lambda: None), self.library.name)
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
class EmbeddedArgumentsHandler:
|
|
285
|
-
supports_embedded_args = True
|
|
286
|
-
|
|
287
|
-
def __init__(self, embedded, orig_handler):
|
|
288
|
-
self.arguments = ArgumentSpec() # Show empty argument spec for Libdoc
|
|
289
|
-
self.embedded = embedded
|
|
290
|
-
self._orig_handler = orig_handler
|
|
291
|
-
|
|
292
|
-
def __getattr__(self, item):
|
|
293
|
-
return getattr(self._orig_handler, item)
|
|
294
|
-
|
|
295
|
-
@property
|
|
296
|
-
def library(self):
|
|
297
|
-
return self._orig_handler.library
|
|
298
|
-
|
|
299
|
-
@library.setter
|
|
300
|
-
def library(self, library):
|
|
301
|
-
self._orig_handler.library = library
|
|
302
|
-
|
|
303
|
-
def matches(self, name):
|
|
304
|
-
return self.embedded.match(name) is not None
|
|
305
|
-
|
|
306
|
-
def create_runner(self, name, languages=None):
|
|
307
|
-
return EmbeddedArgumentsRunner(self, name)
|
|
308
|
-
|
|
309
|
-
def resolve_arguments(self, args, variables=None, languages=None):
|
|
310
|
-
argspec = self._orig_handler.arguments
|
|
311
|
-
if variables:
|
|
312
|
-
if argspec.var_positional:
|
|
313
|
-
args = variables.replace_list(args)
|
|
314
|
-
else:
|
|
315
|
-
args = [variables.replace_scalar(a) for a in args]
|
|
316
|
-
self.embedded.validate(args)
|
|
317
|
-
return argspec.convert(args, named={}, converters=self.library.converters,
|
|
318
|
-
dry_run=not variables)
|
|
319
|
-
|
|
320
|
-
def __copy__(self):
|
|
321
|
-
return EmbeddedArgumentsHandler(self.embedded, copy(self._orig_handler))
|
|
@@ -1,66 +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 itertools import chain
|
|
17
|
-
|
|
18
|
-
from robot.errors import DataError
|
|
19
|
-
from robot.utils import NormalizedDict, seq2str
|
|
20
|
-
|
|
21
|
-
from .usererrorhandler import UserErrorHandler
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class HandlerStore:
|
|
25
|
-
|
|
26
|
-
def __init__(self):
|
|
27
|
-
self._normal = NormalizedDict(ignore='_')
|
|
28
|
-
self._embedded = []
|
|
29
|
-
|
|
30
|
-
def add(self, handler, embedded=False):
|
|
31
|
-
if embedded:
|
|
32
|
-
self._embedded.append(handler)
|
|
33
|
-
elif handler.name not in self._normal:
|
|
34
|
-
self._normal[handler.name] = handler
|
|
35
|
-
else:
|
|
36
|
-
error = DataError('Keyword with same name defined multiple times.')
|
|
37
|
-
self._normal[handler.name] = UserErrorHandler(error, handler.name,
|
|
38
|
-
handler.libname)
|
|
39
|
-
raise error
|
|
40
|
-
|
|
41
|
-
def __iter__(self):
|
|
42
|
-
return chain(self._normal.values(), self._embedded)
|
|
43
|
-
|
|
44
|
-
def __len__(self):
|
|
45
|
-
return len(self._normal) + len(self._embedded)
|
|
46
|
-
|
|
47
|
-
def __contains__(self, name):
|
|
48
|
-
if name in self._normal:
|
|
49
|
-
return True
|
|
50
|
-
if not self._embedded:
|
|
51
|
-
return False
|
|
52
|
-
return any(template.matches(name) for template in self._embedded)
|
|
53
|
-
|
|
54
|
-
def __getitem__(self, name):
|
|
55
|
-
handlers = self.get_handlers(name)
|
|
56
|
-
if len(handlers) == 1:
|
|
57
|
-
return handlers[0]
|
|
58
|
-
if not handlers:
|
|
59
|
-
raise ValueError(f"No handler with name '{name}' found.")
|
|
60
|
-
names = seq2str([handler.name for handler in handlers])
|
|
61
|
-
raise ValueError(f"Multiple handlers matching name '{name}' found: {names}")
|
|
62
|
-
|
|
63
|
-
def get_handlers(self, name):
|
|
64
|
-
if name in self._normal:
|
|
65
|
-
return [self._normal[name]]
|
|
66
|
-
return [template for template in self._embedded if template.matches(name)]
|
|
@@ -1,238 +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.errors import DataError
|
|
17
|
-
from robot.output import LOGGER
|
|
18
|
-
from robot.result import Keyword as KeywordResult
|
|
19
|
-
from robot.utils import prepr, safe_str
|
|
20
|
-
from robot.variables import contains_variable, is_list_variable, VariableAssignment
|
|
21
|
-
|
|
22
|
-
from .bodyrunner import BodyRunner
|
|
23
|
-
from .model import Keyword
|
|
24
|
-
from .outputcapture import OutputCapturer
|
|
25
|
-
from .signalhandler import STOP_SIGNAL_MONITOR
|
|
26
|
-
from .statusreporter import StatusReporter
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class LibraryKeywordRunner:
|
|
30
|
-
|
|
31
|
-
def __init__(self, handler, name=None, languages=None):
|
|
32
|
-
self._handler = handler
|
|
33
|
-
self.name = name or handler.name
|
|
34
|
-
self.pre_run_messages = ()
|
|
35
|
-
self.languages = languages
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def library(self):
|
|
39
|
-
return self._handler.library
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
def libname(self):
|
|
43
|
-
return self._handler.library.name
|
|
44
|
-
|
|
45
|
-
@property
|
|
46
|
-
def longname(self):
|
|
47
|
-
return '%s.%s' % (self.library.name, self.name)
|
|
48
|
-
|
|
49
|
-
def run(self, kw, context, run=True):
|
|
50
|
-
assignment = VariableAssignment(kw.assign)
|
|
51
|
-
result = self._get_result(kw, assignment)
|
|
52
|
-
with StatusReporter(kw, result, context, run):
|
|
53
|
-
if run:
|
|
54
|
-
with assignment.assigner(context) as assigner:
|
|
55
|
-
return_value = self._run(context, kw.args)
|
|
56
|
-
assigner.assign(return_value)
|
|
57
|
-
return return_value
|
|
58
|
-
|
|
59
|
-
def _get_result(self, kw, assignment):
|
|
60
|
-
handler = self._handler
|
|
61
|
-
return KeywordResult(kwname=self.name,
|
|
62
|
-
libname=handler.libname,
|
|
63
|
-
doc=handler.shortdoc,
|
|
64
|
-
args=kw.args,
|
|
65
|
-
assign=tuple(assignment),
|
|
66
|
-
tags=handler.tags,
|
|
67
|
-
type=kw.type)
|
|
68
|
-
|
|
69
|
-
def _run(self, context, args):
|
|
70
|
-
if self.pre_run_messages:
|
|
71
|
-
for message in self.pre_run_messages:
|
|
72
|
-
context.output.message(message)
|
|
73
|
-
variables = context.variables if not context.dry_run else None
|
|
74
|
-
positional, named = self._handler.resolve_arguments(args, variables,
|
|
75
|
-
self.languages)
|
|
76
|
-
context.output.trace(lambda: self._trace_log_args(positional, named),
|
|
77
|
-
write_if_flat=False)
|
|
78
|
-
runner = self._runner_for(context, self._handler.current_handler(),
|
|
79
|
-
positional, dict(named))
|
|
80
|
-
return self._run_with_output_captured_and_signal_monitor(runner, context)
|
|
81
|
-
|
|
82
|
-
def _trace_log_args(self, positional, named):
|
|
83
|
-
args = [prepr(arg) for arg in positional]
|
|
84
|
-
args += ['%s=%s' % (safe_str(n), prepr(v)) for n, v in named]
|
|
85
|
-
return 'Arguments: [ %s ]' % ' | '.join(args)
|
|
86
|
-
|
|
87
|
-
def _runner_for(self, context, handler, positional, named):
|
|
88
|
-
timeout = self._get_timeout(context)
|
|
89
|
-
if timeout and timeout.active:
|
|
90
|
-
def runner():
|
|
91
|
-
with LOGGER.delayed_logging:
|
|
92
|
-
context.output.debug(timeout.get_message)
|
|
93
|
-
return timeout.run(handler, args=positional, kwargs=named)
|
|
94
|
-
return runner
|
|
95
|
-
return lambda: handler(*positional, **named)
|
|
96
|
-
|
|
97
|
-
def _get_timeout(self, context):
|
|
98
|
-
return min(context.timeouts) if context.timeouts else None
|
|
99
|
-
|
|
100
|
-
def _run_with_output_captured_and_signal_monitor(self, runner, context):
|
|
101
|
-
with OutputCapturer():
|
|
102
|
-
return self._run_with_signal_monitoring(runner, context)
|
|
103
|
-
|
|
104
|
-
def _run_with_signal_monitoring(self, runner, context):
|
|
105
|
-
try:
|
|
106
|
-
STOP_SIGNAL_MONITOR.start_running_keyword(context.in_teardown)
|
|
107
|
-
runner_result = runner()
|
|
108
|
-
if context.asynchronous.is_loop_required(runner_result):
|
|
109
|
-
return context.asynchronous.run_until_complete(runner_result)
|
|
110
|
-
return runner_result
|
|
111
|
-
finally:
|
|
112
|
-
STOP_SIGNAL_MONITOR.stop_running_keyword()
|
|
113
|
-
|
|
114
|
-
def dry_run(self, kw, context):
|
|
115
|
-
assignment = VariableAssignment(kw.assign)
|
|
116
|
-
result = self._get_result(kw, assignment)
|
|
117
|
-
with StatusReporter(kw, result, context, run=False):
|
|
118
|
-
assignment.validate_assignment()
|
|
119
|
-
self._dry_run(context, kw.args)
|
|
120
|
-
|
|
121
|
-
def _dry_run(self, context, args):
|
|
122
|
-
if self._executed_in_dry_run(self._handler):
|
|
123
|
-
self._run(context, args)
|
|
124
|
-
else:
|
|
125
|
-
self._handler.resolve_arguments(args, languages=self.languages)
|
|
126
|
-
|
|
127
|
-
def _executed_in_dry_run(self, handler):
|
|
128
|
-
keywords_to_execute = ('BuiltIn.Import Library',
|
|
129
|
-
'BuiltIn.Set Library Search Order',
|
|
130
|
-
'BuiltIn.Set Tags',
|
|
131
|
-
'BuiltIn.Remove Tags')
|
|
132
|
-
return (handler.libname == 'Reserved' or
|
|
133
|
-
handler.longname in keywords_to_execute)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
class EmbeddedArgumentsRunner(LibraryKeywordRunner):
|
|
137
|
-
|
|
138
|
-
def __init__(self, handler, name):
|
|
139
|
-
super().__init__(handler, name)
|
|
140
|
-
self.embedded_args = handler.embedded.match(name).groups()
|
|
141
|
-
|
|
142
|
-
def _run(self, context, args):
|
|
143
|
-
if args:
|
|
144
|
-
raise DataError("Positional arguments are not allowed when using "
|
|
145
|
-
"embedded arguments.")
|
|
146
|
-
return super()._run(context, self.embedded_args)
|
|
147
|
-
|
|
148
|
-
def _dry_run(self, context, args):
|
|
149
|
-
return super()._dry_run(context, self.embedded_args)
|
|
150
|
-
|
|
151
|
-
def _get_result(self, kw, assignment):
|
|
152
|
-
result = super()._get_result(kw, assignment)
|
|
153
|
-
result.sourcename = self._handler.name
|
|
154
|
-
return result
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
class RunKeywordRunner(LibraryKeywordRunner):
|
|
158
|
-
|
|
159
|
-
def __init__(self, handler, execute_in_dry_run=False):
|
|
160
|
-
super().__init__(handler)
|
|
161
|
-
self.execute_in_dry_run = execute_in_dry_run
|
|
162
|
-
|
|
163
|
-
def _get_timeout(self, context):
|
|
164
|
-
# These keywords are not affected by timeouts. Keywords they execute are.
|
|
165
|
-
return None
|
|
166
|
-
|
|
167
|
-
def _run_with_output_captured_and_signal_monitor(self, runner, context):
|
|
168
|
-
return self._run_with_signal_monitoring(runner, context)
|
|
169
|
-
|
|
170
|
-
def _dry_run(self, context, args):
|
|
171
|
-
super()._dry_run(context, args)
|
|
172
|
-
keywords = [kw for kw in self._get_dry_run_keywords(args)
|
|
173
|
-
if not contains_variable(kw.name)]
|
|
174
|
-
BodyRunner(context).run(keywords)
|
|
175
|
-
|
|
176
|
-
def _get_dry_run_keywords(self, args):
|
|
177
|
-
if not self.execute_in_dry_run:
|
|
178
|
-
return []
|
|
179
|
-
name = self._handler.name
|
|
180
|
-
if name == 'Run Keyword If':
|
|
181
|
-
return self._get_dry_run_keywords_for_run_keyword_if(args)
|
|
182
|
-
if name == 'Run Keywords':
|
|
183
|
-
return self._get_dry_run_keywords_for_run_keyword(args)
|
|
184
|
-
return self._get_dry_run_keywords_based_on_name_argument(args)
|
|
185
|
-
|
|
186
|
-
def _get_dry_run_keywords_for_run_keyword_if(self, given_args):
|
|
187
|
-
for kw_call in self._get_run_kw_if_calls(given_args):
|
|
188
|
-
if kw_call:
|
|
189
|
-
yield Keyword(name=kw_call[0], args=kw_call[1:])
|
|
190
|
-
|
|
191
|
-
def _get_run_kw_if_calls(self, given_args):
|
|
192
|
-
while 'ELSE IF' in given_args:
|
|
193
|
-
kw_call, given_args = self._split_run_kw_if_args(given_args, 'ELSE IF', 2)
|
|
194
|
-
yield kw_call
|
|
195
|
-
if 'ELSE' in given_args:
|
|
196
|
-
kw_call, else_call = self._split_run_kw_if_args(given_args, 'ELSE', 1)
|
|
197
|
-
yield kw_call
|
|
198
|
-
yield else_call
|
|
199
|
-
elif self._validate_kw_call(given_args):
|
|
200
|
-
expr, kw_call = given_args[0], given_args[1:]
|
|
201
|
-
if not is_list_variable(expr):
|
|
202
|
-
yield kw_call
|
|
203
|
-
|
|
204
|
-
def _split_run_kw_if_args(self, given_args, control_word, required_after):
|
|
205
|
-
index = list(given_args).index(control_word)
|
|
206
|
-
expr_and_call = given_args[:index]
|
|
207
|
-
remaining = given_args[index+1:]
|
|
208
|
-
if not (self._validate_kw_call(expr_and_call) and
|
|
209
|
-
self._validate_kw_call(remaining, required_after)):
|
|
210
|
-
raise DataError("Invalid 'Run Keyword If' usage.")
|
|
211
|
-
if is_list_variable(expr_and_call[0]):
|
|
212
|
-
return (), remaining
|
|
213
|
-
return expr_and_call[1:], remaining
|
|
214
|
-
|
|
215
|
-
def _validate_kw_call(self, kw_call, min_length=2):
|
|
216
|
-
if len(kw_call) >= min_length:
|
|
217
|
-
return True
|
|
218
|
-
return any(is_list_variable(item) for item in kw_call)
|
|
219
|
-
|
|
220
|
-
def _get_dry_run_keywords_for_run_keyword(self, given_args):
|
|
221
|
-
for kw_call in self._get_run_kws_calls(given_args):
|
|
222
|
-
yield Keyword(name=kw_call[0], args=kw_call[1:])
|
|
223
|
-
|
|
224
|
-
def _get_run_kws_calls(self, given_args):
|
|
225
|
-
if 'AND' not in given_args:
|
|
226
|
-
for kw_call in given_args:
|
|
227
|
-
yield [kw_call,]
|
|
228
|
-
else:
|
|
229
|
-
while 'AND' in given_args:
|
|
230
|
-
index = list(given_args).index('AND')
|
|
231
|
-
kw_call, given_args = given_args[:index], given_args[index + 1:]
|
|
232
|
-
yield kw_call
|
|
233
|
-
if given_args:
|
|
234
|
-
yield given_args
|
|
235
|
-
|
|
236
|
-
def _get_dry_run_keywords_based_on_name_argument(self, given_args):
|
|
237
|
-
index = list(self._handler.arguments.positional).index('name')
|
|
238
|
-
return [Keyword(name=given_args[index], args=given_args[index+1:])]
|