parameters: (self, info_plist)
docstring: This writes the PkgInfo file from the data stored in Info.plist.
docstring_summary: This writes the PkgInfo file from the data stored in Info.plist.
docstring_tokens: This writes the PkgInfo file from the data stored in Info . plist .
function: def _WritePkgInfo(self, info_plist):
      """This writes the PkgInfo file from the data stored in Info.plist."""
      plist = plistlib.readPlist(info_plist)
      if not plist:
        return
  
      # Only create PkgInfo for executable types.
      package_type = plist['CFBundlePackageType']
      if package_type != 'APPL':
        return
  
      # The format of PkgInfo is eight characters, representing the bundle type
      # and bundle signature, each four characters. If that is missing, four
      # '?' characters are used instead.
      signature_code = plist.get('CFBundleSignature', '????')
      if len(signature_code) != 4:  # Wrong length resets everything, too.
        signature_code = '?' * 4
  
      dest = os.path.join(os.path.dirname(info_plist), 'PkgInfo')
      with open(dest, 'w') as fp:
        fp.write('%s%s' % (package_type, signature_code))
function_tokens: def _WritePkgInfo ( self , info_plist ) : plist = plistlib . readPlist ( info_plist ) if not plist : return # Only create PkgInfo for executable types. package_type = plist [ 'CFBundlePackageType' ] if package_type != 'APPL' : return # The format of PkgInfo is eight characters, representing the bundle type # and bundle signature, each four characters. If that is missing, four # '?' characters are used instead. signature_code = plist . get ( 'CFBundleSignature' , '????' ) if len ( signature_code ) != 4 : # Wrong length resets everything, too. signature_code = '?' * 4 dest = os . path . join ( os . path . dirname ( info_plist ) , 'PkgInfo' ) with open ( dest , 'w' ) as fp : fp . write ( '%s%s' % ( package_type , signature_code ) )