From 910765c9d3cb3ec5a2a7c9b69f06ce6d35b5bb4a Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 12 Dec 2019 11:04:10 +0100 Subject: [PATCH] solve bug when space is used for boolean value --- pygenometracks/tracksClass.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pygenometracks/tracksClass.py b/pygenometracks/tracksClass.py index f6e01d4a..0dce98be 100644 --- a/pygenometracks/tracksClass.py +++ b/pygenometracks/tracksClass.py @@ -419,6 +419,8 @@ def parse_tracks(self, tracks_file): " parameter {} but there is no more parameter" " with space in name. Will be substituted by {}." "".format(section_name, old_name, name)) + else: + old_name = name # end SYNONYMOUS_PROPERTIES = track_class.SYNONYMOUS_PROPERTIES # If the name is part of the synonymous we substitute by @@ -430,14 +432,20 @@ def parse_tracks(self, tracks_file): track_options[name] = value elif name in track_class.BOOLEAN_PROPERTIES: try: + # I need to use old_name here else I get a KeyError: track_options[name] = parser.getboolean(section_name, - name) + old_name) + # In the next 1.0 should be: + # track_options[name] = parser.getboolean(section_name, + # name) except ValueError: raise InputError("In section {}, {} was set to {}" " whereas we should have a boolean " "value. Please, use true or false." - "".format(section_name, name, + "".format(section_name, old_name, value)) + # In the next 1.0 should be: + # "".format(section_name, name, if value.lower() not in ['true', 'false']: log.warning("Deprecation Warning: " "In section {}, {} was set to {}"