Skip to content
Browse files

Changes to work with older python versions

  • Loading branch information...
1 parent 792c5e8 commit 45bfbb1b8bbe4071a666af4cf424afdcd8e10769 @simoncadman committed Dec 1, 2012
Showing with 65 additions and 6 deletions.
  1. +1 −1 backend.py
  2. +1 −1 listcloudprinters.py
  3. +29 −0 packages/debian/postinst
  4. +1 −1 packages/redhat/SPECS/cupscloudprint.spec
  5. +16 −1 setupcloudprint.py
  6. +1 −1 submitjob.py
  7. +16 −1 upgrade.py
View
2 backend.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2.7
+#! /usr/bin/env python2
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2011 Simon Cadman
#
View
2 listcloudprinters.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2.7
+#! /usr/bin/env python2
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2011 Simon Cadman
#
View
29 packages/debian/postinst
@@ -1,4 +1,33 @@
#! /bin/bash
+
+# if python2 symlink doesnt exist, change to /usr/bin/env python2.7 or /usr/bin/env python2.6
+if [[ ! -f /usr/bin/python2 ]]; then
+ export pyversion=""
+ if [[ -f /usr/bin/python2.3 ]]; then
+ export pyversion="python2.3"
+ fi
+
+ if [[ -f /usr/bin/python2.4 ]]; then
+ export pyversion="python2.4"
+ fi
+
+ if [[ -f /usr/bin/python2.5 ]]; then
+ export pyversion="python2.5"
+ fi
+
+ if [[ -f /usr/bin/python2.6 ]]; then
+ export pyversion="python2.6"
+ fi
+
+ if [[ -f /usr/bin/python2.7 ]]; then
+ export pyversion="python2.7"
+ fi
+
+ if [[ $pyversion != "" ]]; then
+ sed -i "1 s/\/usr\/bin\/env python2$/\/usr\/bin\/env $pyversion/" /usr/lib/cloudprint-cups/{backend.py,listcloudprinters.py,setupcloudprint.py,submitjob.py,upgrade.py}
+ fi
+fi
+
touch /var/log/cups/cloudprint_log
chown root:lp /var/log/cups/cloudprint_log
chmod 660 /var/log/cups/cloudprint_log
View
2 packages/redhat/SPECS/cupscloudprint.spec
@@ -8,7 +8,7 @@ URL: http://ccp.niftiestsoftware.com
Source0: http://ccp.niftiestsoftware.com/cupscloudprint-20120908.tar.bz2
BuildRequires: cups-devel,cups,make,python-httplib2
-Requires: cups,ghostscript,system-config-printer-libs,python-httplib2
+Requires: cups,ghostscript,system-config-printer-libs,python-httplib2,python-json
%description
Google Cloud Print driver for CUPS, allows printing to printers hosted on Google Cloud Print.
View
17 setupcloudprint.py
@@ -1,4 +1,19 @@
-#! /usr/bin/env python2.7
+#! /usr/bin/env python2
+# CUPS Cloudprint - Print via Google Cloud Print
+# Copyright (C) 2011 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 cups, os, json
from auth import Auth
View
2 submitjob.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2.7
+#! /usr/bin/env python2
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2011 Simon Cadman
#
View
17 upgrade.py
@@ -1,4 +1,19 @@
-#! /usr/bin/env python2.7
+#! /usr/bin/env python2
+# CUPS Cloudprint - Print via Google Cloud Print
+# Copyright (C) 2011 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, cups, subprocess, os, json
from oauth2client import client

0 comments on commit 45bfbb1

Please sign in to comment.
Something went wrong with that request. Please try again.