def __GetSingleImageTag(self, mainDir, filename, width, height, link = None): if (filename == None): return "Missing File" filename = FUtils.GetHtmlRelativePath(filename, mainDir) ext = FUtils.GetExtension(filename) if (link == None): link = filename else: link = FUtils.GetHtmlRelativePath(link, mainDir) tag = "<a href=\"" + link + "\"><img " if (FUtils.IsImageFile(ext)): tag = tag + "src=\"" + filename + "\" border=\"0\" " elif (ext == "dae"): tag = tag + "alt=\"Collada File\" border=\"1\" " elif (ext == "max"): tag = tag + "alt=\"Max File\" border=\"1\" " elif (ext == "mb"): tag = tag + "alt=\"Maya Binary File\" border=\"1\" " elif (ext == "ma"): tag = tag + "alt=\"Maya Ascii File\" border=\"1\" " else: tag = tag + "alt=\"Ext: " + ext + "\" border=\"1\" " return (tag + "" + "width=\"" + str(width) + "\" height=\"" + str(height) + "\"></a>")
def __eq__(self, other): if other is None: return False if (self.__comments != other.__comments): return False if (self.__environment != other.__environment): return False if (self.__crashIndices != other.__crashIndices): return False if (self.__judgingResults != other.__judgingResults): return False if (self.__checksum != other.__checksum): return False # Do not compare judging logs. # Do not compare time ran. if (len(self.__errorCounts) != len(other.__errorCounts)): return False for i in range(len(self.__errorCounts)): if (self.__errorCounts[i] != other.__errorCounts[i]): return False if (len(self.__warningCounts) != len(other.__warningCounts)): return False for i in range(len(self.__warningCounts)): if (self.__warningCounts[i] != other.__warningCounts[i]): return False # Do not compare log locations. if (len(self.__outputLocations) != len(other.__outputLocations)): return False for i in range(len(self.__outputLocations)): # validation if ((type(self.__outputLocations[i]) is types.StringType) and (type(other.__outputLocations[i]) is types.StringType)): continue if ((self.__outputLocations[i] == None) and (other.__outputLocations[i] == None)): continue if ((self.__outputLocations[i] == None) or (other.__outputLocations[i] == None)): return False if (len(self.__outputLocations[i]) != len( other.__outputLocations[i])): return False for j in range(len(self.__outputLocations[i])): #todo what happens if file not there ext = FUtils.GetExtension(self.__outputLocations[i][j]) if (FUtils.IsImageFile(ext)): compareResult = FGlobals.imageComparator.CompareImages( self.__outputLocations[i][j], other.__outputLocations[i][j]) if (not compareResult.GetResult()): return False return True
def __IsRecognizable(self, filename): extension = FUtils.GetExtension(filename) return FUtils.IsImageFile(extension)