docs: def buildResourceFile(rscpath, outpath=''):
      """
      Generates a Qt resource module based on the given source path.  This will
      take all the files and folders within the source and generate a new XML
      representation of that path.  An optional outpath can be provided as the
      generated resource path, by default it will be called the name of the
      source path.
      
      :param      rscpath | <str>
                  buildpath | <str>
      """
      import xqt
      wrapper = QT_WRAPPER.lower()
      if not outpath:
          name = os.path.basename(rscpath).split('.')[0]
          filename = '{0}_{1}_rc.py'.format(wrapper, name)
          outpath = os.path.join(os.path.dirname(rscpath), filename)
      elif os.path.isdir(outpath):
          name = os.path.basename(rscpath).split('.')[0]
          filename = '{0}_{1}_rc.py'.format(wrapper, name)
          outpath = os.path.join(outpath, filename)
      
      # try to use Qt first, because it is so much better
      PYQT_RCC_EXE = os.environ.get('PYQT_RCC_EXE', 'pyrcc4')
      try:
          subprocess.call([PYQT_RCC_EXE, '-o', outpath, rscpath])
          used_pyqt = True
      except StandardError:
          used_pyqt = False
  
      if not used_pyqt:
          # make sure it is not outdated
          try:
              subprocess.call([xqt.rcc_exe, '-o', outpath, rscpath])
          except StandardError:
              exe = xqt.rcc_exe
              msg = 'You need to add the path to {0} to your system Path.'
              logger.error(msg.format(exe))
              return False
      
      # make sure we actually generated a file
      if not os.path.exists(outpath):
          logger.error('Failed to generate output file: {0}'.format(outpath))
          return False
      
      # map the output back to PySide if necessary
      if QT_WRAPPER == 'PySide' and used_pyqt:
          # clean up resource file
          with open(outpath, 'r') as f:
              data = f.read()
          
          data = data.replace('PyQt4', 'xqt')
          
          with open(outpath, 'w') as f:
              f.write(data)
      
      return True