ui:util:pager: document Nathan Weizenbaum as author of Ruby inspiration
[be.git] / libbe / ui / util / pager.py
index 88b58af46c7b30aa4987284c26d581e2a9b7d05e..20a583e2f40c472970370eec92b4e105477ca9c6 100644 (file)
@@ -1,18 +1,20 @@
-# Copyright (C) 2009-2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2009-2012 Chris Ball <cjb@laptop.org>
+#                         W. Trevor King <wking@tremily.us>
 #
-# 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 2 of the License, or
-# (at your option) any later version.
+# This file is part of Bugs Everywhere.
 #
-# 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.
+# Bugs Everywhere 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 2 of the License, or (at your option) any
+# later version.
 #
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# Bugs Everywhere 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
+# Bugs Everywhere.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 Automatic pager for terminal output (a la Git).
@@ -20,7 +22,8 @@ Automatic pager for terminal output (a la Git).
 
 import sys, os, select
 
-# see http://nex-3.com/posts/73-git-style-automatic-paging-in-ruby
+# Inspired by Nathan Weizenbaum's
+#   http://nex-3.com/posts/73-git-style-automatic-paging-in-ruby
 def run_pager(paginate='auto'):
     """
     paginate should be one of 'never', 'auto', or 'always'.
@@ -48,7 +51,6 @@ def run_pager(paginate='auto'):
     if os.fork() == 0:
         # child process
         os.close(read_fd)
-        os.close(0)
         os.dup2(write_fd, 1)
         os.close(write_fd)
         if hasattr(sys.stderr, 'isatty') and sys.stderr.isatty() == True: