diff options
author | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2018-06-01 22:13:38 +0200 |
---|---|---|
committer | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2018-06-01 22:13:38 +0200 |
commit | 37d26620d0f43baf8a46dff323d9268f4fe64097 (patch) | |
tree | a10c6921479961694ae381828272694f54cbf886 | |
parent | 3cef02888ddbb677dec96f1688ad7d5e7db37c56 (diff) | |
download | ranger-37d26620d0f43baf8a46dff323d9268f4fe64097.tar.gz |
Add a new data type for rc.conf: float
-rw-r--r-- | ranger/container/settings.py | 1 | ||||
-rw-r--r-- | ranger/core/actions.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 170ace5a..a7707ff0 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -113,6 +113,7 @@ DEFAULT_VALUES = { type(None): None, str: "", int: 0, + float: 0.0, list: [], tuple: tuple([]), } diff --git a/ranger/core/actions.py b/ranger/core/actions.py index e8c47b9f..2f1a941b 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -124,6 +124,11 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m return int(value) except ValueError: pass + if float in types: + try: + return float(value) + except ValueError: + pass if str in types: return value if list in types: |