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.

Forwarded: Marv Boyes <greyspace@tuxfamily.org>
---
 rhinote.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rhinote.py b/rhinote.py
index 7e48c52..b49a88e 100644
--- a/rhinote.py
+++ b/rhinote.py
@@ -85,7 +85,7 @@ class TextWidget(tkinter.Text):
 
     def printfile(self, whatever=None):
         if not self.printcommand:
-            tkMessageBox.showerror('Print error', 'Print command (lpr) not found')
+            tkMessageBox.showerror('Print error', 'Print command (lp or lpr) not found')
             return
         if not self.formatcommand:
             tkMessageBox.showerror('Print error', 'Format command (enscript) not found')
@@ -171,7 +171,9 @@ http://rhinote.tuxfamily.org
             ('All files', '*'),
         ]
         # Find print and format commands
-        self.printcommand = self.which('lpr')
+        self.printcommand = self.which('lp')
+        if not self.printcommand:
+            self.printcommand = self.which('lpr')
         self.printargs = []
         self.formatcommand = self.which('enscript')
         self.formatargs = ['-B', '--word-wrap', '-o', '-']
