File: set_icon_macos.py

package info (click to toggle)
cherrytree 0.99.30%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,672 kB
  • sloc: cpp: 91,646; ansic: 14,611; xml: 1,054; sh: 195; python: 187; javascript: 80; 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")