-
Notifications
You must be signed in to change notification settings - Fork 158
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
Question: Use async function in Python programs #125
Comments
ghost
changed the title
Question : Use aync function in Python programs
Question : Use async function in Python programs
May 21, 2016
I think the mailing list is a much better place to ask these kind of questions; I'm not a huge python guru so I'm not sure how you'd handle that vfunc progress callback. My gut instinct is the scope attributes are wrong, but I'm not sure. |
You should do something like this: pktask.refresh_cache_async (False, # force
None, # GCancellable
self.on_pktask_progress,
(None,), # user data
self.on_pktask_finish,
(None,)); This is not a PackageKit issue, rather a PyGObject weirdness. |
ximion
changed the title
Question : Use async function in Python programs
Question: Use async function in Python programs
Jun 2, 2016
Ok thanks a lot, I'll try to write a script and publish it. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
There is a lack of documentation and examples on the use of async function for the python bindings. As i don't find any solution, i think it's better to ask directly. Anyway, i don't think I'm alone in this case.
For my project, i use PackageKit v1.0 python bindings. In order to have a non blocking refresh cache or install software operation, i use the native Thread class from python libs. But, as far as i know _async methods in PKit work properly, but i don't know how to achieve my goal.
With two callbacks declared : one follows PackageKitGlib.ProgressCallback signature and the other one follow Gio.AsyncReadyCallback
The function call is :
The result is a TypeError: expected tuple for callback user_data exception. As far as i know, i can't understand why.
After searching for a solution of the web since a couple of month, i gave up and still used native threads. But this is not a good solution.
Can you provide an example for this kind of problem or anything else that can help the developers ?
Anyway, does this question will have to be asked to the mailling list of developers that maintain the bindings ?
The text was updated successfully, but these errors were encountered: