""" A class which represents the result of a function on a buildroot object """ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2004 Dries Verachtert from log4py import Logger class BuildRootResult: def getContainsErrorsText(self): if self.containsErrors(): return "The log contains errors.\n" else: return "The log contains no errors.\n" def __init__(self,buildrootobj): self.__buildrootobj = buildrootobj self.__containsErrors = 0 self.__containsWarnings = 0 self.__logText = "" self.__srpm = "" self.__rpms = [] #self.__buildlog = "" #self.__configlog = "" def append(self, brr): if brr.containsErrors(): self.__containsErrors = 1 if brr.containsWarnings(): self.__containsWarnings = 1 self.__logText = self.__logText + "\n" + brr.getLog() self.__srpm = self.__srpm + brr.getSrpm() for i in brr.getRpms(): self.__rpms.append(i) def containsErrors(self): return self.__containsErrors def containsWarnings(self): return self.__containsWarnings def getLog(self): return self.__logText def logErrorLine(self,line): self.__logText = self.__logText + "ERROR:" + line + "\n" print "ERROR:" + line self.__containsErrors = 1 def logDebugLine(self,line): self.__logText = self.__logText + line + "\n" print line def getRpms(self): return self.__rpms def addRpm(self,rpmName): self.__rpms.append(rpmName) def getSrpm(self): return self.__srpm def setSrpm(self,srpm): self.__srpm = srpm #def getBuildLog(self): # return self.__buildlog #def getConfigLog(self): # return self.__configlog