[Pypt-offline-general] SF.net SVN: pypt-offline: [166] trunk/pypt_core.py
Status: Beta
Brought to you by:
riteshsarraf
|
From: <rit...@us...> - 2007-08-02 20:11:07
|
Revision: 166
http://pypt-offline.svn.sourceforge.net/pypt-offline/?rev=166&view=rev
Author: riteshsarraf
Date: 2007-08-02 13:11:09 -0700 (Thu, 02 Aug 2007)
Log Message:
-----------
* Added a helper function which detects the correct pager. Taken from IPython
Modified Paths:
--------------
trunk/pypt_core.py
Modified: trunk/pypt_core.py
===================================================================
--- trunk/pypt_core.py 2007-08-02 19:52:19 UTC (rev 165)
+++ trunk/pypt_core.py 2007-08-02 20:11:09 UTC (rev 166)
@@ -621,7 +621,23 @@
else:
log.err("Aieee! I don't understand this errorcode\n" % (errno))
sys.exit(errno)
+
+def get_pager_cmd(pager_cmd = None):
+ if os.name == 'posix':
+ default_pager_cmd = 'less -r'
+ elif os.name in ['nt', 'dos']:
+ default_pager_cmd = 'type'
+
+ if pager_cmd is None:
+ try:
+ pager_cmd = os.environ['PAGER']
+ except:
+ pager_cmd = default_pager_cmd
+
+ return pager_cmd
+
+
def fetcher(ArgumentOptions, arg_type = None):
'''
uri - The uri data whill will contain the information
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|