robotframework-pythonlibcore
Advanced tools
+47
-1
| Metadata-Version: 2.1 | ||
| Name: robotframework-pythonlibcore | ||
| Version: 4.1.0 | ||
| Version: 4.1.1 | ||
| Summary: Tools to ease creating larger test libraries for Robot Framework using Python. | ||
@@ -123,2 +123,48 @@ Home-page: https://github.com/robotframework/PythonLibCore | ||
| Plugin API | ||
| ---------- | ||
| It is possible to create plugin API to a library by using PythonLibCore. This allows extending library | ||
| with external Python classes. Plugins can be imported during library import time, example by defining argumet | ||
| in library `__init__` which allows defining the plugins. It is possible to define multiple plugins, by seperating | ||
| plugins with with comma. Also it is possible to provide arguments to plugin by seperating arguments with | ||
| semicolon. | ||
| .. sourcecode:: python | ||
| from robot.api.deco import keyword # noqa F401 | ||
| from robotlibcore import DynamicCore, PluginParser | ||
| from mystuff import Library1, Library2 | ||
| class PluginLib(DynamicCore): | ||
| def __init__(self, plugins): | ||
| plugin_parser = PluginParser() | ||
| libraries = [Library1(), Library2()] | ||
| parsed_plugins = plugin_parser.parse_plugins(plugins) | ||
| libraries.extend(parsed_plugins) | ||
| DynamicCore.__init__(self, libraries) | ||
| When plugin class can look like this: | ||
| .. sourcecode:: python | ||
| class MyPlugi: | ||
| @keyword | ||
| def plugin_keyword(self): | ||
| return 123 | ||
| Then Library can be imported in Robot Framework side like this: | ||
| .. sourcecode:: bash | ||
| Library ${CURDIR}/PluginLib.py plugins=${CURDIR}/MyPlugin.py | ||
| .. _Robot Framework: http://robotframework.org | ||
@@ -125,0 +171,0 @@ .. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary/ |
+46
-0
@@ -97,2 +97,48 @@ Python Library Core | ||
| Plugin API | ||
| ---------- | ||
| It is possible to create plugin API to a library by using PythonLibCore. This allows extending library | ||
| with external Python classes. Plugins can be imported during library import time, example by defining argumet | ||
| in library `__init__` which allows defining the plugins. It is possible to define multiple plugins, by seperating | ||
| plugins with with comma. Also it is possible to provide arguments to plugin by seperating arguments with | ||
| semicolon. | ||
| .. sourcecode:: python | ||
| from robot.api.deco import keyword # noqa F401 | ||
| from robotlibcore import DynamicCore, PluginParser | ||
| from mystuff import Library1, Library2 | ||
| class PluginLib(DynamicCore): | ||
| def __init__(self, plugins): | ||
| plugin_parser = PluginParser() | ||
| libraries = [Library1(), Library2()] | ||
| parsed_plugins = plugin_parser.parse_plugins(plugins) | ||
| libraries.extend(parsed_plugins) | ||
| DynamicCore.__init__(self, libraries) | ||
| When plugin class can look like this: | ||
| .. sourcecode:: python | ||
| class MyPlugi: | ||
| @keyword | ||
| def plugin_keyword(self): | ||
| return 123 | ||
| Then Library can be imported in Robot Framework side like this: | ||
| .. sourcecode:: bash | ||
| Library ${CURDIR}/PluginLib.py plugins=${CURDIR}/MyPlugin.py | ||
| .. _Robot Framework: http://robotframework.org | ||
@@ -99,0 +145,0 @@ .. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary/ |
| Metadata-Version: 2.1 | ||
| Name: robotframework-pythonlibcore | ||
| Version: 4.1.0 | ||
| Version: 4.1.1 | ||
| Summary: Tools to ease creating larger test libraries for Robot Framework using Python. | ||
@@ -123,2 +123,48 @@ Home-page: https://github.com/robotframework/PythonLibCore | ||
| Plugin API | ||
| ---------- | ||
| It is possible to create plugin API to a library by using PythonLibCore. This allows extending library | ||
| with external Python classes. Plugins can be imported during library import time, example by defining argumet | ||
| in library `__init__` which allows defining the plugins. It is possible to define multiple plugins, by seperating | ||
| plugins with with comma. Also it is possible to provide arguments to plugin by seperating arguments with | ||
| semicolon. | ||
| .. sourcecode:: python | ||
| from robot.api.deco import keyword # noqa F401 | ||
| from robotlibcore import DynamicCore, PluginParser | ||
| from mystuff import Library1, Library2 | ||
| class PluginLib(DynamicCore): | ||
| def __init__(self, plugins): | ||
| plugin_parser = PluginParser() | ||
| libraries = [Library1(), Library2()] | ||
| parsed_plugins = plugin_parser.parse_plugins(plugins) | ||
| libraries.extend(parsed_plugins) | ||
| DynamicCore.__init__(self, libraries) | ||
| When plugin class can look like this: | ||
| .. sourcecode:: python | ||
| class MyPlugi: | ||
| @keyword | ||
| def plugin_keyword(self): | ||
| return 123 | ||
| Then Library can be imported in Robot Framework side like this: | ||
| .. sourcecode:: bash | ||
| Library ${CURDIR}/PluginLib.py plugins=${CURDIR}/MyPlugin.py | ||
| .. _Robot Framework: http://robotframework.org | ||
@@ -125,0 +171,0 @@ .. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary/ |
@@ -30,3 +30,3 @@ # Copyright 2017- Robot Framework Foundation | ||
| __version__ = "4.1.0" | ||
| __version__ = "4.1.1" | ||
@@ -233,3 +233,3 @@ | ||
| if arg_spec.varargs: | ||
| return ["*%s" % arg_spec.varargs] | ||
| return [f"*{arg_spec.varargs}"] | ||
| return [] | ||
@@ -239,3 +239,3 @@ | ||
| def _get_kwargs(cls, arg_spec): | ||
| return ["**%s" % arg_spec.varkw] if arg_spec.varkw else [] | ||
| return [f"**{arg_spec.varkw}"] if arg_spec.varkw else [] | ||
@@ -245,5 +245,9 @@ @classmethod | ||
| kw_only_args = [] | ||
| kw_only_defaults = arg_spec.kwonlydefaults if arg_spec.kwonlydefaults else [] | ||
| for arg in arg_spec.kwonlyargs: | ||
| if not arg_spec.kwonlydefaults or arg not in arg_spec.kwonlydefaults: | ||
| if not arg_spec.varargs and arg not in kw_only_defaults and not kw_only_args: | ||
| kw_only_args.append("*") | ||
| kw_only_args.append(arg) | ||
| elif arg not in kw_only_defaults: | ||
| kw_only_args.append(arg) | ||
| else: | ||
@@ -250,0 +254,0 @@ value = arg_spec.kwonlydefaults.get(arg, "") |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
43680
10.34%337
1.2%