def setIcon(filePath, icnsPath):
 dirPath = os.path.normpath(os.path.dirname(__file__))
 toolPath = os.path.join(dirPath, 'seticon.app/Contents/MacOS/seticon')
 if ((not os.path.exists(toolPath)) or (os.stat(toolPath).st_mtime < os.stat((dirPath + '/seticon.m')).st_mtime)):
  appPath = os.path.join(dirPath, 'seticon.app/Contents/MacOS')
  if (not os.path.exists(appPath)):
   os.makedirs(appPath)
  runCommand(('cc -o %s %s/seticon.m -framework Cocoa' % (shellQuote(toolPath), shellQuote(dirPath))))
 runCommand(('%s %s %s' % (shellQuote(os.path.abspath(toolPath)), shellQuote(icnsPath), shellQuote(filePath))))

def setIcon ( filePath , icnsPath ) : dirPath = os . path . normpath ( os . path . dirname ( __file__ ) ) toolPath = os . path . join ( dirPath , 'seticon.app/Contents/MacOS/seticon' ) if ( ( not os . path . exists ( toolPath ) ) or ( os . stat ( toolPath ) . st_mtime < os . stat ( ( dirPath + '/seticon.m' ) ) . st_mtime ) ) : appPath = os . path . join ( dirPath , 'seticon.app/Contents/MacOS' ) if ( not os . path . exists ( appPath ) ) : os . makedirs ( appPath ) runCommand ( ( 'cc -o %s %s/seticon.m -framework Cocoa' % ( shellQuote ( toolPath ) , shellQuote ( dirPath ) ) ) ) runCommand ( ( '%s %s %s' % ( shellQuote ( os . path . abspath ( toolPath ) ) , shellQuote ( icnsPath ) , shellQuote ( filePath ) ) ) )
set the custom icon for the specified file or directory .