-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Web-friendly tqdm #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Current coverage is
|
def __init__(self, *args, **kwargs): | ||
|
||
# Setup default output | ||
if not kwargs.get('file', None) or kwargs['file'] == sys.stderr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kwargs.get('file', sys.stderr) is sys.stderr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. looks like this was copied from the current notebook implementation.
On 18 May 2016 7:11 a.m., "o11c" notifications@github.com wrote:
In tqdm/_tqdm_web.py
#94 (comment):
# Special signal to close the bar
if close:
display_javascript(fp, '$("#%s").parent().parent().hide()' % html_id)
- return print_status
+class tqdm_web(tqdm): # pragma: no cover
- """
- Experimental CSS/JSS web-friendly tqdm!
- """
- def init(self, _args, *_kwargs):
# Setup default output
if not kwargs.get('file', None) or kwargs['file'] == sys.stderr:
kwargs.get('file', sys.stderr) is sys.stderr
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/tqdm/tqdm/pull/94/files/ca411dd998394c72cd977d80a699247cd7b0ea9f#r63649948
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it was extracted from a variant of _tqdm_notebook. Whereas the
current _tqdm_notebook leverages ipywidgets to show and update the progress
bars, this variant defined its own JS+CSS implementation. However, this
implementation was way slower than ipywidgets, hence why I reverted back,
but this could be used for a web implementation of tqdm (the code is
already fully functional, I just need some feedback from a python web dev
on how to implement the API).
2016-05-18 8:55 GMT+02:00 Casper da Costa-Luis notifications@github.com:
In tqdm/_tqdm_web.py
#94 (comment):
# Special signal to close the bar
if close:
display_javascript(fp, '$("#%s").parent().parent().hide()' % html_id)
- return print_status
+class tqdm_web(tqdm): # pragma: no cover
- """
- Experimental CSS/JSS web-friendly tqdm!
- """
- def init(self, _args, *_kwargs):
# Setup default output
if not kwargs.get('file', None) or kwargs['file'] == sys.stderr:
thanks. looks like this was copied from the current notebook
implementation.
… <#m_9057261056133638991_m_1022619018176992888_>
On 18 May 2016 7:11 a.m., "o11c" _@_.***> wrote: In tqdm/_tqdm_web.py <#94
(comment) https://github.com/tqdm/tqdm/pull/94#discussion_r63649948>: >
display_javascript(fp, '$("#%s").parent().parent().hide()' % html_id) > + >
Special signal to close the bar > + if close: > +
- return print_status > + > + > +class tqdm_web(tqdm): # pragma: no cover >
- """ > + Experimental CSS/JSS web-friendly tqdm! > + """ > + def
init(self, _args, *_kwargs): > + > + # Setup default output > + if not
kwargs.get('file', None) or kwargs['file'] == sys.stderr:
kwargs.get('file', sys.stderr) is sys.stderr — You are receiving this
because you are subscribed to this thread. Reply to this email directly or
view it on GitHub <
https://github.com/tqdm/tqdm/pull/94/files/ca411dd998394c72cd977d80a699247cd7b0ea9f#r63649948>—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/tqdm/tqdm/pull/94/files/ca411dd998394c72cd977d80a699247cd7b0ea9f#r63653859
@lrq3000 We'll need an intermediary server to communicate between the two. You could use one of the several server frameworks for python (flask, tornado, django, etc.) |
@CrazyPython Yes we need a server framework to test the bar, but I don't intend the bar to provide the full stack to show the bars in a web page, but rather just the HTML/CSS/JS output that the user can then plug in any server framework of choice. This would limit the maintenance cost for us and also be more generic. If that's possible... |
@lrq3000 I was imagining a simple server on |
Yes of course it's necessary to be localhost so that we can run unit tests, 2016-08-05 0:37 GMT+02:00 CrazyPython notifications@github.com:
|
8cade97
to
a65e347
Compare
6ec00f1
to
4b6476a
Compare
Implements a web-friendly tqdm by using JSS to dynamically redefine JSS. Based on aplavin's great work on ipy-progressbar.
The output is correct, but I don't know how we can test that out (ie, show this in a web page). Someone has an idea?