'Return tuple (type, rest of string)'

def _getTypeFieldFromString(self, value):

    if (not value.strip()):
        return (None, None)
    sp = value.split('{', 1)
    if (len(sp) > 1):
        before = sp[0]
        value = sp[1]
        sp = value.split('}', 1)
        value = sp[0]
        if (len(sp) > 1):
            after = sp[1]
            return (self._getTypeField(value), (before + after))
    else:
        sp = value.split(None, 1)
        if (len(sp) > 1):
            return (self._getTypeField(sp[0]), sp[1])
        return (self._getTypeField(sp[0]), '')
    return (None, value)
