예제 #1
0
	def __setslice__(self, i, j, other):
		o = []
		o_tmp = other
		if type(o_tmp) not in (list, tuple) and not isinstance(o_tmp, UserList):
			o_tmp = list(o_tmp)
		for item in o_tmp:
			if type(item) == unicode:
				o.append(item.encode(u'utf-8'))
			else:
				o.append(item)
		MultiPurposeList.__setslice__(self, i, j, o)
예제 #2
0
	def extend(self, other):
		o = []
		o_tmp = other
		if type(o_tmp) not in (list, tuple) and not isinstance(o_tmp, UserList):
			o_tmp = list(o_tmp)
		for i in o_tmp:
			if type(i) is unicode:
				o.append(i.encode(u'utf-8'))
			else:
				o.append(i)
		MultiPurposeList.extend(self, o)
예제 #3
0
 def extend(self, other):
     o = []
     o_tmp = other
     if type(o_tmp) not in (list,
                            tuple) and not isinstance(o_tmp, UserList):
         o_tmp = list(o_tmp)
     for i in o_tmp:
         if type(i) is unicode:
             o.append(i.encode(u'utf-8'))
         else:
             o.append(i)
     MultiPurposeList.extend(self, o)
예제 #4
0
 def __setslice__(self, i, j, other):
     o = []
     o_tmp = other
     if type(o_tmp) not in (list,
                            tuple) and not isinstance(o_tmp, UserList):
         o_tmp = list(o_tmp)
     for item in o_tmp:
         if type(item) == unicode:
             o.append(item.encode(u'utf-8'))
         else:
             o.append(item)
     MultiPurposeList.__setslice__(self, i, j, o)
예제 #5
0
	def append(self, item):
		i = item
		if type(item) is str:
			i = item.encode(u'utf-8')
		MultiPurposeList.append(self, i)
예제 #6
0
 def __getitem__(self, i):
     item = MultiPurposeList.__getitem__(self, i)
     if type(item) is str:
         return item.decode(u'utf-8')
     return item
예제 #7
0
	def __setitem__(self, i, item):
		_i = item
		if type(_i) is unicode:
			_i = item.encode(u'utf-8')

		MultiPurposeList.__setitem__(self, i, _i)
예제 #8
0
	def __getslice__(self, i, j):
		return [item.decode(u'utf-8') if type(item) is str else item \
				for item in MultiPurposeList.__getslice__(self, i, j)]
예제 #9
0
	def __getitem__(self, i):
		item = MultiPurposeList.__getitem__(self, i)
		if type(item) is str:
			return item.decode(u'utf-8')
		return item
예제 #10
0
	def __contains__(self, item):
		i = item
		if type(i) is unicode:
			i = item.encode(u'utf-8')
		return MultiPurposeList.__contains__(self, i)
예제 #11
0
    def __setitem__(self, i, item):
        _i = item
        if type(_i) is unicode:
            _i = item.encode(u'utf-8')

        MultiPurposeList.__setitem__(self, i, _i)
예제 #12
0
	def pop(self, i=-1):
		return MultiPurposeList.pop(self, i).decode(u'utf-8')
예제 #13
0
 def pop(self, i=-1):
     return MultiPurposeList.pop(self, i).decode(u'utf-8')
예제 #14
0
 def index(self, item, *args):
     i = item
     if type(i) is unicode:
         i = item.encode(u'utf-8')
     MultiPurposeList.index(self, i, *args)
예제 #15
0
 def insert(self, i, item):
     _i = item
     if type(_i) is str:
         _i = item.encode(u'utf-8')
     MultiPurposeList.insert(self, i, _i)
예제 #16
0
 def append(self, item):
     i = item
     if type(item) is str:
         i = item.encode(u'utf-8')
     MultiPurposeList.append(self, i)
예제 #17
0
	def insert(self, i, item):
		_i = item
		if type(_i) is str:
			_i = item.encode(u'utf-8')
		MultiPurposeList.insert(self, i, _i)
예제 #18
0
 def __contains__(self, item):
     i = item
     if type(i) is unicode:
         i = item.encode(u'utf-8')
     return MultiPurposeList.__contains__(self, i)
예제 #19
0
	def index(self, item, *args):
		i = item
		if type(i) is unicode:
			i = item.encode(u'utf-8')
		MultiPurposeList.index(self, i, *args)
예제 #20
0
 def __getslice__(self, i, j):
     return [item.decode(u'utf-8') if type(item) is str else item \
       for item in MultiPurposeList.__getslice__(self, i, j)]
예제 #21
0
	def __init__(self, vimbuffer, on_change=None):
		MultiPurposeList.__init__(self, on_change=on_change)

		# replace data with vimbuffer to make operations change the actual
		# buffer
		self.data = vimbuffer
예제 #22
0
    def __init__(self, vimbuffer, on_change=None):
        MultiPurposeList.__init__(self, on_change=on_change)

        # replace data with vimbuffer to make operations change the actual
        # buffer
        self.data = vimbuffer