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,79 +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.variables import contains_variable
|
|
17
|
-
|
|
18
|
-
from .typeconverters import TypeConverter
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class ArgumentConverter:
|
|
22
|
-
|
|
23
|
-
def __init__(self, argspec, converters, dry_run=False, languages=None):
|
|
24
|
-
""":type argspec: :py:class:`robot.running.arguments.ArgumentSpec`"""
|
|
25
|
-
self._argspec = argspec
|
|
26
|
-
self._converters = converters
|
|
27
|
-
self._dry_run = dry_run
|
|
28
|
-
self._languages = languages
|
|
29
|
-
|
|
30
|
-
def convert(self, positional, named):
|
|
31
|
-
return self._convert_positional(positional), self._convert_named(named)
|
|
32
|
-
|
|
33
|
-
def _convert_positional(self, positional):
|
|
34
|
-
names = self._argspec.positional
|
|
35
|
-
converted = [self._convert(name, value)
|
|
36
|
-
for name, value in zip(names, positional)]
|
|
37
|
-
if self._argspec.var_positional:
|
|
38
|
-
converted.extend(self._convert(self._argspec.var_positional, value)
|
|
39
|
-
for value in positional[len(names):])
|
|
40
|
-
return converted
|
|
41
|
-
|
|
42
|
-
def _convert_named(self, named):
|
|
43
|
-
names = set(self._argspec.positional) | set(self._argspec.named_only)
|
|
44
|
-
var_named = self._argspec.var_named
|
|
45
|
-
return [(name, self._convert(name if name in names else var_named, value))
|
|
46
|
-
for name, value in named]
|
|
47
|
-
|
|
48
|
-
def _convert(self, name, value):
|
|
49
|
-
spec = self._argspec
|
|
50
|
-
if (spec.types is None
|
|
51
|
-
or self._dry_run and contains_variable(value, identifiers='$@&%')):
|
|
52
|
-
return value
|
|
53
|
-
conversion_error = None
|
|
54
|
-
# Don't convert None if argument has None as a default value.
|
|
55
|
-
# Python < 3.11 adds None to type hints automatically when using None as
|
|
56
|
-
# a default value which preserves None automatically. This code keeps
|
|
57
|
-
# the same behavior also with newer Python versions.
|
|
58
|
-
if value is None and name in spec.defaults and spec.defaults[name] is None:
|
|
59
|
-
return value
|
|
60
|
-
if name in spec.types:
|
|
61
|
-
converter = TypeConverter.converter_for(spec.types[name], self._converters,
|
|
62
|
-
self._languages)
|
|
63
|
-
if converter:
|
|
64
|
-
try:
|
|
65
|
-
return converter.convert(name, value)
|
|
66
|
-
except ValueError as err:
|
|
67
|
-
conversion_error = err
|
|
68
|
-
if name in spec.defaults:
|
|
69
|
-
converter = TypeConverter.converter_for(type(spec.defaults[name]),
|
|
70
|
-
languages=self._languages)
|
|
71
|
-
if converter:
|
|
72
|
-
try:
|
|
73
|
-
return converter.convert(name, value, explicit_type=False,
|
|
74
|
-
strict=bool(conversion_error))
|
|
75
|
-
except ValueError as err:
|
|
76
|
-
conversion_error = conversion_error or err
|
|
77
|
-
if conversion_error:
|
|
78
|
-
raise conversion_error
|
|
79
|
-
return value
|
|
@@ -1,131 +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.utils import is_string, is_dict_like, split_from_equals
|
|
18
|
-
from robot.variables import is_dict_variable
|
|
19
|
-
|
|
20
|
-
from .argumentvalidator import ArgumentValidator
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class ArgumentResolver:
|
|
24
|
-
|
|
25
|
-
def __init__(self, argspec, resolve_named=True,
|
|
26
|
-
resolve_variables_until=None, dict_to_kwargs=False):
|
|
27
|
-
self._named_resolver = NamedArgumentResolver(argspec) \
|
|
28
|
-
if resolve_named else NullNamedArgumentResolver()
|
|
29
|
-
self._variable_replacer = VariableReplacer(resolve_variables_until)
|
|
30
|
-
self._dict_to_kwargs = DictToKwargs(argspec, dict_to_kwargs)
|
|
31
|
-
self._argument_validator = ArgumentValidator(argspec)
|
|
32
|
-
|
|
33
|
-
def resolve(self, arguments, variables=None):
|
|
34
|
-
positional, named = self._named_resolver.resolve(arguments, variables)
|
|
35
|
-
positional, named = self._variable_replacer.replace(positional, named, variables)
|
|
36
|
-
positional, named = self._dict_to_kwargs.handle(positional, named)
|
|
37
|
-
self._argument_validator.validate(positional, named,
|
|
38
|
-
dryrun=variables is None)
|
|
39
|
-
return positional, named
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class NamedArgumentResolver:
|
|
43
|
-
|
|
44
|
-
def __init__(self, argspec):
|
|
45
|
-
""":type argspec: :py:class:`robot.running.arguments.ArgumentSpec`"""
|
|
46
|
-
self._argspec = argspec
|
|
47
|
-
|
|
48
|
-
def resolve(self, arguments, variables=None):
|
|
49
|
-
positional = []
|
|
50
|
-
named = []
|
|
51
|
-
for arg in arguments:
|
|
52
|
-
if is_dict_variable(arg):
|
|
53
|
-
named.append(arg)
|
|
54
|
-
elif self._is_named(arg, named, variables):
|
|
55
|
-
named.append(split_from_equals(arg))
|
|
56
|
-
elif named:
|
|
57
|
-
self._raise_positional_after_named()
|
|
58
|
-
else:
|
|
59
|
-
positional.append(arg)
|
|
60
|
-
return positional, named
|
|
61
|
-
|
|
62
|
-
def _is_named(self, arg, previous_named, variables=None):
|
|
63
|
-
name, value = split_from_equals(arg)
|
|
64
|
-
if value is None:
|
|
65
|
-
return False
|
|
66
|
-
if variables:
|
|
67
|
-
try:
|
|
68
|
-
name = variables.replace_scalar(name)
|
|
69
|
-
except DataError:
|
|
70
|
-
return False
|
|
71
|
-
spec = self._argspec
|
|
72
|
-
return bool(previous_named or
|
|
73
|
-
spec.var_named or
|
|
74
|
-
name in spec.positional_or_named or
|
|
75
|
-
name in spec.named_only)
|
|
76
|
-
|
|
77
|
-
def _raise_positional_after_named(self):
|
|
78
|
-
raise DataError("%s '%s' got positional argument after named arguments."
|
|
79
|
-
% (self._argspec.type.capitalize(), self._argspec.name))
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
class NullNamedArgumentResolver:
|
|
83
|
-
|
|
84
|
-
def resolve(self, arguments, variables=None):
|
|
85
|
-
return arguments, {}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class DictToKwargs:
|
|
89
|
-
|
|
90
|
-
def __init__(self, argspec, enabled=False):
|
|
91
|
-
self._maxargs = argspec.maxargs
|
|
92
|
-
self._enabled = enabled and bool(argspec.var_named)
|
|
93
|
-
|
|
94
|
-
def handle(self, positional, named):
|
|
95
|
-
if self._enabled and self._extra_arg_has_kwargs(positional, named):
|
|
96
|
-
named = positional.pop().items()
|
|
97
|
-
return positional, named
|
|
98
|
-
|
|
99
|
-
def _extra_arg_has_kwargs(self, positional, named):
|
|
100
|
-
if named or len(positional) != self._maxargs + 1:
|
|
101
|
-
return False
|
|
102
|
-
return is_dict_like(positional[-1])
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class VariableReplacer:
|
|
106
|
-
|
|
107
|
-
def __init__(self, resolve_until=None):
|
|
108
|
-
self._resolve_until = resolve_until
|
|
109
|
-
|
|
110
|
-
def replace(self, positional, named, variables=None):
|
|
111
|
-
# `variables` is None in dry-run mode and when using Libdoc.
|
|
112
|
-
if variables:
|
|
113
|
-
positional = variables.replace_list(positional, self._resolve_until)
|
|
114
|
-
named = list(self._replace_named(named, variables.replace_scalar))
|
|
115
|
-
else:
|
|
116
|
-
# If `var` isn't a tuple, it's a &{dict} variables.
|
|
117
|
-
named = [var if isinstance(var, tuple) else (var, var) for var in named]
|
|
118
|
-
return positional, named
|
|
119
|
-
|
|
120
|
-
def _replace_named(self, named, replace_scalar):
|
|
121
|
-
for item in named:
|
|
122
|
-
for name, value in self._get_replaced_named(item, replace_scalar):
|
|
123
|
-
if not is_string(name):
|
|
124
|
-
raise DataError('Argument names must be strings.')
|
|
125
|
-
yield name, value
|
|
126
|
-
|
|
127
|
-
def _get_replaced_named(self, item, replace_scalar):
|
|
128
|
-
if not isinstance(item, tuple):
|
|
129
|
-
return replace_scalar(item).items()
|
|
130
|
-
name, value = item
|
|
131
|
-
return [(replace_scalar(name), replace_scalar(value))]
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# Copyright 2008-2015 Nokia Networks
|
|
2
|
-
# Copyright 2016- Robot Framework Foundation
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
import re
|
|
17
|
-
|
|
18
|
-
from robot.errors import DataError
|
|
19
|
-
from robot.utils import get_error_message, is_string
|
|
20
|
-
from robot.variables import VariableIterator
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
ENABLE_STRICT_ARGUMENT_VALIDATION = False
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class EmbeddedArguments:
|
|
27
|
-
|
|
28
|
-
def __init__(self, name=None, args=(), custom_patterns=None):
|
|
29
|
-
self.name = name
|
|
30
|
-
self.args = args
|
|
31
|
-
self.custom_patterns = custom_patterns
|
|
32
|
-
|
|
33
|
-
@classmethod
|
|
34
|
-
def from_name(cls, name):
|
|
35
|
-
return EmbeddedArgumentParser().parse(name) if '${' in name else cls()
|
|
36
|
-
|
|
37
|
-
def match(self, name):
|
|
38
|
-
return self.name.match(name)
|
|
39
|
-
|
|
40
|
-
def map(self, values):
|
|
41
|
-
self.validate(values)
|
|
42
|
-
return list(zip(self.args, values))
|
|
43
|
-
|
|
44
|
-
def validate(self, values):
|
|
45
|
-
# Validating that embedded args match custom regexps also if args are
|
|
46
|
-
# given as variables was initially implemented in RF 6.0. It needed
|
|
47
|
-
# to be reverted due to backwards incompatibility reasons but the plan
|
|
48
|
-
# is to enable it again in RF 7.0:
|
|
49
|
-
# https://github.com/robotframework/robotframework/issues/4069
|
|
50
|
-
#
|
|
51
|
-
# TODO: Emit deprecation warnings if patterns don't match in RF 6.1:
|
|
52
|
-
# https://github.com/robotframework/robotframework/issues/4524
|
|
53
|
-
#
|
|
54
|
-
# Because the plan is to add validation back, the code was not removed
|
|
55
|
-
# but the `ENABLE_STRICT_ARGUMENT_VALIDATION` guard was added instead.
|
|
56
|
-
# Enabling validation requires only removing the following two lines
|
|
57
|
-
# (along with this comment). If someone wants to enable strict validation
|
|
58
|
-
# already now, they set `ENABLE_STRICT_ARGUMENT_VALIDATION` to True
|
|
59
|
-
# before running tests.
|
|
60
|
-
if not ENABLE_STRICT_ARGUMENT_VALIDATION:
|
|
61
|
-
return
|
|
62
|
-
if not self.custom_patterns:
|
|
63
|
-
return
|
|
64
|
-
for arg, value in zip(self.args, values):
|
|
65
|
-
if arg in self.custom_patterns and is_string(value):
|
|
66
|
-
pattern = self.custom_patterns[arg]
|
|
67
|
-
if not re.fullmatch(pattern, value):
|
|
68
|
-
raise ValueError(f"Embedded argument '{arg}' got value '{value}' "
|
|
69
|
-
f"that does not match custom pattern '{pattern}'.")
|
|
70
|
-
|
|
71
|
-
def __bool__(self):
|
|
72
|
-
return self.name is not None
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
class EmbeddedArgumentParser:
|
|
76
|
-
_regexp_extension = re.compile(r'(?<!\\)\(\?.+\)')
|
|
77
|
-
_regexp_group_start = re.compile(r'(?<!\\)\((.*?)\)')
|
|
78
|
-
_escaped_curly = re.compile(r'(\\+)([{}])')
|
|
79
|
-
_regexp_group_escape = r'(?:\1)'
|
|
80
|
-
_default_pattern = '.*?'
|
|
81
|
-
_variable_pattern = r'\$\{[^\}]+\}'
|
|
82
|
-
|
|
83
|
-
def parse(self, string):
|
|
84
|
-
args = []
|
|
85
|
-
custom_patterns = {}
|
|
86
|
-
name_regexp = ['^']
|
|
87
|
-
for before, variable, string in VariableIterator(string, identifiers='$'):
|
|
88
|
-
name, pattern, custom = self._get_name_and_pattern(variable[2:-1])
|
|
89
|
-
args.append(name)
|
|
90
|
-
if custom:
|
|
91
|
-
custom_patterns[name] = pattern
|
|
92
|
-
pattern = self._format_custom_regexp(pattern)
|
|
93
|
-
name_regexp.extend([re.escape(before), f'({pattern})'])
|
|
94
|
-
name_regexp.extend([re.escape(string), '$'])
|
|
95
|
-
name = self._compile_regexp(name_regexp) if args else None
|
|
96
|
-
return EmbeddedArguments(name, args, custom_patterns or None)
|
|
97
|
-
|
|
98
|
-
def _get_name_and_pattern(self, name):
|
|
99
|
-
if ':' in name:
|
|
100
|
-
name, pattern = name.split(':', 1)
|
|
101
|
-
custom = True
|
|
102
|
-
else:
|
|
103
|
-
pattern = self._default_pattern
|
|
104
|
-
custom = False
|
|
105
|
-
return name, pattern, custom
|
|
106
|
-
|
|
107
|
-
def _format_custom_regexp(self, pattern):
|
|
108
|
-
for formatter in (self._regexp_extensions_are_not_allowed,
|
|
109
|
-
self._make_groups_non_capturing,
|
|
110
|
-
self._unescape_curly_braces,
|
|
111
|
-
self._escape_escapes,
|
|
112
|
-
self._add_automatic_variable_pattern):
|
|
113
|
-
pattern = formatter(pattern)
|
|
114
|
-
return pattern
|
|
115
|
-
|
|
116
|
-
def _regexp_extensions_are_not_allowed(self, pattern):
|
|
117
|
-
if self._regexp_extension.search(pattern):
|
|
118
|
-
raise DataError('Regexp extensions are not allowed in embedded arguments.')
|
|
119
|
-
return pattern
|
|
120
|
-
|
|
121
|
-
def _make_groups_non_capturing(self, pattern):
|
|
122
|
-
return self._regexp_group_start.sub(self._regexp_group_escape, pattern)
|
|
123
|
-
|
|
124
|
-
def _unescape_curly_braces(self, pattern):
|
|
125
|
-
# Users must escape possible lone curly braces in patters (e.g. `${x:\{}`)
|
|
126
|
-
# or otherwise the variable syntax is invalid.
|
|
127
|
-
def unescape(match):
|
|
128
|
-
backslashes = len(match.group(1))
|
|
129
|
-
return '\\' * (backslashes // 2 * 2) + match.group(2)
|
|
130
|
-
return self._escaped_curly.sub(unescape, pattern)
|
|
131
|
-
|
|
132
|
-
def _escape_escapes(self, pattern):
|
|
133
|
-
# When keywords are matched, embedded arguments have not yet been
|
|
134
|
-
# resolved which means possible escapes are still doubled. We thus
|
|
135
|
-
# need to double them in the pattern as well.
|
|
136
|
-
return pattern.replace(r'\\', r'\\\\')
|
|
137
|
-
|
|
138
|
-
def _add_automatic_variable_pattern(self, pattern):
|
|
139
|
-
return f'{pattern}|{self._variable_pattern}'
|
|
140
|
-
|
|
141
|
-
def _compile_regexp(self, pattern):
|
|
142
|
-
try:
|
|
143
|
-
return re.compile(''.join(pattern), re.IGNORECASE)
|
|
144
|
-
except Exception:
|
|
145
|
-
raise DataError("Compiling embedded arguments regexp failed: %s"
|
|
146
|
-
% get_error_message())
|
|
@@ -1,56 +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.utils import (is_dict_like, is_list_like, plural_or_not as s,
|
|
18
|
-
seq2str, type_name)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class TypeValidator:
|
|
22
|
-
|
|
23
|
-
def __init__(self, argspec):
|
|
24
|
-
""":type argspec: :py:class:`robot.running.arguments.ArgumentSpec`"""
|
|
25
|
-
self._argspec = argspec
|
|
26
|
-
|
|
27
|
-
def validate(self, types):
|
|
28
|
-
if types is None:
|
|
29
|
-
return None
|
|
30
|
-
if not types:
|
|
31
|
-
return {}
|
|
32
|
-
if is_dict_like(types):
|
|
33
|
-
return self.validate_type_dict(types)
|
|
34
|
-
if is_list_like(types):
|
|
35
|
-
return self.convert_type_list_to_dict(types)
|
|
36
|
-
raise DataError('Type information must be given as a dictionary or '
|
|
37
|
-
'a list, got %s.' % type_name(types))
|
|
38
|
-
|
|
39
|
-
def validate_type_dict(self, types):
|
|
40
|
-
# 'return' isn't used for anything yet but it may be shown by Libdoc
|
|
41
|
-
# in the future. Trying to be forward compatible.
|
|
42
|
-
names = set(self._argspec.argument_names + ['return'])
|
|
43
|
-
extra = [t for t in types if t not in names]
|
|
44
|
-
if extra:
|
|
45
|
-
raise DataError('Type information given to non-existing '
|
|
46
|
-
'argument%s %s.'
|
|
47
|
-
% (s(extra), seq2str(sorted(extra))))
|
|
48
|
-
return types
|
|
49
|
-
|
|
50
|
-
def convert_type_list_to_dict(self, types):
|
|
51
|
-
names = self._argspec.argument_names
|
|
52
|
-
if len(types) > len(names):
|
|
53
|
-
raise DataError('Type information given to %d argument%s but '
|
|
54
|
-
'keyword has only %d argument%s.'
|
|
55
|
-
% (len(types), s(types), len(names), s(names)))
|
|
56
|
-
return {name: value for name, value in zip(names, types) if value}
|