Permalink
Browse files

Added version param to scripts

  • Loading branch information...
simoncadman committed Sep 11, 2013
1 parent c0449b4 commit 215ada7afcaa06a5ef8f01a14faffdc29d7087fd
Showing with 53 additions and 3 deletions.
  1. +6 −0 backend.py
  2. +7 −1 deleteaccount.py
  3. +8 −1 dynamicppd.py
  4. +6 −0 listcloudprinters.py
  5. +7 −0 reportissues.py
  6. +7 −1 setupcloudprint.py
  7. +6 −0 submitjob.py
  8. +6 −0 upgrade.py
View
@@ -18,6 +18,12 @@
import sys, os, subprocess, mimetypes
progname = 'cloudprint'
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
+ sys.exit(0)
+
def fileIsPDF ( filename ) :
"""Check if a file is or isnt a PDF
View
@@ -15,9 +15,15 @@
# 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 cups, os, json
+import cups, os, json, sys
from auth import Auth
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
+ sys.exit(0)
+
while True:
result = Auth.SetupAuth(False)
if not result:
View
@@ -16,6 +16,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, os, locale
+
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
+ sys.exit(0)
+
libpath = "/usr/local/lib/cloudprint-cups/"
if not os.path.exists( libpath ):
libpath = "/usr/lib/cloudprint-cups"
@@ -25,7 +32,7 @@
from printer import Printer
def showUsage():
- sys.stderr.write("ERROR: Usage: " + sys.argv[0] + " [list|cat drivername]\n")
+ sys.stderr.write("ERROR: Usage: " + sys.argv[0] + " [list|version|cat drivername]\n")
sys.exit(1)
requestors, storage = Auth.SetupAuth(False)
View
@@ -19,6 +19,12 @@
from auth import Auth
from printer import Printer
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print Printer Lister Version " + CCPVersion
+ sys.exit(0)
+
requestors, storage = Auth.SetupAuth(True)
printer = Printer(requestors)
printers = printer.getPrinters()
View
@@ -16,6 +16,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, os, subprocess
+
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion
+ sys.exit(0)
+
libpath = "/usr/local/lib/cloudprint-cups/"
if not os.path.exists( libpath ):
libpath = "/usr/lib/cloudprint-cups"
View
@@ -15,10 +15,16 @@
# 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 cups, os, json
+import cups, os, json, sys
from auth import Auth
from printer import Printer
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print Setup Script Version " + CCPVersion
+ sys.exit(0)
+
if os.path.exists(Auth.config):
try:
content_file = open(Auth.config, 'r')
View
@@ -19,6 +19,12 @@
from auth import Auth
from printer import Printer
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print Submit Job Version " + CCPVersion
+ sys.exit(0)
+
if ( len(sys.argv) < 6 ):
sys.stderr.write("ERROR: Usage: " + sys.argv[0] + " pdf-file page-title printer-uri cups-printer-name options\n")
sys.exit(1)
View
@@ -20,6 +20,12 @@
from oauth2client import multistore_file
from auth import Auth
+if len(sys.argv) == 2 and sys.argv[1] == 'version':
+ # line below is replaced on commit
+ CCPVersion = "20130911"
+ print "CUPS Cloud Print Upgrade Script Version " + CCPVersion
+ sys.exit(0)
+
connection = cups.Connection()
cupsprinters = connection.getPrinters()

0 comments on commit 215ada7

Please sign in to comment.