If and when #22257 is implemented, the commands could start by collecting
amount of rows to progress, and periodically printing the progress to the
console. This way the user can make a fair estimate on when the commands
are done and whether they are actually still running.
--
Ticket URL: <https://code.djangoproject.com/ticket/22258>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:1>
Comment (by anubhav9042):
We can add the patch given #22257, then as posted there:
I think we can keep default as stdout and and for this, we can do the
following:
- When -o is not used, let the data be printed to stdout, as the data is
printing people can see it and I don't think any progress display is
required there.
- When -o will be used, then we can display progress percentage or
something like that.
backwards compatibilty is there, also issue here is also addressed.
thoughts?
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:2>
Comment (by russellm):
Before we get too carried away here, someone needs to explain how it's
going to be implemented. json.dumps and lxml don't provide progress APIs
AFAIK.
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:3>
Comment (by anubhav9042):
Well I am attaching a simple diff just for JSON. It does very simply does
the job of displaying progress(random not actual), but we can think along
similar lines like we could calculate total no. of objects and then print
progress accurately depending upon no of objects serialized.
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:4>
* owner: nobody => mrfuxi
* status: new => assigned
Comment:
I was thinking of adding some kind of utility to allow showing progress
from any management command.
As far as I looked (loading data) there is no clean way of showing % of
progress because of generators/reading streams from files, so progress
like during tests. For data load it might be possible to show proper
progress bar.
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:5>
* has_patch: 0 => 1
* needs_tests: 0 => 1
Comment:
188a2418807f661eedfc675731521f2f46a3c49a (#21652) added progress
information for loaddata.
This PR is adding progress report for dumpdata:
https://github.com/django/django/pull/5032
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:6>
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:7>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c296e55dc6a697c7e4d4be92b954633cda4a79b1" c296e55]:
{{{
#!CommitTicketReference repository=""
revision="c296e55dc6a697c7e4d4be92b954633cda4a79b1"
Fixed #22258 -- Added progress status for dumpdata when outputting to file
Thanks Gwildor Sok for the report and Tim Graham for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"eaa3c883450f3c7ea939992ed075257bbac3d8b2" eaa3c88]:
{{{
#!CommitTicketReference repository=""
revision="eaa3c883450f3c7ea939992ed075257bbac3d8b2"
Refs #22258 -- Fixed an unclosed temporary file in fixtures test.
This prevented the temporary directory from being removed
on Windows.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22258#comment:10>