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


Python ShareYourSystem.getTypeStrWithKeyStr方法代码示例

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


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

示例1: do_set

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import getTypeStrWithKeyStr [as 别名]

#.........这里部分代码省略.........
						SettedReplaceValueVariablesList=self.getMapLambdaList(
							SettedTempValueVariable
						)

						#set
						self[SettedTempKeyVariable]=SettedReplaceValueVariablesList

						#Return
						return {'HookingIsBool':False}


				#/####################/#
				# Case of an instancing set
				#

				#Check
				if self.SettingTypeBool:

					#debug
					'''
					self.debug(
							[
								'we check if we have to set a default value here',
								('self.',self,[
									'SettingKeyVariable',
									'SettingValueVariable'
								])
							]
						)
					'''

					#get
					SettedValueType=SYS.getTypeClassWithTypeStr(
						SYS.getTypeStrWithKeyStr(
							self.SettingKeyVariable)
					)

					#type
					SettedSettingValueVariableType=type(self.SettingValueVariable)

					#cast
					if SettedSettingValueVariableType==unicode:
						self.SettingValueVariable=str(self.SettingValueVariable)
						SettedSettingValueVariableType=str
						
					#Check
					if SettedValueType!=SettedSettingValueVariableType:

						#debug
						'''
						self.debug(
								[
									'Check that the type is not a lst and a numpy array'
								]
							)
						'''
						
						#Check
						if set([
							SettedValueType.__name__,
							SettedSettingValueVariableType.__name__
						])!=SetListTypesSet:

							#debug
							'''
							self.debug(
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:70,代码来源:__init__.py

示例2: setDefaultMutable

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import getTypeStrWithKeyStr [as 别名]
def setDefaultMutable(
	_InstanceVariable,
	_ClassVariable,
	_AttributeKeyVariable=None,
	**_KwargVariablesDict
):
	
	#get
	DefaultClassesList=SYS.GetList(_ClassVariable,SYS)

	#Set
	if 'ForceSetIsBool' in _KwargVariablesDict:
		ForceSetIsBool=_KwargVariablesDict['ForceSetIsBool']
	else:
		ForceSetIsBool=False

	#/#################/#
	# Get all the attribute to default set again and filter 
	# the ones that have not the right
	#

	#Check
	if _AttributeKeyVariable==None:
		AttributeKeyStrsList=SYS.sum(
			map(
				lambda __DefaultClass:
				__DefaultClass.DefaultSpecificKeyStrsList,
				DefaultClassesList
			)
		)
	elif type(_AttributeKeyVariable)!=list:
		AttributeKeyStrsList=[AttributeKeyVariable]
	else:
		AttributeKeyStrsList=_AttributeKeyVariable
		
	#/################/#
	# map an init for the mutable variables by detecting them at the level of the class 
	# they are None
	#

	#map
	TypeClassesList=map(
			lambda __AttributeKeyStr:
			SYS.getTypeClassWithTypeStr(
				SYS.getTypeStrWithKeyStr(__AttributeKeyStr)
			)
			if (
					SYS.getIsNoneBool(
						getattr(
							_InstanceVariable,
							__AttributeKeyStr
						)
					) 
					if ForceSetIsBool==False 
					else True
				)
			and getattr(
				_InstanceVariable.__class__,
				__AttributeKeyStr
			)==None
			else None.__class__,
			AttributeKeyStrsList
	)

	#debug
	'''
	print('l 122 Defaultor')
	print('AttributeKeyStrsList is '+str(AttributeKeyStrsList))
	print('TypeClassesList is '+str(TypeClassesList))
	print('')
	'''

	#set in the instance
	map(
			lambda __AttributeKeyStr,__TypeClass:
			setattr(
					_InstanceVariable,
					__AttributeKeyStr,
					__TypeClass()
			)
			if __TypeClass!=None.__class__ 
			else None,
			AttributeKeyStrsList,
			TypeClassesList
	)

	#return 
	return _InstanceVariable
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:90,代码来源:__init__+copy+2.py

示例3: getattr

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import getTypeStrWithKeyStr [as 别名]
							DoClass.DoneAttributeTuplesList
						)

					#Define
					DoneKwargDict=dict(DoClass.DoneNotAttributeTupleItemsList)

				else:

					#Define
					DoneKwargDict={}

				#map
				TypeClassesList=map(
						lambda __DoneKeyStr:
						SYS.getTypeClassWithTypeStr(
								SYS.getTypeStrWithKeyStr(__DoneKeyStr)
						) if getattr(_InstanceVariable,__DoneKeyStr
						)==None else None.__class__,
						_Class.DoingAttributeVariablesOrderedDict.keys(
							)+_Class.DoneAttributeVariablesOrderedDict.keys()
				)

				#debug
				'''
				print('TypeClassesList is '+str(TypeClassesList))
				print('')
				'''

				#set in the instance
				map(
						lambda __DoneKeyStr,__TypeClass:
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:33,代码来源:__init__OOO.py

示例4: do_get

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import getTypeStrWithKeyStr [as 别名]

#.........这里部分代码省略.........

				else:

					#__getitem__ in the __class__
					self.GettedValueVariable=GettedClassValueVariable

				#debug
				'''
				self.debug(
							[
								'This is in the __class__',
								('self.',self,['GettedValueVariable'])
							]
						)
				'''

				#Stop the getting
				return {"HookingIsBool":False}

			elif self.GettingNewBool:

				#debug
				'''
				self.debug(
						[
							'we are going to set a default value here',
							('self.',self,['GettingKeyVariable'])
						]
					)
				'''

				#get
				GettedValueType=SYS.getTypeClassWithTypeStr(
					SYS.getTypeStrWithKeyStr(
						self.GettingKeyVariable)
				)

				#debug
				'''
				self.debug(
					[
						'GettedValueType is '+str(GettedValueType),
						('self.',self,['GettingKeyVariable'])
					]
				)
				'''
				
				#Check
				if callable(GettedValueType):

					#debug
					self.debug(
						[
							'We call here',
							'GettedValueType is '+str(GettedValueType),
							('self.',self,['GettingKeyVariable'])
						]
					)
					
					#alias
					self.GettedValueVariable=GettedValueType()

					#set a default value
					self.__setattr__(
						self.GettingKeyVariable,
						self.GettedValueVariable
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:70,代码来源:__init__.py

示例5: do_set

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import getTypeStrWithKeyStr [as 别名]

#.........这里部分代码省略.........
						)

				#Return stop the setting
				return {'HookingIsBool':False}

			#/####################/#
			# Case of a set in the __dict__
			#

			else:

				#/####################/#
				# Case of an instancing set
				#

				#Check
				if self.SettingTypeBool:

					#debug
					'''
					self.debug(
							[
								'we check if we have to set a default value here',
								('self.',self,[
									'SettingKeyVariable',
									'SettingValueVariable'
								])
							]
						)
					'''

					#get
					SettedValueType=SYS.getTypeClassWithTypeStr(
						SYS.getTypeStrWithKeyStr(
							self.SettingKeyVariable)
					)

					#Check
					if SettedValueType!=type(self.SettingValueVariable): 

						#debug
						'''
						self.debug(
							[
								'SettedValueType is '+str(SettedValueType)
							]
						)	
						'''

						#Check
						if SettedValueType!=None.__class__:

							#debug
							self.debug(
								[
									'we wrap the setting value',
									('self.',self,['SettingValueVariable'])
								]
							)

							#alias
							'''
							try:
							'''

							#map set
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:70,代码来源:__init__+copy.py

示例6: do_get

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import getTypeStrWithKeyStr [as 别名]

#.........这里部分代码省略.........

				#__getitem__ in the __class__
				self.GettedValueVariable=self.__class__.__dict__[
					self.GettingKeyVariable
				]

				#debug
				'''
				self.debug(
							[
								'This is in the __class__',
								('self.',self,['GettedValueVariable'])
							]
						)
				'''

				#Stop the getting
				return {"HookingIsBool":False}

			elif self.GettingNewBool:

				#debug
				'''
				self.debug(
						[
							'we are going to set a default value here',
							('self.',self,['GettingKeyVariable'])
						]
					)
				'''

				#get
				GettedValueType=SYS.getTypeClassWithTypeStr(
					SYS.getTypeStrWithKeyStr(
						self.GettingKeyVariable)
				)

				#debug
				'''
				self.debug('GettedValueType is '+str(GettedValueType))
				'''

				#Check
				if callable(GettedValueType):

					#alias
					self.GettedValueVariable=GettedValueType()

					#set a default value
					self.__setattr__(
						self.GettingKeyVariable,
						self.GettedValueVariable
					)

					#add in the SettingValue
					try:
						self.GettedValueVariable.SetTagStr=self.GettingKeyVariable
					except:
						pass

				#Stop the getting
				return {"HookingIsBool":False}


		#/############################
		# Cases of a dict GetVariable get 
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:70,代码来源:__init__+copy+2.py


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