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
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import re
|
|
17
17
|
import time
|
|
18
18
|
import warnings
|
|
19
|
-
from datetime import timedelta
|
|
19
|
+
from datetime import datetime, timedelta
|
|
20
20
|
|
|
21
21
|
from .normalizing import normalize
|
|
22
22
|
from .misc import plural_or_not
|
|
@@ -40,7 +40,7 @@ def _float_secs_to_secs_and_millis(secs):
|
|
|
40
40
|
return (isecs, millis) if millis < 1000 else (isecs+1, 0)
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def timestr_to_secs(timestr, round_to=3
|
|
43
|
+
def timestr_to_secs(timestr, round_to=3):
|
|
44
44
|
"""Parses time strings like '1h 10s', '01:00:10' and '42' and returns seconds.
|
|
45
45
|
|
|
46
46
|
Time can also be given as an integer or float or, starting from RF 6.0.1,
|
|
@@ -48,23 +48,16 @@ def timestr_to_secs(timestr, round_to=3, accept_plain_values=True):
|
|
|
48
48
|
|
|
49
49
|
The result is rounded according to the `round_to` argument.
|
|
50
50
|
Use `round_to=None` to disable rounding altogether.
|
|
51
|
-
|
|
52
|
-
`accept_plain_values` is considered deprecated and should not be used.
|
|
53
51
|
"""
|
|
54
52
|
if is_string(timestr) or is_number(timestr):
|
|
55
|
-
|
|
56
|
-
converters = [_number_to_secs, _timer_to_secs, _time_string_to_secs]
|
|
57
|
-
else:
|
|
58
|
-
# TODO: Remove 'accept_plain_values' in 7.0
|
|
59
|
-
warnings.warn("'accept_plain_values' is deprecated and will be removed in RF 7.0.")
|
|
60
|
-
converters = [_timer_to_secs, _time_string_to_secs]
|
|
53
|
+
converters = [_number_to_secs, _timer_to_secs, _time_string_to_secs]
|
|
61
54
|
for converter in converters:
|
|
62
55
|
secs = converter(timestr)
|
|
63
56
|
if secs is not None:
|
|
64
57
|
return secs if round_to is None else round(secs, round_to)
|
|
65
58
|
if isinstance(timestr, timedelta):
|
|
66
59
|
return timestr.total_seconds()
|
|
67
|
-
raise ValueError("Invalid time string '
|
|
60
|
+
raise ValueError(f"Invalid time string '{timestr}'.")
|
|
68
61
|
|
|
69
62
|
|
|
70
63
|
def _number_to_secs(number):
|
|
@@ -104,7 +97,7 @@ def _time_string_to_secs(timestr):
|
|
|
104
97
|
try:
|
|
105
98
|
if c == 'n': nanos = float(''.join(temp)); temp = []
|
|
106
99
|
elif c == 'u': micros = float(''.join(temp)); temp = []
|
|
107
|
-
elif c == '
|
|
100
|
+
elif c == 'M': millis = float(''.join(temp)); temp = []
|
|
108
101
|
elif c == 's': secs = float(''.join(temp)); temp = []
|
|
109
102
|
elif c == 'm': mins = float(''.join(temp)); temp = []
|
|
110
103
|
elif c == 'h': hours = float(''.join(temp)); temp = []
|
|
@@ -122,7 +115,7 @@ def _normalize_timestr(timestr):
|
|
|
122
115
|
timestr = normalize(timestr)
|
|
123
116
|
for specifier, aliases in [('n', ['nanosecond', 'ns']),
|
|
124
117
|
('u', ['microsecond', 'us', 'μs']),
|
|
125
|
-
('
|
|
118
|
+
('M', ['millisecond', 'millisec', 'millis',
|
|
126
119
|
'msec', 'ms']),
|
|
127
120
|
('s', ['second', 'sec']),
|
|
128
121
|
('m', ['minute', 'min']),
|
|
@@ -135,7 +128,7 @@ def _normalize_timestr(timestr):
|
|
|
135
128
|
return timestr
|
|
136
129
|
|
|
137
130
|
|
|
138
|
-
def secs_to_timestr(secs, compact=False):
|
|
131
|
+
def secs_to_timestr(secs: 'int|float|timedelta', compact=False) -> str:
|
|
139
132
|
"""Converts time in seconds to a string representation.
|
|
140
133
|
|
|
141
134
|
Returned string is in format like
|
|
@@ -143,12 +136,14 @@ def secs_to_timestr(secs, compact=False):
|
|
|
143
136
|
|
|
144
137
|
- Time parts having zero value are not included (e.g. '3 minutes 4 seconds'
|
|
145
138
|
instead of '0 days 0 hours 3 minutes 4 seconds')
|
|
146
|
-
- Hour part has a
|
|
139
|
+
- Hour part has a maximum of 23 and minutes and seconds both have 59
|
|
147
140
|
(e.g. '1 minute 40 seconds' instead of '100 seconds')
|
|
148
141
|
|
|
149
142
|
If compact has value 'True', short suffixes are used.
|
|
150
143
|
(e.g. 1d 2h 3min 4s 5ms)
|
|
151
144
|
"""
|
|
145
|
+
if isinstance(secs, timedelta):
|
|
146
|
+
secs = secs.total_seconds()
|
|
152
147
|
return _SecsToTimestrHelper(secs, compact).get_value()
|
|
153
148
|
|
|
154
149
|
|
|
@@ -157,13 +152,12 @@ class _SecsToTimestrHelper:
|
|
|
157
152
|
def __init__(self, float_secs, compact):
|
|
158
153
|
self._compact = compact
|
|
159
154
|
self._ret = []
|
|
160
|
-
self._sign,
|
|
161
|
-
|
|
162
|
-
self._add_item(
|
|
163
|
-
self._add_item(
|
|
164
|
-
self._add_item(
|
|
165
|
-
self._add_item(
|
|
166
|
-
self._add_item(millis, 'ms', 'millisecond')
|
|
155
|
+
self._sign, ms, sec, min, hour, day = self._secs_to_components(float_secs)
|
|
156
|
+
self._add_item(day, 'd', 'day')
|
|
157
|
+
self._add_item(hour, 'h', 'hour')
|
|
158
|
+
self._add_item(min, 'min', 'minute')
|
|
159
|
+
self._add_item(sec, 's', 'second')
|
|
160
|
+
self._add_item(ms, 'ms', 'millisecond')
|
|
167
161
|
|
|
168
162
|
def get_value(self):
|
|
169
163
|
if len(self._ret) > 0:
|
|
@@ -195,17 +189,9 @@ class _SecsToTimestrHelper:
|
|
|
195
189
|
|
|
196
190
|
def format_time(timetuple_or_epochsecs, daysep='', daytimesep=' ', timesep=':',
|
|
197
191
|
millissep=None):
|
|
198
|
-
"""
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Timetuple is (year, month, day, hour, min, sec[, millis]), where parts must
|
|
203
|
-
be integers and millis is required only when millissep is not None.
|
|
204
|
-
Notice that this is not 100% compatible with standard Python timetuples
|
|
205
|
-
which do not have millis.
|
|
206
|
-
|
|
207
|
-
Seconds after epoch can be either an integer or a float.
|
|
208
|
-
"""
|
|
192
|
+
"""Deprecated in Robot Framework 7.0. Will be removed in Robot Framework 8.0."""
|
|
193
|
+
warnings.warn("'robot.utils.format_time' is deprecated and will be "
|
|
194
|
+
"removed in Robot Framework 8.0.")
|
|
209
195
|
if is_number(timetuple_or_epochsecs):
|
|
210
196
|
timetuple = _get_timetuple(timetuple_or_epochsecs)
|
|
211
197
|
else:
|
|
@@ -239,14 +225,15 @@ def get_time(format='timestamp', time_=None):
|
|
|
239
225
|
# 1) Return time in seconds since epoc
|
|
240
226
|
if 'epoch' in format:
|
|
241
227
|
return time_
|
|
242
|
-
|
|
228
|
+
dt = datetime.fromtimestamp(time_)
|
|
243
229
|
parts = []
|
|
244
|
-
for
|
|
245
|
-
|
|
246
|
-
|
|
230
|
+
for part, name in [(dt.year, 'year'), (dt.month, 'month'), (dt.day, 'day'),
|
|
231
|
+
(dt.hour, 'hour'), (dt.minute, 'min'), (dt.second, 'sec')]:
|
|
232
|
+
if name in format:
|
|
233
|
+
parts.append(f'{part:02}')
|
|
247
234
|
# 2) Return time as timestamp
|
|
248
235
|
if not parts:
|
|
249
|
-
return
|
|
236
|
+
return dt.isoformat(' ', timespec='seconds')
|
|
250
237
|
# Return requested parts of the time
|
|
251
238
|
elif len(parts) == 1:
|
|
252
239
|
return parts[0]
|
|
@@ -254,6 +241,50 @@ def get_time(format='timestamp', time_=None):
|
|
|
254
241
|
return parts
|
|
255
242
|
|
|
256
243
|
|
|
244
|
+
def parse_timestamp(timestamp: 'str|datetime') -> datetime:
|
|
245
|
+
"""Parse timestamp in ISO 8601-like formats into a ``datetime``.
|
|
246
|
+
|
|
247
|
+
Months, days, hours, minutes and seconds must use two digits and
|
|
248
|
+
year must use four. Microseconds can use up to six digits. All time
|
|
249
|
+
parts can be omitted.
|
|
250
|
+
|
|
251
|
+
Separators '-', '_', ' ', 'T', ':' and '.' between date and time components.
|
|
252
|
+
Separators can also be omitted altogether.
|
|
253
|
+
|
|
254
|
+
Examples::
|
|
255
|
+
|
|
256
|
+
2023-09-08T14:34:42.123456
|
|
257
|
+
2023-09-08 14:34:42.123
|
|
258
|
+
20230908 143442
|
|
259
|
+
2023_09_08
|
|
260
|
+
|
|
261
|
+
This is similar to ``datetime.fromisoformat``, but a little less strict.
|
|
262
|
+
The standard function is recommended if the input format is known to be
|
|
263
|
+
accepted.
|
|
264
|
+
|
|
265
|
+
If the input is a ``datetime``, it is returned as-is.
|
|
266
|
+
|
|
267
|
+
New in Robot Framework 7.0.
|
|
268
|
+
"""
|
|
269
|
+
if isinstance(timestamp, datetime):
|
|
270
|
+
return timestamp
|
|
271
|
+
try:
|
|
272
|
+
return datetime.fromisoformat(timestamp)
|
|
273
|
+
except ValueError:
|
|
274
|
+
pass
|
|
275
|
+
orig = timestamp
|
|
276
|
+
for sep in ('-', '_', ' ', 'T', ':', '.'):
|
|
277
|
+
if sep in timestamp:
|
|
278
|
+
timestamp = timestamp.replace(sep, '')
|
|
279
|
+
timestamp = timestamp.ljust(20, '0')
|
|
280
|
+
try:
|
|
281
|
+
return datetime(int(timestamp[0:4]), int(timestamp[4:6]), int(timestamp[6:8]),
|
|
282
|
+
int(timestamp[8:10]), int(timestamp[10:12]), int(timestamp[12:14]),
|
|
283
|
+
int(timestamp[14:20]))
|
|
284
|
+
except ValueError:
|
|
285
|
+
raise ValueError(f"Invalid timestamp '{orig}'.")
|
|
286
|
+
|
|
287
|
+
|
|
257
288
|
def parse_time(timestr):
|
|
258
289
|
"""Parses the time string and returns its value as seconds since epoch.
|
|
259
290
|
|
|
@@ -290,7 +321,7 @@ def _parse_time_epoch(timestr):
|
|
|
290
321
|
|
|
291
322
|
def _parse_time_timestamp(timestr):
|
|
292
323
|
try:
|
|
293
|
-
return
|
|
324
|
+
return parse_timestamp(timestr).timestamp()
|
|
294
325
|
except ValueError:
|
|
295
326
|
return None
|
|
296
327
|
|
|
@@ -333,10 +364,23 @@ def _get_dst_difference(time1, time2):
|
|
|
333
364
|
|
|
334
365
|
|
|
335
366
|
def get_timestamp(daysep='', daytimesep=' ', timesep=':', millissep='.'):
|
|
336
|
-
|
|
367
|
+
"""Deprecated in Robot Framework 7.0. Will be removed in Robot Framework 8.0."""
|
|
368
|
+
warnings.warn("'robot.utils.get_timestamp' is deprecated and will be "
|
|
369
|
+
"removed in Robot Framework 8.0.")
|
|
370
|
+
dt = datetime.now()
|
|
371
|
+
parts = [str(dt.year), daysep, f'{dt.month:02}', daysep, f'{dt.day:02}', daytimesep,
|
|
372
|
+
f'{dt.hour:02}', timesep, f'{dt.minute:02}', timesep, f'{dt.second:02}']
|
|
373
|
+
if millissep:
|
|
374
|
+
# Make sure milliseconds is < 1000. Good enough for a deprecated function.
|
|
375
|
+
millis = min(round(dt.microsecond, -3) // 1000, 999)
|
|
376
|
+
parts.extend([millissep, f'{millis:03}'])
|
|
377
|
+
return ''.join(parts)
|
|
337
378
|
|
|
338
379
|
|
|
339
380
|
def timestamp_to_secs(timestamp, seps=None):
|
|
381
|
+
"""Deprecated in Robot Framework 7.0. Will be removed in Robot Framework 8.0."""
|
|
382
|
+
warnings.warn("'robot.utils.timestamp_to_secs' is deprecated and will be "
|
|
383
|
+
"removed in Robot Framework 8.0. User 'parse_timestamp' instead.")
|
|
340
384
|
try:
|
|
341
385
|
secs = _timestamp_to_millis(timestamp, seps) / 1000.0
|
|
342
386
|
except (ValueError, OverflowError):
|
|
@@ -346,6 +390,9 @@ def timestamp_to_secs(timestamp, seps=None):
|
|
|
346
390
|
|
|
347
391
|
|
|
348
392
|
def secs_to_timestamp(secs, seps=None, millis=False):
|
|
393
|
+
"""Deprecated in Robot Framework 7.0. Will be removed in Robot Framework 8.0."""
|
|
394
|
+
warnings.warn("'robot.utils.secs_to_timestamp' is deprecated and will be "
|
|
395
|
+
"removed in Robot Framework 8.0.")
|
|
349
396
|
if not seps:
|
|
350
397
|
seps = ('', ' ', ':', '.' if millis else None)
|
|
351
398
|
ttuple = time.localtime(secs)[:6]
|
|
@@ -356,43 +403,67 @@ def secs_to_timestamp(secs, seps=None, millis=False):
|
|
|
356
403
|
|
|
357
404
|
|
|
358
405
|
def get_elapsed_time(start_time, end_time):
|
|
359
|
-
"""
|
|
406
|
+
"""Deprecated in Robot Framework 7.0. Will be removed in Robot Framework 8.0."""
|
|
407
|
+
warnings.warn("'robot.utils.get_elapsed_time' is deprecated and will be "
|
|
408
|
+
"removed in Robot Framework 8.0.")
|
|
360
409
|
if start_time == end_time or not (start_time and end_time):
|
|
361
410
|
return 0
|
|
362
411
|
if start_time[:-4] == end_time[:-4]:
|
|
363
412
|
return int(end_time[-3:]) - int(start_time[-3:])
|
|
364
413
|
start_millis = _timestamp_to_millis(start_time)
|
|
365
414
|
end_millis = _timestamp_to_millis(end_time)
|
|
366
|
-
|
|
367
|
-
|
|
415
|
+
return end_millis - start_millis
|
|
416
|
+
|
|
368
417
|
|
|
418
|
+
def elapsed_time_to_string(elapsed: 'int|float|timedelta',
|
|
419
|
+
include_millis: bool = True,
|
|
420
|
+
seconds: bool = False):
|
|
421
|
+
"""Converts elapsed time to format 'hh:mm:ss.mil'.
|
|
369
422
|
|
|
370
|
-
|
|
371
|
-
|
|
423
|
+
Elapsed time as an integer or as a float is currently considered to be
|
|
424
|
+
milliseconds, but that will be changed to seconds in Robot Framework 8.0.
|
|
425
|
+
Use ``seconds=True`` to change the behavior already now and to avoid the
|
|
426
|
+
deprecation warning. An alternative is giving the elapsed time as
|
|
427
|
+
a ``timedelta``.
|
|
372
428
|
|
|
373
429
|
If `include_millis` is True, '.mil' part is omitted.
|
|
430
|
+
|
|
431
|
+
Support for giving the elapsed time as a ``timedelta`` and the ``seconds``
|
|
432
|
+
argument are new in Robot Framework 7.0.
|
|
374
433
|
"""
|
|
434
|
+
# TODO: Change the default input to seconds in RF 8.0.
|
|
435
|
+
if isinstance(elapsed, timedelta):
|
|
436
|
+
elapsed = elapsed.total_seconds()
|
|
437
|
+
elif not seconds:
|
|
438
|
+
elapsed /= 1000
|
|
439
|
+
warnings.warn("'robot.utils.elapsed_time_to_string' currently accepts "
|
|
440
|
+
"input as milliseconds, but that will be changed to seconds "
|
|
441
|
+
"in Robot Framework 8.0. Use 'seconds=True' to change the "
|
|
442
|
+
"behavior already now and to avoid this warning. Alternatively "
|
|
443
|
+
"pass the elapsed time as a 'timedelta'.")
|
|
375
444
|
prefix = ''
|
|
376
445
|
if elapsed < 0:
|
|
377
446
|
prefix = '-'
|
|
378
447
|
elapsed = abs(elapsed)
|
|
379
448
|
if include_millis:
|
|
380
|
-
return prefix +
|
|
449
|
+
return prefix + _elapsed_time_to_string_with_millis(elapsed)
|
|
381
450
|
return prefix + _elapsed_time_to_string_without_millis(elapsed)
|
|
382
451
|
|
|
383
452
|
|
|
384
|
-
def
|
|
385
|
-
|
|
453
|
+
def _elapsed_time_to_string_with_millis(elapsed):
|
|
454
|
+
elapsed = round(elapsed, 3)
|
|
455
|
+
secs = int(elapsed)
|
|
456
|
+
millis = round((elapsed - secs) * 1000)
|
|
386
457
|
mins, secs = divmod(secs, 60)
|
|
387
458
|
hours, mins = divmod(mins, 60)
|
|
388
|
-
return '
|
|
459
|
+
return f'{hours:02}:{mins:02}:{secs:02}.{millis:03}'
|
|
389
460
|
|
|
390
461
|
|
|
391
462
|
def _elapsed_time_to_string_without_millis(elapsed):
|
|
392
|
-
secs = round(elapsed
|
|
463
|
+
secs = round(elapsed)
|
|
393
464
|
mins, secs = divmod(secs, 60)
|
|
394
465
|
hours, mins = divmod(mins, 60)
|
|
395
|
-
return '
|
|
466
|
+
return f'{hours:02}:{mins:02}:{secs:02}'
|
|
396
467
|
|
|
397
468
|
|
|
398
469
|
def _timestamp_to_millis(timestamp, seps=None):
|
|
@@ -420,42 +491,3 @@ def _split_timestamp(timestamp):
|
|
|
420
491
|
secs = int(timestamp[15:17])
|
|
421
492
|
millis = int(timestamp[18:21])
|
|
422
493
|
return years, mons, days, hours, mins, secs, millis
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
class TimestampCache:
|
|
426
|
-
|
|
427
|
-
def __init__(self):
|
|
428
|
-
self._previous_secs = None
|
|
429
|
-
self._previous_separators = None
|
|
430
|
-
self._previous_timestamp = None
|
|
431
|
-
|
|
432
|
-
def get_timestamp(self, daysep='', daytimesep=' ', timesep=':', millissep='.'):
|
|
433
|
-
epoch = self._get_epoch()
|
|
434
|
-
secs, millis = _float_secs_to_secs_and_millis(epoch)
|
|
435
|
-
if self._use_cache(secs, daysep, daytimesep, timesep):
|
|
436
|
-
return self._cached_timestamp(millis, millissep)
|
|
437
|
-
timestamp = format_time(epoch, daysep, daytimesep, timesep, millissep)
|
|
438
|
-
self._cache_timestamp(secs, timestamp, daysep, daytimesep, timesep, millissep)
|
|
439
|
-
return timestamp
|
|
440
|
-
|
|
441
|
-
# Seam for mocking
|
|
442
|
-
def _get_epoch(self):
|
|
443
|
-
return time.time()
|
|
444
|
-
|
|
445
|
-
def _use_cache(self, secs, *separators):
|
|
446
|
-
return self._previous_timestamp \
|
|
447
|
-
and self._previous_secs == secs \
|
|
448
|
-
and self._previous_separators == separators
|
|
449
|
-
|
|
450
|
-
def _cached_timestamp(self, millis, millissep):
|
|
451
|
-
if millissep:
|
|
452
|
-
return self._previous_timestamp + millissep + format(millis, '03d')
|
|
453
|
-
return self._previous_timestamp
|
|
454
|
-
|
|
455
|
-
def _cache_timestamp(self, secs, timestamp, daysep, daytimesep, timesep, millissep):
|
|
456
|
-
self._previous_secs = secs
|
|
457
|
-
self._previous_separators = (daysep, daytimesep, timesep)
|
|
458
|
-
self._previous_timestamp = timestamp[:-4] if millissep else timestamp
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
TIMESTAMP_CACHE = TimestampCache()
|
|
@@ -17,30 +17,23 @@ from collections.abc import Iterable, Mapping
|
|
|
17
17
|
from collections import UserString
|
|
18
18
|
from io import IOBase
|
|
19
19
|
from os import PathLike
|
|
20
|
-
from typing import
|
|
20
|
+
from typing import Literal, Union, TypedDict, TypeVar
|
|
21
21
|
try:
|
|
22
22
|
from types import UnionType
|
|
23
23
|
except ImportError: # Python < 3.10
|
|
24
24
|
UnionType = ()
|
|
25
|
-
|
|
26
|
-
try:
|
|
27
|
-
from typing import TypedDict
|
|
28
|
-
except ImportError: # Python < 3.8
|
|
29
|
-
typeddict_types = ()
|
|
30
|
-
else:
|
|
31
|
-
typeddict_types = (type(TypedDict('Dummy', {})),)
|
|
25
|
+
|
|
32
26
|
try:
|
|
33
27
|
from typing_extensions import TypedDict as ExtTypedDict
|
|
34
28
|
except ImportError:
|
|
35
|
-
|
|
36
|
-
else:
|
|
37
|
-
typeddict_types += (type(ExtTypedDict('Dummy', {})),)
|
|
38
|
-
|
|
39
|
-
from .platform import PY_VERSION
|
|
29
|
+
ExtTypedDict = None
|
|
40
30
|
|
|
41
31
|
|
|
42
32
|
TRUE_STRINGS = {'TRUE', 'YES', 'ON', '1'}
|
|
43
33
|
FALSE_STRINGS = {'FALSE', 'NO', 'OFF', '0', 'NONE', ''}
|
|
34
|
+
typeddict_types = (type(TypedDict('Dummy', {})),)
|
|
35
|
+
if ExtTypedDict:
|
|
36
|
+
typeddict_types += (type(ExtTypedDict('Dummy', {})),)
|
|
44
37
|
|
|
45
38
|
|
|
46
39
|
def is_integer(item):
|
|
@@ -73,10 +66,9 @@ def is_dict_like(item):
|
|
|
73
66
|
return isinstance(item, Mapping)
|
|
74
67
|
|
|
75
68
|
|
|
76
|
-
def is_union(item
|
|
69
|
+
def is_union(item):
|
|
77
70
|
return (isinstance(item, UnionType)
|
|
78
|
-
or getattr(item, '__origin__', None) is Union
|
|
79
|
-
or (allow_tuple and isinstance(item, tuple)))
|
|
71
|
+
or getattr(item, '__origin__', None) is Union)
|
|
80
72
|
|
|
81
73
|
|
|
82
74
|
def type_name(item, capitalize=False):
|
|
@@ -87,8 +79,9 @@ def type_name(item, capitalize=False):
|
|
|
87
79
|
if getattr(item, '__origin__', None):
|
|
88
80
|
item = item.__origin__
|
|
89
81
|
if hasattr(item, '_name') and item._name:
|
|
90
|
-
# Union, Any, etc. from typing have
|
|
91
|
-
#
|
|
82
|
+
# Prior to Python 3.10 Union, Any, etc. from typing didn't have `__name__`.
|
|
83
|
+
# but instead had `_name`. Python 3.10 has both and newer only `__name__`.
|
|
84
|
+
# Also, pandas.Series has `_name` but it's None.
|
|
92
85
|
name = item._name
|
|
93
86
|
elif is_union(item):
|
|
94
87
|
name = 'Union'
|
|
@@ -99,12 +92,6 @@ def type_name(item, capitalize=False):
|
|
|
99
92
|
named_types = {str: 'string', bool: 'boolean', int: 'integer',
|
|
100
93
|
type(None): 'None', dict: 'dictionary'}
|
|
101
94
|
name = named_types.get(typ, typ.__name__.strip('_'))
|
|
102
|
-
# Generics from typing. With newer versions we get "real" type via __origin__.
|
|
103
|
-
if PY_VERSION < (3, 7):
|
|
104
|
-
if name in ('List', 'Set', 'Tuple'):
|
|
105
|
-
name = name.lower()
|
|
106
|
-
elif name == 'Dict':
|
|
107
|
-
name = 'dictionary'
|
|
108
95
|
return name.capitalize() if capitalize and name.islower() else name
|
|
109
96
|
|
|
110
97
|
|
|
@@ -118,10 +105,13 @@ def type_repr(typ, nested=True):
|
|
|
118
105
|
return 'None'
|
|
119
106
|
if typ is Ellipsis:
|
|
120
107
|
return '...'
|
|
121
|
-
if typ is Any: # Needed with Python 3.6, with newer `Any._name` exists.
|
|
122
|
-
return 'Any'
|
|
123
108
|
if is_union(typ):
|
|
124
109
|
return ' | '.join(type_repr(a) for a in typ.__args__) if nested else 'Union'
|
|
110
|
+
if getattr(typ, '__origin__', None) is Literal:
|
|
111
|
+
if nested:
|
|
112
|
+
args = ', '.join(repr(a) for a in typ.__args__)
|
|
113
|
+
return f'Literal[{args}]'
|
|
114
|
+
return 'Literal'
|
|
125
115
|
name = _get_type_name(typ)
|
|
126
116
|
if nested and has_args(typ):
|
|
127
117
|
args = ', '.join(type_repr(a) for a in typ.__args__)
|
|
@@ -130,6 +120,7 @@ def type_repr(typ, nested=True):
|
|
|
130
120
|
|
|
131
121
|
|
|
132
122
|
def _get_type_name(typ):
|
|
123
|
+
# See comment in `type_name` for explanation about `_name`.
|
|
133
124
|
for attr in '__name__', '_name':
|
|
134
125
|
name = getattr(typ, attr, None)
|
|
135
126
|
if name:
|
|
@@ -140,16 +131,15 @@ def _get_type_name(typ):
|
|
|
140
131
|
def has_args(type):
|
|
141
132
|
"""Helper to check has type valid ``__args__``.
|
|
142
133
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
``List[int].__args__``, everything works the same way regardless the version.
|
|
134
|
+
``__args__`` contains TypeVars when accessed directly from ``typing.List`` and
|
|
135
|
+
other such types with Python 3.8. Python 3.9+ don't have ``__args__`` at all.
|
|
136
|
+
Parameterize usages like ``List[int].__args__`` always work the same way.
|
|
147
137
|
|
|
148
138
|
This helper can be removed in favor of using ``hasattr(type, '__args__')``
|
|
149
139
|
when we support only Python 3.9 and newer.
|
|
150
140
|
"""
|
|
151
141
|
args = getattr(type, '__args__', None)
|
|
152
|
-
return args and not all(isinstance(a, TypeVar) for a in args)
|
|
142
|
+
return bool(args and not all(isinstance(a, TypeVar) for a in args))
|
|
153
143
|
|
|
154
144
|
|
|
155
145
|
def is_truthy(item):
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
import sys
|
|
17
16
|
from typing import Callable, Generic, overload, TypeVar, Type, Union
|
|
18
17
|
|
|
19
18
|
|
|
@@ -93,7 +92,3 @@ class SetterAwareType(type):
|
|
|
93
92
|
slots.append(item.attr_name)
|
|
94
93
|
dct['__slots__'] = slots
|
|
95
94
|
return type.__new__(cls, name, bases, dct)
|
|
96
|
-
|
|
97
|
-
if sys.version_info < (3, 7):
|
|
98
|
-
def __getitem__(self, item):
|
|
99
|
-
return self
|
|
@@ -36,13 +36,14 @@ def cut_long_message(msg):
|
|
|
36
36
|
if MAX_ERROR_LINES is None:
|
|
37
37
|
return msg
|
|
38
38
|
lines = msg.splitlines()
|
|
39
|
-
lengths =
|
|
39
|
+
lengths = [_get_virtual_line_length(line) for line in lines]
|
|
40
40
|
if sum(lengths) <= MAX_ERROR_LINES:
|
|
41
41
|
return msg
|
|
42
42
|
start = _prune_excess_lines(lines, lengths)
|
|
43
43
|
end = _prune_excess_lines(lines, lengths, from_end=True)
|
|
44
44
|
return '\n'.join(start + [_ERROR_CUT_EXPLN] + end)
|
|
45
45
|
|
|
46
|
+
|
|
46
47
|
def _prune_excess_lines(lines, lengths, from_end=False):
|
|
47
48
|
if from_end:
|
|
48
49
|
lines.reverse()
|
|
@@ -60,6 +61,7 @@ def _prune_excess_lines(lines, lengths, from_end=False):
|
|
|
60
61
|
ret.reverse()
|
|
61
62
|
return ret
|
|
62
63
|
|
|
64
|
+
|
|
63
65
|
def _cut_long_line(line, used, from_end):
|
|
64
66
|
available_lines = MAX_ERROR_LINES // 2 - used
|
|
65
67
|
available_chars = available_lines * _MAX_ERROR_LINE_LENGTH - 3
|
|
@@ -70,10 +72,8 @@ def _cut_long_line(line, used, from_end):
|
|
|
70
72
|
line = '...' + line[-available_chars:]
|
|
71
73
|
return line
|
|
72
74
|
|
|
73
|
-
def _count_line_lengths(lines):
|
|
74
|
-
return [ _count_virtual_line_length(line) for line in lines ]
|
|
75
75
|
|
|
76
|
-
def
|
|
76
|
+
def _get_virtual_line_length(line):
|
|
77
77
|
if not line:
|
|
78
78
|
return 1
|
|
79
79
|
lines, remainder = divmod(len(line), _MAX_ERROR_LINE_LENGTH)
|
|
@@ -88,6 +88,7 @@ def format_assign_message(variable, value, items=None, cut_long=True):
|
|
|
88
88
|
decorated_items = ''.join(f'[{item}]' for item in items) if items else ''
|
|
89
89
|
return f'{variable}{decorated_items} = {value}'
|
|
90
90
|
|
|
91
|
+
|
|
91
92
|
def _dict_to_str(d):
|
|
92
93
|
if not d:
|
|
93
94
|
return '{ }'
|
|
@@ -114,10 +115,12 @@ def pad_console_length(text, width):
|
|
|
114
115
|
text = _lose_width(text, diff+3) + '...'
|
|
115
116
|
return _pad_width(text, width)
|
|
116
117
|
|
|
118
|
+
|
|
117
119
|
def _pad_width(text, width):
|
|
118
120
|
more = width - get_console_length(text)
|
|
119
121
|
return text + ' ' * more
|
|
120
122
|
|
|
123
|
+
|
|
121
124
|
def _lose_width(text, diff):
|
|
122
125
|
lost = 0
|
|
123
126
|
while lost < diff:
|
|
@@ -36,8 +36,8 @@ def _safe_str(item):
|
|
|
36
36
|
return _unrepresentable_object(item)
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
def prepr(item, width=80):
|
|
40
|
-
return safe_str(PrettyRepr(width=width).pformat(item))
|
|
39
|
+
def prepr(item, width=80, sort_dicts=False):
|
|
40
|
+
return safe_str(PrettyRepr(width=width, sort_dicts=sort_dicts).pformat(item))
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class PrettyRepr(PrettyPrinter):
|
|
@@ -28,6 +28,6 @@ from .search import (search_variable, contains_variable,
|
|
|
28
28
|
is_scalar_variable, is_scalar_assign,
|
|
29
29
|
is_dict_variable, is_dict_assign,
|
|
30
30
|
is_list_variable, is_list_assign,
|
|
31
|
-
|
|
32
|
-
from .tablesetter import
|
|
31
|
+
VariableMatches)
|
|
32
|
+
from .tablesetter import VariableResolver, DictVariableResolver
|
|
33
33
|
from .variables import Variables
|