def _format_item()

in source/lambda/configuration/setbuilders/setbuilder.py [0:0]


    def _format_item(self, set_str):
        # pre-processes the item before trying to parse it
        s = set_str.strip()

        # immediately return if it is a special item
        if len(s) == 1 and s in self._special_items():
            return s

        str_after_separator = None

        # check if the string has a separator, in that case remove and store string after and including the character
        for c in self._seperator_characters():
            if c in s:
                i = s.index(c)
                str_after_separator = s[i:]
                s = s[0:i]
                break

        # truncate to significant characters
        if self._significant_name_characters > 0:
            s = SetBuilder.RANGE_CHARACTER.join(
                [t[0:self._significant_name_characters] for t in s.split(self.RANGE_CHARACTER)])

        # case sensitivity, to lowercase if case is ignored
        if self._ignorecase:
            s = s.lower()

        # append separator and remaining part if it was truncated
        if str_after_separator is not None:
            s += str_after_separator

        return s