From: Andrea Bolognani <eof@kiyuko.org>
Date: Wed, 1 Feb 2012 12:31:26 +0100
Subject: Support lp along with lpr for printing

The original printing implementation only supports the lpr
command; this patch add support for printing with lp as well.

If available, lp is preferred.

Forwarded: not-needed
---
 rhinote.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/rhinote.py b/rhinote.py
index 8af8ddd..48a3d75 100644
--- a/rhinote.py
+++ b/rhinote.py
@@ -85,7 +85,7 @@ class TextWidget(tkinter.Text):
 
     def printfile(self, whatever=None):
         if not PRINTCOMMAND:
-            tkMessageBox.showerror('Print error', 'Print command (lpr) not found')
+            tkMessageBox.showerror('Print error', 'Print command (lp or lpr) not found')
             return
         if not FORMATCOMMAND:
             tkMessageBox.showerror('Print error', 'Format command (enscript) not found')
@@ -176,8 +176,11 @@ def which(cmd):
 # make it so:
 if __name__ == '__main__':
     # Find print and format commands
-    PRINTCOMMAND = which('lpr')
+    PRINTCOMMAND = which('lp')
     PRINTARGS = []
+    if not PRINTCOMMAND:
+        PRINTCOMMAND = which('lpr')
+        PRINTARGS = []
     FORMATCOMMAND = which('enscript')
     FORMATARGS = ['-B', '--word-wrap', '-o', '-']
 
