GitHub user prabhjyotsingh opened a pull request:

    https://github.com/apache/zeppelin/pull/2729

    [ZEPPELIN-2826] support for carriage return '\r', on result window

    ### What is this PR for?
    This PR implements carriage return '\r' on result window, currently since 
HTML treats "\n", "\r" and "\r\n"  equally.
    
    
    ### What type of PR is it?
    [Improvement]
    
    
    ### What is the Jira issue?
    * [ZEPPELIN-2826](https://issues.apache.org/jira/browse/ZEPPELIN-2826)
    
    ### How should this be tested?
    Here is a sample code to test it
    ```
    %python
    import time,sys
    end_val = 10
    bar_length = 20
    for i in xrange(0, end_val + 1):
        time.sleep(0.5)
        percent = float(i) / end_val
        hashes = '#' * int(round(percent * bar_length))
        spaces = ' ' * (bar_length - len(hashes))
        sys.stdout.write("\rPercent: [{0}] {1}%".format(hashes + spaces, 
int(round(percent * 100))))
        #print "Percent: [{0}] {1}%".format(hashes + spaces, int(round(percent 
* 100)))
    ```
    
    ### Screenshots (if appropriate)
    
![after2](https://user-images.githubusercontent.com/674497/34886813-55e6e2d8-f7ea-11e7-9e40-24ded6631d75.gif)
    
    
    ### Questions:
    * Does the licenses files need update? N/A
    * Is there breaking changes for older versions? N/A
    * Does this needs documentation? N/A


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/prabhjyotsingh/zeppelin ZEPPELIN-2826

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2729.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2729
    
----
commit 4511eec3a1e7df62c09ab0fdfa47fde5ba1ffa8e
Author: Prabhjyot Singh <prabhjyotsingh@...>
Date:   2018-01-12T16:54:15Z

    ZEPPELIN-2826: support for carriage return '\r', on result
    
    Change-Id: If7e953718b19de56808276fd695ea0a5582b4277

----


---

Reply via email to