add progress-hook to HTTPConnection
Bug #239684 reported by
Markus Korn
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-launchpad-bugs |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
It would be nice if the user of py-lp-bugs can get information about the progess of an http operation.
Related branches
To post a comment you must log in.
this patch against .main r94 adds a basic hook-interface to py-lp-bugs.
This is an example on how to use this progress_hook:
In [1]: def example_ hook(counter, block_size, size):
...: print (counter, block_size, size)
...:
...:
In [2]: from launchpadbugs. connector import ConnectBug
In [3]: Bug = ConnectBug()
In [4]: Bug.connection. set_progress_ hook(example_ hook)
In [5]: b = Bug(200500)
(1, 4096, 51781)
(2, 4096, 51781)
(3, 4096, 51781)
(4, 4096, 51781)
(5, 4096, 51781)
(6, 4096, 51781)
(7, 4096, 51781)
(8, 4096, 51781)
(9, 4096, 51781)
(10, 4096, 51781)
(11, 4096, 51781)
(12, 4096, 51781)
(13, 4096, 51781)
Please review this patch, it definitely needs some texting
Markus