コード例 #1
0
	def mimic__print(self,**_KwargVariablesDict):

		#/##################/#
		# Modify the printing Variable
		#

		#Check
		if self.PrintingSelfBool:

			#Check
			if self.PrintingCopyVariable.ConnectToVariable!=None:

				self.PrintingCopyVariable.ConnectToVariable=Printer.getPointerStr(
					self.PrintingCopyVariable.ConnectToVariable
				)
				
			else:

				#append
				self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList.append('ConnectToVariable')

				#debug
				'''
				print('Connecter l 325')
				print('Remove ConnectToVariable')
				print('self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList is ')
				print(self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList)
				print('')
				'''

			#Check
			if self.PrintingCopyVariable.ConnectFromVariable!=None:

				self.PrintingCopyVariable.ConnectFromVariable=Printer.getPointerStr(
					self.PrintingCopyVariable.ConnectFromVariable
				)
				
			else:

				#append
				self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList.append('ConnectFromVariable')

				#debug
				'''
				print('Connecter l 514')
				print('Remove ConnectFromVariable')
				print('self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList is ')
				print(self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList)
				print('')
				'''
				
		#/##################/#
		# Call the base method
		#

		#call
		BaseClass._print(self,**_KwargVariablesDict)
コード例 #2
0
def getAttestedStrWithStrsList(_StrsList):

	#Definition globals
	global AttestingBeginStr,AttestingJumpStr,AttestingEndStr

	#Reinit the alinea
	Printer.RepresentedAlineaStr=""
	Printer.RepresentedAlreadyVariablesList=[]

	#Init AttestedStr
	AttestedStr=AttestingBeginStr

	#Add attested Strs
	AttestedStr+=AttestingJumpStr.join(
		map(
			lambda __Str:
			Printer.represent(str(__Str),**{'PrintAlineaIsBool':False}),
			_StrsList
		)
	)

	#End the AttestedStr
	AttestedStr+=AttestingEndStr
	
	#Return
	return AttestedStr
コード例 #3
0
def writeAttestedStrWithFolderPathStrAndMethodStrAndAttestVariable(
	_FolderPathStr,_MethodStr,_AttestVariable):

	#Bind with TestedStr setting
	Printer.PrintIdBool=False
	AttestedStr=Printer.getPrintStr(_AttestVariable)
	Printer.PrintIdBool=True

	#Debug
	'''
	print('l 52 Attester')
	print('_FolderPathStr is ',_FolderPathStr)
	print('')
	'''

	#Check that there is a Folder Tests
	if os.path.isdir(_FolderPathStr)==False:
		os.popen('mkdir '+_FolderPathStr)
	elif os.popen("ls "+_FolderPathStr).read()!="":
		os.popen("cd "+_FolderPathStr+";rm *")

	#Write the TestedStr
	File=open(_FolderPathStr+_MethodStr+'.txt','w')
	File.write(AttestedStr)
	File.close()
コード例 #4
0
	def test(_InstanceVariable):

		#Debug
		'''
		print('Tester l 62')
		print('_FolderPathStr is '+_FolderPathStr)
		print('AttestUnboundMethodStr is '+AttestUnboundMethodStr)
		print('')
		'''
		
		#Get the AssertedStr
		File=open(_FolderPathStr+AttestUnboundMethodStr+'.txt','r')
		AttestStr=File.read()
		File.close()

		#Call the attest function to get the TestVariable
		TestVariable=_AttestUnboundMethod(
						getattr(
							SYS,
							SYS.getClassStrWithNameStr(
								TestModule.__name__.split('.')[-1]
								if '.' in TestModule.__name__ else TestModule
							)
						)()
					)

		#Bind with TestStr setting
		Printer.RepresentingIdBool=False
		TestStr=Printer.getPrintStr(TestVariable)
		Printer.RepresentingIdBool=True

		#Represent maybe
		if TestModule.TestingPrintIsBool:

			#debug
			print("\n###########################################")
			print("")
			print('AttestStr is :')
			print(AttestStr)
			print("")

			#debug
			print('TestStr is :')
			print(TestStr)
			print("")

		#Assert
		#print("a",AssertingStr)
		#print("b",_InstanceVariable.TestedPointer.TestStr)

		#assert
		_InstanceVariable.assertEqual(
				#1,1
				AttestStr,
				TestStr
		)
コード例 #5
0
	def mimic__print(self,**_KwargVariablesDict):

		#/##################/#
		# Modify to see maybe ConnectedToVariable
		#

		#Check
		if self.PrintingSelfBool:

			#Check
			if self.ConnectedToVariable!=None:

				#/##################/#
				# Add in the pointer descrp
				#	

				#add
				self.PrintingCopyVariable.PrintingInfoStr+=' ->'+str(
					id(self.ConnectedToVariable)
				)

				#/##################/#
				# Stringify
				#

				self.PrintingCopyVariable.ConnectedToVariable=Printer.getPointerStr(
					self.PrintingCopyVariable.ConnectedToVariable
				)
				
			else:

				#append
				self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList.append('ConnectedToVariable')

				#debug
				'''
				print('Connecter l 325')
				print('Remove ConnectedToVariable')
				print('self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList is ')
				print(self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList)
				print('')
				'''
			
		
		#/##################/#
		# Call the base method
		#

		#call
		BaseClass._print(self,**_KwargVariablesDict)
コード例 #6
0
	def getParenterStr(self):

		#get
		ParenterStr=Printer.getPointerStr(
						self
					)

		#Check
		if self.TeamedOnceBool:
			ParenterStr+=' with : '+str(self.TeamDict.keys())
		elif self.ManagedOnceBool:
			ParenterStr+=' with : '+str(self.ManagementDict.keys())

		#return
		return ParenterStr
コード例 #7
0
	def mimic__print(self,**_KwargVariablesDict):

		#debug
		'''
		print('Parenter 525')
		print('self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList is ')
		print(self.PrintingCopyVariable.PrintingInstanceSkipKeyStrsList)
		print('')
		'''
		
		#/##################/#
		# Modify the printing Variable
		#

		#Check
		if self.PrintingSelfBool:

			#map
			map(
					lambda __ItemTuple:
					self.PrintingCopyVariable.TeamDict.__setitem__(
						__ItemTuple[0],
						Printer.getPointerStr(__ItemTuple[1])+" (Empty)"
					) 
					if hasattr(
						__ItemTuple[1],'ManagementDict'
					) and len(__ItemTuple[1].ManagementDict)==0
					else None,
					self.PrintingCopyVariable.TeamDict.items()
				)

		#Check
		if self.ParentedTotalPathStr!="":

			#Check
			if hasattr(self.PrintingCopyVariable,'PrintingInfoStr'):

				#add
				self.PrintingCopyVariable.PrintingInfoStr+=' ^'

			
		#/##################/#
		# Call the base method
		#

		#call
		BaseClass._print(self,**_KwargVariablesDict)