[sagenb] 155/179: unicode box for the "open your browser" message

felix salfelder felix-guest at moszumanska.debian.org
Tue May 6 12:05:23 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 8190fe55007d85e73ba41cf4805f2c7bc47346f7
Author: fchapoton <fchapoton2 at gmail.com>
Date:   Sat Sep 21 16:55:52 2013 +0200

    unicode box for the "open your browser" message
---
 sagenb/misc/misc.py | 59 +++++++++++++++++++++++++++--------------------------
 1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/sagenb/misc/misc.py b/sagenb/misc/misc.py
index 9dca509..c5a7a17 100644
--- a/sagenb/misc/misc.py
+++ b/sagenb/misc/misc.py
@@ -31,41 +31,41 @@ def print_open_msg(address, port, secure=False, path=""):
     INPUT:
 
     - ``address`` -- a string; a computer address or name
-    
+
     - ``port`` -- an int; a port number
-    
+
     - ``secure`` -- a bool (default: False); whether to prefix the URL
       with 'http' or 'https'
-    
+
     - ``path`` -- a string; the URL's path following the port.
-    
+
     EXAMPLES::
 
         sage: from sagenb.misc.misc import print_open_msg
         sage: print_open_msg('localhost', 8080, True)
-        ****************************************************
-        *                                                  *
-        * Open your web browser to https://localhost:8080  *
-        *                                                  *
-        ****************************************************
+        ┌──────────────────────────────────────────────────┐
+        │                                                  │
+        │ Open your web browser to https://localhost:8080  │
+        │                                                  │
+        └──────────────────────────────────────────────────┘
         sage: print_open_msg('sagemath.org', 8080, False)
-        ******************************************************
-        *                                                    *
-        * Open your web browser to http://sagemath.org:8080  *
-        *                                                    *
-        ******************************************************
+        ┌────────────────────────────────────────────────────┐
+        │                                                    │
+        │ Open your web browser to http://sagemath.org:8080  │
+        │                                                    │
+        └────────────────────────────────────────────────────┘
         sage: print_open_msg('sagemath.org', 90, False)
-        ****************************************************
-        *                                                  *
-        * Open your web browser to http://sagemath.org:90  *
-        *                                                  *
-        ****************************************************
+        ┌──────────────────────────────────────────────────┐
+        │                                                  │
+        │ Open your web browser to http://sagemath.org:90  │
+        │                                                  │
+        └──────────────────────────────────────────────────┘
         sage: print_open_msg('sagemath.org', 80, False)
-        **************************************************
-        *                                                *
-        *  Open your web browser to http://sagemath.org  *
-        *                                                *
-        **************************************************
+        ┌────────────────────────────────────────────────┐
+        │                                                │
+        │  Open your web browser to http://sagemath.org  │
+        │                                                │
+        └────────────────────────────────────────────────┘
     """
     if port == 80:
         port = ''
@@ -79,11 +79,12 @@ def print_open_msg(address, port, secure=False, path=""):
     n = max(t+4, 50)
     k = n - t  - 1
     j = k/2 
-    print '*'*n
-    print '*'+ ' '*(n-2) + '*'
-    print '*' + ' '*j + s + ' '*j + '*'
-    print '*'+ ' '*(n-2) + '*'
-    print '*'*n
+    msg = '┌' + '─' * (n - 2) + '┐\n'
+    msg += '│' + ' ' * (n - 2) + '│\n'
+    msg += '│' + ' ' * j + s + ' ' * j + '│\n'
+    msg += '│' + ' ' * (n - 2) + '│\n'
+    msg += '└' + '─' * (n - 2) + '┘'
+    print msg
 
 
 def find_next_available_port(interface, start, max_tries=100, verbose=False):

-- 
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