Permalink
Browse files

Added PPD refresh postinstall script

  • Loading branch information...
simoncadman committed Aug 11, 2012
1 parent 4e2044c commit a71d0e99371edeed1384438a75570778959a99a5
Showing with 15 additions and 0 deletions.
  1. +15 −0 refreshppd.py
View
@@ -0,0 +1,15 @@
+#! /usr/bin/env python2.7
+
+import sys, os, grp, getpass, cups, subprocess
+
+connection = cups.Connection()
+cupsprinters = connection.getPrinters()
+
+for device in cupsprinters:
+ if ( cupsprinters[device]["device-uri"].find("cloudprint://") == 0 ):
+ print "Updating " + cupsprinters[device]["printer-info"]
+
+ p = subprocess.Popen(["lpadmin", "-p", cupsprinters[device]["printer-info"], "-m", "CloudPrint.ppd"], stdout=subprocess.PIPE)
+ output = p.communicate()[0]
+ result = p.returncode
+ sys.stderr.write(output)

0 comments on commit a71d0e9

Please sign in to comment.