The attached patch implements a progress bar for uploading SRPMs.
Basically I've added a new "progress_callback" parameters to the create_new_build (copr/python) function which is called for each chunk of 8192 bytes sent to the server. Then I've implemented the callback on the copr-cli to update a bar object.
The bar format and library is the same than pip uses (see the screenshot attached).[image: ss_progressbar.jpg] The lib I've used is available in the fedora package python-progress but it's not available in EPEL. For that reason I did not made that a hard dependency: if the python-progress is installed the bar will show up, if not the lib just work as previously.
Is it possible to add python-progress to EPEL repo? If so I'd change the spec to make copr-cli depend on it.
Cheers,
Sergio Oliveira
The previous patch has a bug. This patch replaces it.
On 10/22/2015 09:42 PM, Sergio Oliveira wrote:
The previous patch has a bug. This patch replaces it.
There is still some.
$ copr-cli build msuchy/copr-dev /tmp/tito/copr-cli-1.45-1.git.57.5534e43.fc22.src.rpm
Traceback (most recent call last): File "/bin/copr-cli", line 9, in <module> load_entry_point('copr-cli==0.3.0', 'console_scripts', 'copr-cli')() File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 433, in main getattr(commands, arg.func)(arg) File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 68, in wrapper return func(self, args) File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 179, in action_build username=username, progress_callback=progress_callback) TypeError: create_new_build() got an unexpected keyword argument 'progress_callback'
Interesting because it's passing the tests :)
I'm gonna write a new test to catch it.
On Fri, Oct 23, 2015 at 6:09 AM Miroslav Suchy msuchy@redhat.com wrote:
On 10/22/2015 09:42 PM, Sergio Oliveira wrote:
The previous patch has a bug. This patch replaces it.
There is still some.
$ copr-cli build msuchy/copr-dev /tmp/tito/copr-cli-1.45-1.git.57.5534e43.fc22.src.rpm
Traceback (most recent call last): File "/bin/copr-cli", line 9, in <module> load_entry_point('copr-cli==0.3.0', 'console_scripts', 'copr-cli')() File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 433, in main getattr(commands, arg.func)(arg) File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 68, in wrapper return func(self, args) File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 179, in action_build username=username, progress_callback=progress_callback) TypeError: create_new_build() got an unexpected keyword argument 'progress_callback'
copr-devel mailing list copr-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/copr-devel
Actually there was no problem. You just didn't install the patched version of copr/python before running your test.
On Fri, Oct 23, 2015 at 8:39 AM Sergio Oliveira seocam@gmail.com wrote:
Interesting because it's passing the tests :)
I'm gonna write a new test to catch it.
On Fri, Oct 23, 2015 at 6:09 AM Miroslav Suchy msuchy@redhat.com wrote:
On 10/22/2015 09:42 PM, Sergio Oliveira wrote:
The previous patch has a bug. This patch replaces it.
There is still some.
$ copr-cli build msuchy/copr-dev /tmp/tito/copr-cli-1.45-1.git.57.5534e43.fc22.src.rpm
Traceback (most recent call last): File "/bin/copr-cli", line 9, in <module> load_entry_point('copr-cli==0.3.0', 'console_scripts', 'copr-cli')() File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 433, in main getattr(commands, arg.func)(arg) File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 68, in wrapper return func(self, args) File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 179, in action_build username=username, progress_callback=progress_callback) TypeError: create_new_build() got an unexpected keyword argument 'progress_callback'
copr-devel mailing list copr-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/copr-devel
Dne 26.10.2015 v 13:04 Sergio Oliveira napsal(a):
Actually there was no problem. You just didn't install the patched version of copr/python before running your test.
Indeed. Commited as 3abbd9f.
Thank you.
copr-devel@lists.fedorahosted.org