Exemplo n.º 1
0
	def __init__(self, name, attribute):
		'''
		Constructor
		@summary: Print text from file
		@param name: Attribute name
		@param attribute: Attribute value (path to a txt file)
		'''
		CustomAttribute.__init__(self, name, attribute)
		self._display = False
Exemplo n.º 2
0
	def __init__(self, name, attribute):
		'''
		Constructor
		@summary: Print compare information from different xml files
		@param name: Attribute name
		@param attribute: Attribute value (path to a xml files separated by '|')
		'''
		CustomAttribute.__init__(self, name, attribute)
		self._display = False
		
		self._files = str.split(str(attribute), '|')
		
		self._mylookup = TemplateLookup(directories=['./templates'])
Exemplo n.º 3
0
	def __init__(self, name, attribute):
		'''
		Constructor
		@summary: move image and create thumb
		@param name: attributte name
		@param attribute: Attribute value
		Attribute value must of this form : folderName=imagePath|folderName=imagePath|..
		with folder name : the image type which also is the folder name (example : reference, screenshot, difference...)
		imagePath : path to the image
		'''
		CustomAttribute.__init__(self, name, attribute)
		self._display = False
		self.imageList = {}
		args = self._attribute.split('|')
		
		for a in args:
			folder = a.split('=')[0]
			self.imageList[folder] = []
			files = a.split('=')[1]
			externalPath = files.split(';')[0]
			filenames = str(files.split(';')[1]).split(',')
			
			internalPath = TestReport.TestReport.extpath + folder + os.sep
			
			if not os.path.exists(internalPath):
				os.mkdir(internalPath)
			
			for filename in filenames:
				if filename != "":
						
					shutil.copyfile(os.path.join(externalPath, filename), internalPath + filename)
					
					self.resizeImg(filename, internalPath)
					
					#save only the file name without extension
					self.imageList[folder].append(filename.split('.')[0])