Skip to content

Commit 61c1941

Browse files
Fix dynamic doc (#2221)
* Fix local import * Fixes keywords documentation on dynamic libraries, like SeleniumLibrary 4.4.0
1 parent 08ba4c5 commit 61c1941

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

src/robotide/lib/robot/running/dynamicmethods.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# limitations under the License.
1515

1616
from robotide.lib.robot.errors import DataError
17-
from robotide.lib.robot.utils import (get_error_message, is_java_method, is_bytes,
18-
is_unicode, py2to3)
17+
from robotide.lib.robot.utils import (get_error_message, is_java_method, is_bytes, is_unicode, is_tuple, py2to3)
1918

2019
from .arguments import JavaArgumentParser, PythonArgumentParser
2120

@@ -62,6 +61,8 @@ def _to_string(self, value):
6261
return value
6362
if is_bytes(value):
6463
return value.decode('UTF-8')
64+
if is_tuple(value):
65+
return f"{value[0]}={value[1]}"
6566
raise DataError('Return value must be string.')
6667

6768
def _to_list_of_strings(self, value):

src/robotide/lib/robot/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
parse_time)
6666
from .robottypes import (FALSE_STRINGS, TRUE_STRINGS, is_bytes, is_dict_like,
6767
is_falsy, is_integer, is_list_like, is_number,
68-
is_string, is_truthy, is_unicode, type_name, unicode)
68+
is_string, is_truthy, is_unicode, is_tuple, type_name, unicode)
6969
from .setter import setter, SetterAwareType
7070
from .sortable import Sortable
7171
from .text import (cut_long_message, format_assign_message,

src/robotide/lib/robot/utils/robottypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
if PY2:
2020
from .robottypes2 import (is_bytes, is_dict_like, is_integer, is_list_like,
21-
is_number, is_string, is_unicode, type_name)
21+
is_number, is_string, is_unicode, is_tuple, type_name)
2222
unicode = unicode
2323

2424
else:
2525
from .robottypes3 import (is_bytes, is_dict_like, is_integer, is_list_like,
26-
is_number, is_string, is_unicode, type_name)
26+
is_number, is_string, is_unicode, is_tuple, type_name)
2727
unicode = str
2828

2929

src/robotide/lib/robot/utils/robottypes2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def is_unicode(item):
4848
return isinstance(item, unicode)
4949

5050

51+
def is_tuple(item):
52+
return isinstance(item, tuple)
53+
54+
5155
def is_list_like(item):
5256
if isinstance(item, (str, unicode, bytes, bytearray, UserString, String,
5357
file)):

src/robotide/lib/robot/utils/robottypes3.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def is_unicode(item):
3939
return isinstance(item, str)
4040

4141

42+
def is_tuple(item):
43+
return isinstance(item, tuple)
44+
45+
4246
def is_list_like(item):
4347
if isinstance(item, (str, bytes, bytearray, UserString, IOBase)):
4448
return False

src/robotide/spec/xmlreaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from robotide import robotapi, utils
2020
from robotide.utils.versioncomparator import cmp_versions
21-
from iteminfo import _XMLKeywordContent
21+
from .iteminfo import _XMLKeywordContent
2222
from robotide import context
2323

2424
class SpecInitializer(object):

0 commit comments

Comments
 (0)