File: cd-icc.py

package info (click to toggle)
colord 1.4.8-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,336 kB
  • sloc: ansic: 48,896; xml: 24,173; python: 79; sh: 70; makefile: 48; cpp: 38
file content (30 lines) | stat: -rwxr-xr-x 834 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python

# Copyright(C) 2013 Richard Hughes <richard@hughsie.com>
# Licensed under the GNU General Public License Version 2

from __future__ import print_function

from gi.repository import Colord
from gi.repository import Gio

import os
import locale

locale.setlocale(locale.LC_ALL, '')

# parse file
icc = Colord.Icc.new()
f = Gio.file_new_for_path('/usr/share/color/icc/colord/sRGB.icc')
cancellable = Gio.Cancellable.new()
icc.load_file(f, Colord.IccLoadFlags.METADATA, cancellable)

# get details about the profile
print("Filename:", icc.get_filename())
print("License:", icc.get_metadata_item("License"))

# get translated UTF-8 strings where available
locale = os.getenv("LANG")
print("Description:", icc.get_description(locale))
print("Model:", icc.get_model(locale))
print("Copyright:", icc.get_copyright(locale))