code: def loadIcon(self, fileName, color=None):
          
          if not fileName:
              return None
  
          key = (fileName, color)
          if key not in self._icons:
              try:
                  with open(fileName, 'r') as input:
                      svg = input.read()
  
                  self._icons[key] = self.createIconFromSvg(svg, color=color)
              except Exception as ex:
                  # It's preferable to show no icon in case of an error rather than letting
                  # the application fail. Icons are a (very) nice to have.
                  logger.warn("Unable to read icon: {}".format(ex))
                  if DEBUGGING:
                      raise
                  else:
                      return None
  
          return self._icons[key]
docs: Reads SVG from a file name and creates an QIcon from it.
  
              Optionally replaces the color. Caches the created icons.
  
              :param fileName: absolute path to an icon file.
                  If False/empty/None, None returned, which yields no icon.
              :param color: '#RRGGBB' string (e.g. '#FF0000' for red)
              :return: QtGui.QIcon