We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a76f21d commit 6698c48Copy full SHA for 6698c48
python/grass/experimental/tools.py
@@ -26,9 +26,18 @@ def json(self):
26
27
@property
28
def keyval(self):
29
- # TODO: possibly use or add _text_to_key_value_dict
30
- # which converts int and float automatically
31
- return gs.parse_key_val(self._stdout)
+ def conversion(value):
+ try:
+ return int(value)
32
+ except ValueError:
33
+ pass
34
35
+ return float(value)
36
37
38
+ return value
39
+
40
+ return gs.parse_key_val(self._stdout, val_type=conversion)
41
42
43
def comma_items(self):
0 commit comments