[sagenb] 29/157: Provide a more informative message when source code can not be displayed

felix salfelder felix-guest at moszumanska.debian.org
Mon Dec 22 16:51:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit d8dd16167ff9ef799af5c053b89ba2417e620996
Author: Punarbasu Purkayastha <ppurka at gmail.com>
Date:   Sat May 31 13:52:05 2014 +0800

    Provide a more informative message when source code can not be displayed
    
    This happens for example when running the following:
    import scipy
    scipy.sin??
---
 sagenb/misc/support.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sagenb/misc/support.py b/sagenb/misc/support.py
index 2f10f6b..281c7d3 100644
--- a/sagenb/misc/support.py
+++ b/sagenb/misc/support.py
@@ -367,7 +367,8 @@ def source_code(s, globs, system='sage'):
         return html_markup(output)
     
     except (TypeError, IndexError), msg:
-        return html_markup("Source code for %s not available."%obj)
+        return html_markup("Source code for {} is not available.".format(s) +
+                           "\nUse {}? to see the documentation.".format(s))
     
 def tabulate(v, width=90, ncols=3):
     e = len(v)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list