Permalink
Browse files

Github issue #5 - Added prefix support

  • Loading branch information...
simoncadman committed Apr 19, 2012
1 parent 993f633 commit 49b8eb4be075873c9f61ed5a0aece904c977882b
Showing with 6 additions and 2 deletions.
  1. +6 −2 setupcloudprint.py
View
@@ -41,7 +41,11 @@
if not ( answer.startswith("Y") or answer.startswith("y") ):
print "Not adding printers automatically"
sys.exit(0)
-
+
+prefix = raw_input("Use a prefix for names of created printers ( e.g. GCP- )? ")
+if prefix == "":
+ print "Not using prefix"
+
connection = cups.Connection()
cupsprinters = connection.getPrinters()
@@ -60,7 +64,7 @@
if cupsprinters[cupsprinter]['device-uri'] == uri:
found = True
if found == False:
- Printer.AddPrinter(printer['name'], uri, connection)
+ Printer.AddPrinter(prefix + printer['name'], uri, connection)
addedCount+=1
if addedCount > 0:

0 comments on commit 49b8eb4

Please sign in to comment.