def _initErrorMessage(self):
        res = []
        requiredBy = {}
        for (reqInfo, suggList) in self.suggMap.iteritems():
            for sugg in sorted(suggList):
               if sugg in requiredBy:
                    requiredBy[sugg].append(reqInfo)
               else:
                    requiredBy[sugg] = [reqInfo]
        numPackages = len(requiredBy)
        if numPackages == 1:
            res.append("%s additional trove is needed:" % numPackages)
        else:
            res.append("%s additional troves are needed:" % numPackages)
        for (suggInfo, reqList) in sorted(requiredBy.iteritems()):
            res.append("    %s is required by:" %  self.formatNVF(suggInfo))
            for reqInfo in sorted(reqList):
                res.append('       %s' % self.formatNVF(reqInfo))
        return '\n'.join(res)
dataset/ETHPy150Open sassoftware/conary/conary/conaryclient/update.py/NeededTrovesFailure._initErrorMessage/original