Exemple #1
0
    def _fixVal(self, val, isSplit):
        """

        :param val:
        :param isSplit:
        :return:
        """
        if isSplit:
            val = MutUtils.replaceChrs(val, ",=;\n\t ", "|~|#__")  # exclude ":"
        else:
            val = MutUtils.replaceChrs(val, "=;\n\t :", "~|#__>")  # exclude ":" and ","

        if not isSplit:
            val = self._correct(val.split(","))
        else:
            val = self._correct([val])

        return val
Exemple #2
0
    def _fixVal(self, val, isSplit):
        """

        :param val:
        :param isSplit:
        :return:
        """
        if isSplit:
            val = MutUtils.replaceChrs(val, ",=;\n\t ",
                                       "|~|#__")  # exclude ":"
        else:
            val = MutUtils.replaceChrs(val, "=;\n\t :",
                                       "~|#__>")  # exclude ":" and ","

        if not isSplit:
            val = self._correct(val.split(","))
        else:
            val = self._correct([val])

        return val
    def _correctFieldName(self, fieldName):
        """
        Replaces unwanted characters in the field name

        :param fieldName:
        :return: corrected field name
        """
        fieldName = MutUtils.replaceChrs(fieldName, "=; :", "~|_>")  # Replace whitespace and other characters
        if fieldName.endswith("__FORMAT__"):  # Drop "__FORMAT__" from the end
            fieldName = fieldName[0:len(fieldName)-len("__FORMAT__")]
        return fieldName
Exemple #4
0
    def _correctFieldName(self, fieldName):
        """
        Replaces unwanted characters in the field name

        :param fieldName:
        :return: corrected field name
        """
        fieldName = MutUtils.replaceChrs(fieldName, "=; :", "~|_>")  # Replace whitespace and other characters
        if fieldName.endswith("__FORMAT__"):  # Drop "__FORMAT__" from the end
            fieldName = fieldName[0:len(fieldName)-len("__FORMAT__")]
        elif fieldName.endswith("__INFO__"):  # Drop "__INFO__" from the end
            fieldName = fieldName[0:len(fieldName)-len("__INFO__")]
        return fieldName