File: set_icon_macos.py

package info (click to toggle)
cherrytree 1.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 23,528 kB
  • sloc: cpp: 102,757; ansic: 14,613; xml: 1,532; sh: 374; python: 288; javascript: 80; ruby: 63; makefile: 9
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")