diff --git a/backend.py b/backend.py index 9223fd2..79d2fbc 100755 --- a/backend.py +++ b/backend.py @@ -20,7 +20,7 @@ if len(sys.argv) == 2 and sys.argv[1] == 'version': # line below is replaced on commit - CCPVersion = "20140203 212134" + CCPVersion = "20140203 212709" print "CUPS Cloud Print CUPS Backend Version " + CCPVersion sys.exit(0) diff --git a/deleteaccount.py b/deleteaccount.py index 7415e92..27db018 100755 --- a/deleteaccount.py +++ b/deleteaccount.py @@ -21,7 +21,7 @@ if len(sys.argv) == 2 and sys.argv[1] == 'version': # line below is replaced on commit - CCPVersion = "20140203 212134" + CCPVersion = "20140203 212709" print "CUPS Cloud Print Delete Account Script Version " + CCPVersion sys.exit(0) diff --git a/dynamicppd.py b/dynamicppd.py index ebe4d28..7d00fe5 100755 --- a/dynamicppd.py +++ b/dynamicppd.py @@ -19,7 +19,7 @@ if len(sys.argv) == 2 and sys.argv[1] == 'version': # line below is replaced on commit - CCPVersion = "20140203 212134" + CCPVersion = "20140203 212709" print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion sys.exit(0) diff --git a/listcloudprinters.py b/listcloudprinters.py index 8e217de..22ec783 100755 --- a/listcloudprinters.py +++ b/listcloudprinters.py @@ -28,7 +28,7 @@ if len(sys.argv) == 2 and sys.argv[1] == 'version': # line below is replaced on commit - CCPVersion = "20140203 212134" + CCPVersion = "20140203 212709" print "CUPS Cloud Print Printer Lister Version " + CCPVersion sys.exit(0) diff --git a/listdrivefiles.py b/listdrivefiles.py index 26f1f7d..282eb16 100755 --- a/listdrivefiles.py +++ b/listdrivefiles.py @@ -21,7 +21,7 @@ if len(sys.argv) == 2 and sys.argv[1] == 'version': # line below is replaced on commit - CCPVersion = "20140203 212134" + CCPVersion = "20140203 212709" print "CUPS Cloud Print Printer Drive Lister Version " + CCPVersion sys.exit(0) diff --git a/reportissues.py b/reportissues.py index 9bfe81c..851ea38 100755 --- a/reportissues.py +++ b/reportissues.py @@ -19,7 +19,7 @@ if len(sys.argv) == 2 and sys.argv[1] == 'version': # line below is replaced on commit - CCPVersion = "20140203 212134" + CCPVersion = "20140203 212709" print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion sys.exit(0) diff --git a/setupcloudprint.py b/setupcloudprint.py index 3e8e13a..de79c88 100755 --- a/setupcloudprint.py +++ b/setupcloudprint.py @@ -21,7 +21,7 @@ if len(sys.argv) == 2 and sys.argv[1] == 'version': # line below is replaced on commit - CCPVersion = "20140203 212134" + CCPVersion = "20140203 212709" print "CUPS Cloud Print Setup Script Version " + CCPVersion sys.exit(0) diff --git a/test_auth.py b/test_auth.py index a90458b..e8f6e8d 100755 --- a/test_auth.py +++ b/test_auth.py @@ -59,7 +59,7 @@ def test_fixConfigOwnerships(): def test_setupAuth(): # create initial file assert os.path.exists(Auth.config) == False - assert Auth.SetupAuth(False) == False + assert Auth.SetupAuth(False) == (False, False) assert os.path.exists(Auth.config) == True # ensure permissions are correct after creating config @@ -88,7 +88,7 @@ def test_setupAuth(): @pytest.mark.skipif( grp.getgrnam('lp').gr_gid not in ( os.getgroups() ) and os.getuid() != 0 , reason="will only pass if running user part of lp group or root") def test_setupAuthOwnership(): - assert Auth.SetupAuth(False) == False + assert Auth.SetupAuth(False) == (False, False) # ensure ownership is correct after creating config assert Auth.GetLPID() == os.stat(Auth.config).st_gid diff --git a/upgrade.py b/upgrade.py index 1d5c797..3ea69d3 100755 --- a/upgrade.py +++ b/upgrade.py @@ -41,7 +41,7 @@ sys.stderr.write("If you are upgrading from version 20131013 or earlier you should be aware that the scripts have moved from /usr/lib/cloudprint-cups to /usr/share/cloudprint-cups\n") # line below is replaced on commit -CCPVersion = "20140203 212134" +CCPVersion = "20140203 212709" if len(sys.argv) == 2 and sys.argv[1] == 'version': print "CUPS Cloud Print Upgrade Script Version " + CCPVersion @@ -68,7 +68,7 @@ sys.exit(0) else: - sys.stderr.write("\n\nRun: /usr/share/cloudprint-cups/setupcloudprint.py to setup your Google Credentials and add your printers to CUPS\n\n") + sys.stderr.write("\nRun: /usr/share/cloudprint-cups/setupcloudprint.py to setup your Google Credentials and add your printers to CUPS\n\n") sys.exit(0) from backend import which @@ -89,12 +89,16 @@ if ( cupsprinters[device]["device-uri"].find("cloudprint://") == 0 ): print "Updating " + cupsprinters[device]["printer-info"] ppdid = 'MFG:GOOGLE;DRV:GCP;CMD:POSTSCRIPT;MDL:' + cupsprinters[device]["device-uri"] + ';' + printerppdname = None for ppd in allppds: if allppds[ppd]['ppd-device-id'] == ppdid: printerppdname = ppd - p = subprocess.Popen(["lpadmin", "-p", cupsprinters[device]["printer-info"], "-m", printerppdname], stdout=subprocess.PIPE) - output = p.communicate()[0] - result = p.returncode - sys.stderr.write(output) + if printerppdname != None: + p = subprocess.Popen(["lpadmin", "-p", cupsprinters[device]["printer-info"], "-m", printerppdname], stdout=subprocess.PIPE) + output = p.communicate()[0] + result = p.returncode + sys.stderr.write(output) + else: + print cupsprinters[device]["printer-info"] + " not found" except Exception, e: sys.stderr.write("Error connecting to CUPS: " + str(e) + "\n")