docs: def qt4_menu_nib_dir():
      """Return path to Qt resource dir qt_menu.nib."""
      menu_dir = ''
      # Detect MacPorts prefix (usually /opt/local).
      # Suppose that PyInstaller is using python from macports.
      macports_prefix = sys.executable.split('/Library')[0]
      # list of directories where to look for qt_menu.nib
      dirs = [
          # Qt4 from MacPorts not compiled as framework.
          os.path.join(macports_prefix, 'lib', 'Resources'),
          # Qt4 from MacPorts compiled as framework.
          os.path.join(macports_prefix, 'libexec', 'qt4-mac', 'lib',
              'QtGui.framework', 'Versions', '4', 'Resources'),
          # Qt4 installed into default location.
          '/Library/Frameworks/QtGui.framework/Resources',
          '/Library/Frameworks/QtGui.framework/Versions/4/Resources',
          '/Library/Frameworks/QtGui.Framework/Versions/Current/Resources',
      ]
      # Check directory existence
      for d in dirs:
          d = os.path.join(d, 'qt_menu.nib')
          if os.path.exists(d):
              menu_dir = d
              break
  
      if not menu_dir:
          logger.error('Cannont find qt_menu.nib directory')
      return menu_dir