Skip to content
Permalink
Browse files

Added script to dump out capabilities to report issues

  • Loading branch information
simoncadman committed Jun 3, 2013
1 parent 5994f4b commit 898221cf41db3d4ef468dd237ef506b488b8e4db
Showing with 38 additions and 0 deletions.
  1. +38 −0 reportissues.py
@@ -0,0 +1,38 @@
#! /usr/bin/env python2
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2013 Simon Cadman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import sys, os
libpath = "/usr/lib/cloudprint-cups/"
if not os.path.exists( libpath ):
libpath = "/usr/local/lib/cloudprint-cups"
sys.path.insert(0, libpath)

from auth import Auth
from printer import Printer

requestors, storage = Auth.SetupAuth(False)
printer = Printer(requestors)
printers = printer.getPrinters(True)
if printers == None:
print("ERROR: No Printers Found")
sys.exit(1)

for foundprinter in printers:
print('"cupscloudprint:' + foundprinter['account'].encode('ascii', 'replace').replace(' ', '-') +':' + foundprinter['name'].encode('ascii', 'replace').replace(' ', '-') + '.ppd" en "Google" "' + foundprinter['name'].encode('ascii', 'replace') + ' (' + foundprinter['account'] + ')" "MFG:GOOGLE;DRV:GCP;CMD:POSTSCRIPT;MDL:' + printer.printerNameToUri( foundprinter['account'], foundprinter['name'] ) +';"')
print("")
print(foundprinter['fulldetails'])
print("\n")

0 comments on commit 898221c

Please sign in to comment.
You can’t perform that action at this time.