예제 #1
0
def unicode_endswith__RopeUnicode_Tuple_ANY_ANY(space, w_unistr, w_suffixes, w_start, w_end):
    unistr, start, end = _convert_idx_params(space, w_unistr, w_start, w_end)
    for w_suffix in space.fixedview(w_suffixes):
        suffix = ropeunicode_w(space, w_suffix)
        if rope.endswith(unistr, suffix, start, end):
            return space.w_True
    return space.w_False
예제 #2
0
def unicode_endswith__RopeUnicode_Tuple_ANY_ANY(space, w_unistr, w_suffixes,
                                                w_start, w_end):
    unistr, start, end = _convert_idx_params(space, w_unistr, w_start, w_end)
    for w_suffix in space.fixedview(w_suffixes):
        suffix = ropeunicode_w(space, w_suffix)
        if rope.endswith(unistr, suffix, start, end):
            return space.w_True
    return space.w_False
예제 #3
0
def str_endswith__Rope_Tuple_ANY_ANY(space, w_self, w_suffixes, w_start, w_end):
    (self, _, start, end) = _convert_idx_params(space, w_self, W_RopeObject.EMPTY, w_start, w_end, True)
    for w_suffix in space.fixedview(w_suffixes):
        if space.isinstance_w(w_suffix, space.w_unicode):
            w_u = space.call_function(space.w_unicode, w_self)
            return space.call_method(w_u, "endswith", w_suffixes, w_start, w_end)
        suffix = rope_w(space, w_suffix)
        if rope.endswith(self, suffix, start, end):
            return space.w_True
    return space.w_False
예제 #4
0
def str_endswith__Rope_Tuple_ANY_ANY(space, w_self, w_suffixes, w_start, w_end):
    (self, _, start, end) = _convert_idx_params(space, w_self,
                                                  W_RopeObject.EMPTY, w_start, w_end)
    for w_suffix in space.unpacktuple(w_suffixes):
        if space.is_true(space.isinstance(w_suffix, space.w_unicode)):
            w_u = space.call_function(space.w_unicode, w_self)
            return space.call_method(w_u, "endswith", w_suffixes, w_start,
                                     w_end)
        suffix = rope_w(space, w_suffix) 
        if rope.endswith(self, suffix, start, end):
            return space.w_True
    return space.w_False
예제 #5
0
def str_endswith__Rope_Rope_ANY_ANY(space, w_self, w_suffix, w_start, w_end):
    (self, suffix, start, end) = _convert_idx_params(space, w_self,
                                                     w_suffix, w_start, w_end)
    return space.newbool(rope.endswith(self, suffix, start, end))
예제 #6
0
def unicode_endswith__RopeUnicode_RopeUnicode_ANY_ANY(space, w_self, w_substr, w_start, w_end):
    self, start, end = _convert_idx_params(space, w_self, w_start, w_end)
    return space.newbool(rope.endswith(self, w_substr._node, start, end))
예제 #7
0
def unicode_endswith__RopeUnicode_RopeUnicode_ANY_ANY(space, w_self, w_substr,
                                                      w_start, w_end):
    self, start, end = _convert_idx_params(space, w_self, w_start, w_end)
    return space.newbool(rope.endswith(self, w_substr._node, start, end))
예제 #8
0
def str_endswith__Rope_Rope_ANY_ANY(space, w_self, w_suffix, w_start, w_end):
    (self, suffix, start, end) = _convert_idx_params(space, w_self,
                                                     w_suffix, w_start, w_end,
                                                     True)
    return space.newbool(rope.endswith(self, suffix, start, end))