Ticket #14733: trac_14733_banner_unicode.patch

File trac_14733_banner_unicode.patch, 4.2 KB (added by chapoton, 9 years ago)
  • sage/misc/abstract_method.py

    # HG changeset patch
    # User Frederic Chapoton <chapoton at math.univ-lyon1.fr>
    # Date 1371116756 -7200
    # Node ID c958311eed05505c185e0f757e98c90b31c7b2fb
    # Parent  2eaf8fcef55ee408aeeddae857435af28bced5e3
    trac 14733 a unicode banner
    
    diff --git a/sage/misc/abstract_method.py b/sage/misc/abstract_method.py
    a b class AbstractMethod(object): 
    194194            sage: src[0]
    195195            'def banner():\n'
    196196            sage: lines
    197             77
    198 
     197            79
    199198        """
    200199        from sage.misc.sageinspect import sage_getsourcelines
    201200        return sage_getsourcelines(self._f)
  • sage/misc/banner.py

    diff --git a/sage/misc/banner.py b/sage/misc/banner.py
    a b  
     1# -*- coding: utf-8 -*-
    12r"""
    23Sage version and banner info
    34"""
    def banner_text(): 
    5354    EXAMPLES::
    5455
    5556        sage: print sage.misc.banner.banner_text()
    56         +--------------------------------------------------------------------+
    57         | Sage Version ...
     57        ┌────────────────────────────────────────────────────────────────────┐
     58        Sage Version ...
    5859    """
    59     bars = '+' + "-"*68 + '+'
    60     s = bars
    61     s += "\n| %-66s |\n"%version()
    62     s += "| %-66s |\n"%'Type "notebook()" for the browser-based notebook interface.'
    63     s += "| %-66s |\n"%'Type "help()" for help.'
    64     #s += "| %-66s |\n"%'Distributed under the GNU General Public License V2.'
    65     s += bars
     60    bars = u"─"*68
     61    s = u'┌' + bars + u'┐'
     62    s += u"\n│ %-66s │\n" % version()
     63    s += u"│ %-66s │\n" % 'Type "notebook()" for the browser-based notebook interface.'
     64    s += u"│ %-66s │\n" % 'Type "help()" for help.'
     65    #s += u"│ %-66s │\n" % 'Distributed under the GNU General Public License V2.'
     66    s += u'└' + bars + u'┘'
    6667    pre = version_dict()['prerelease']
    6768    if pre:
     69        bars2 = bars.replace(u'─', u'━')
    6870        s += '\n'
    69         s += bars.replace('-', '*').replace('+','*')
    70         s += "\n* %-66s *\n"%''
    71         s += "* %-66s *\n"%'Warning: this is a prerelease version, and it may be unstable.'
    72         s += "* %-66s *\n"%''
    73         s += bars.replace('-', '*').replace('+','*')
    74     return s
     71        s += u'┏' + bars2 + u'┓'
     72        s += u"\n┃ %-66s ┃\n" % ''
     73        s += u"┃ %-66s ┃\n" % 'Warning: this is a prerelease version, and it may be unstable.'
     74        s += u"┃ %-66s ┃\n" % ''
     75        s += u'┗' + bars2 + u'┛'
     76    return s.encode('utf8')
    7577   
    7678
    7779def banner():
    def banner(): 
    8991    EXAMPLES::
    9092
    9193        sage: banner()
    92         +--------------------------------------------------------------------+
    93         | Sage Version ..., Release Date: ...
    94         | Type "notebook()" for the browser-based notebook interface.        |
    95         | Type "help()" for help.                                            |
     94        ┌────────────────────────────────────────────────────────────────────┐
     95        Sage Version ..., Release Date: ...
     96        │ Type "notebook()" for the browser-based notebook interface.        │
     97        │ Type "help()" for help.                                            │
    9698        ...
    9799    """
    98100    print banner_text()
  • sage/misc/lazy_attribute.py

    diff --git a/sage/misc/lazy_attribute.py b/sage/misc/lazy_attribute.py
    a b class lazy_attribute(object): 
    489489        """
    490490        Returns the source code location for the wrapped function.
    491491
    492         EXAMPLES:
     492        EXAMPLES::
     493
    493494            sage: from sage.misc.sageinspect import sage_getsourcelines
    494495            sage: g = lazy_attribute(banner)
    495496            sage: (src, lines) = sage_getsourcelines(g)
    496497            sage: src[0]
    497498            'def banner():\n'
    498499            sage: lines
    499             77
    500 
     500            79
    501501        """
    502502        from sage.misc.sageinspect import sage_getsourcelines
    503503        return sage_getsourcelines(self.f)