File: set_icon_macos.py

package info (click to toggle)
cherrytree 0.99.48%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,280 kB
  • sloc: cpp: 95,372; ansic: 14,613; xml: 1,047; sh: 306; python: 198; javascript: 80; ruby: 63; makefile: 10
file content (4 lines) | stat: -rw-r--r-- 233 bytes parent folder | download | duplicates (3)
1
2
3
4
import Cocoa
import sys

Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(Cocoa.NSImage.alloc().initWithContentsOfFile_(sys.argv[1].decode('utf-8')), sys.argv[2].decode('utf-8'), 0) or sys.exit("Unable to set file icon")