Exemplo n.º 1
0
    def __ge__(self, other):
        try:
            other_type = other.type
            other_index = other.index
        except AttributeError:
            if not isinstance(other, IndexPattern):
                other_type = str(other)
            else:
                return False
        else:
            try:
                pattern_compare(self.index, other_index)
            except ValueError:
                return False

        return pattern_compare(self.type, other_type, -1) != -1
Exemplo n.º 2
0
    def __ge__(self, other):
        try:
            other_index = other.index
        except AttributeError:
            other_index = str(other)

        return pattern_compare(self.index, other_index, -1) != -1
Exemplo n.º 3
0
    def __ge__(self, other):
        try:
            other_type = other.type
            other_index = other.index
        except AttributeError:
            if not isinstance(other, IndexPattern):
                other_type = str(other)
            else:
                return False
        else:
            try:
                pattern_compare(self.index, other_index)
            except ValueError:
                return False

        return pattern_compare(self.type, other_type, -1) != -1
Exemplo n.º 4
0
    def __ge__(self, other):
        try:
            other_index = other.index
        except AttributeError:
            other_index = str(other)

        return pattern_compare(self.index, other_index, -1) != -1
Exemplo n.º 5
0
    def __gt__(self, other):
        try:
            other_field = other.field
            other_type = other.type
            other_index = other.index
        except AttributeError:
            if not isinstance(other, (IndexPattern, TypePattern)):
                other_field = str(other)
            else:
                return False
        else:
            try:
                pattern_compare(self.index, other_index)
                pattern_compare(self.type, other_type)
            except ValueError:
                return False

        return pattern_compare(self.field, other_field, -1) == 1
Exemplo n.º 6
0
    def __gt__(self, other):
        try:
            other_field = other.field
            other_type = other.type
            other_index = other.index
        except AttributeError:
            if not isinstance(other, (IndexPattern, TypePattern)):
                other_field = str(other)
            else:
                return False
        else:
            try:
                pattern_compare(self.index, other_index)
                pattern_compare(self.type, other_type)
            except ValueError:
                return False

        return pattern_compare(self.field, other_field, -1) == 1