当前位置: 首页>>代码示例>>Python>>正文


Python MultiPurposeList.__setitem__方法代码示例

本文整理汇总了Python中orgmode.liborgmode.documents.MultiPurposeList.__setitem__方法的典型用法代码示例。如果您正苦于以下问题:Python MultiPurposeList.__setitem__方法的具体用法?Python MultiPurposeList.__setitem__怎么用?Python MultiPurposeList.__setitem__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在orgmode.liborgmode.documents.MultiPurposeList的用法示例。


在下文中一共展示了MultiPurposeList.__setitem__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __setitem__

# 需要导入模块: from orgmode.liborgmode.documents import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.documents.MultiPurposeList import __setitem__ [as 别名]
	def __setitem__(self, i, item):
		if isinstance(i, slice):
			o = []
			o_tmp = item
			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(u_encode(item))
				else:
					o.append(item)
			MultiPurposeList.__setitem__(self, i, o)
		else:
			_i = item
			if type(_i) is unicode:
				_i = u_encode(item)

			# TODO: fix this bug properly, it is really strange that it fails on
			# python3 without it. Problem is that when _i = ['* '] it fails in
			# UserList.__setitem__() but if it is changed in debuggr in __setitem__
			# like item[0] = '* ' it works, hence this is some quirk with unicode
			# stuff but very likely vim 7.4 BUG too.
			if isinstance(_i, UserList) and sys.version_info > (3, ):
				_i = [s.encode('utf8').decode('utf8') for s in _i]

			MultiPurposeList.__setitem__(self, i, _i)
开发者ID:Ron89,项目名称:vim-orgmode,代码行数:28,代码来源:vimbuffer.py

示例2: __setitem__

# 需要导入模块: from orgmode.liborgmode.documents import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.documents.MultiPurposeList import __setitem__ [as 别名]
	def __setitem__(self, i, item):
		_i = item
		if type(_i) is unicode:
			_i = u_encode(item)

		# TODO: fix this bug properly, it is really strange that it fails on
		# python3 without it. Problem is that when _i = ['* '] it fails in
		# UserList.__setitem__() but if it is changed in debuggr in __setitem__
		# like item[0] = '* ' it works, hence this is some quirk with unicode
		# stuff but very likely vim 7.4 BUG too.
		if isinstance(_i, UserList) and sys.version_info > (3, ):
			_i = [s.encode('utf8').decode('utf8') for s in _i]

		MultiPurposeList.__setitem__(self, i, _i)
开发者ID:Yixf-Self,项目名称:vim-orgmode,代码行数:16,代码来源:vimbuffer.py

示例3: __setitem__

# 需要导入模块: from orgmode.liborgmode.documents import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.documents.MultiPurposeList import __setitem__ [as 别名]
	def __setitem__(self, i, item):
		_i = item
		if type(_i) is unicode:
			_i = item.encode(u'utf-8')

		MultiPurposeList.__setitem__(self, i, _i)
开发者ID:kongluoxing,项目名称:vimwiki-org,代码行数:8,代码来源:vimbuffer.py


注:本文中的orgmode.liborgmode.documents.MultiPurposeList.__setitem__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。