File: profile-ppds.py

package info (click to toggle)
system-config-printer 1.5.11-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,328 kB
  • sloc: python: 22,047; sh: 4,780; ansic: 1,472; xml: 798; makefile: 370
file content (13 lines) | stat: -rw-r--r-- 345 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python3
import cups
import cupshelpers
import hotshot
import hotshot.stats

ppds = cupshelpers.ppds.PPDs (cups.Connection ().getPPDs ())
prof = hotshot.Profile ("a.prof")
prof.runcall (lambda: ppds.getPPDNameFromDeviceID('','',''))
prof.close ()
stats = hotshot.stats.load ("a.prof")
stats.sort_stats ('time')
stats.print_stats (100)