-
Notifications
You must be signed in to change notification settings - Fork 0
/
DummyLibrary.py
31 lines (22 loc) · 1.11 KB
/
DummyLibrary.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""RF-importable library written in Python.
Attention! Please rename it and add your own useful keywords and documentation.
"""
import logging
# Variables can be accessed from the resources/variables.py Python module here as well.
from variables import TODAY
LOGGER = logging.getLogger(__name__)
class DummyLibrary:
"""Set a proper name, add useful methods and document it accordingly."""
def __init__(self):
"""Add and document optional input data passed during the import. ([kw]args)"""
# Additionally, add a state available for the entire life of the library.
self._context = None # just a dummy example (used later on in the methods)
def log_today_in_python(self) -> None:
"""Displays today's date in Python."""
LOGGER.info(f"Today is {TODAY}. (from Python)")
self._context = "under logging keyword"
def my_library_keyword(self, var: str = "test") -> str:
"""Describe what this RF exposed keyword does."""
LOGGER.info("Python code (as RF keyword) executed with value: %s", var)
self._context = "under my keyword"
return var