Debian Codegraph @

util/find_clrt_profiles.py

raw
1 #!/usr/bin/env python3
2 import os
3 import sys
4
5 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
6
7 from DisplayCAL import ICCProfile as iccp
8 from DisplayCAL.defaultpaths import ICCPROFILES, ICCPROFILES_HOME
9
10
11 def main():
12 for p in set(ICCPROFILES_HOME + ICCPROFILES):
13 if not os.path.isdir(p):
14 continue
15 for f in os.listdir(p):
16 try:
17 profile = iccp.ICCProfile(os.path.join(p, f))
18 except Exception:
19 pass
20 if not "clrt" in profile.tags:
21 continue
22 print(f)
23 print(profile.connectionColorSpace)
24 for name in profile.tags.clrt:
25 print(name, profile.tags.clrt[name])
26 print("")
27
28
29 if __name__ == "__main__":
30 main()