aaltay commented on a change in pull request #11276: [BEAM-7923] An indicator
of progress in notebooks
URL: https://github.com/apache/beam/pull/11276#discussion_r401248341
##########
File path: sdks/python/apache_beam/runners/interactive/utils.py
##########
@@ -142,3 +142,61 @@ def obfuscate(*inputs):
str_inputs = [str(input) for input in inputs]
merged_inputs = '_'.join(str_inputs)
return hashlib.md5(merged_inputs.encode('utf-8')).hexdigest()
+
+
+class ProgressIndicator(object):
+ """An indicator visualizing code execution in progress."""
+ spinner_template = """
+ <link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
+ <div id="{id}" class="spinner-border text-info" role="status">
+ </div>"""
+ spinner_removal_template = """
+ $("#{id}").remove();"""
+
+ def __init__(self, enter_text, exit_text):
+ # type: (str, str) -> None
+
+ self._id = 'progress_indicator_{}'.format(obfuscate(id(self)))
Review comment:
what is obfuscate? and why obfuscate the id?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services