Re: [libvirt-glib] Adjust example to pygobject-3.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
attached patch makes the example work again with recent pygobject-3.0
which doesn't allow to "import gtk" anymore.
Cheers,
 -- Guido

On Thu, Nov 17, 2011 at 10:36:23PM +0100, Guido Günther wrote:
> ---
>  examples/event-test.py |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/event-test.py b/examples/event-test.py
> index 33e7c73..4b06235 100644
> --- a/examples/event-test.py
> +++ b/examples/event-test.py
> @@ -1,5 +1,5 @@
>  
> -import gtk
> +from gi.repository import Gtk
>  import libvirt
>  import getopt
>  import sys
> @@ -47,16 +47,15 @@ def main():
>  
>      print "Using uri:" + uri
>  
> -    LibvirtGLib.init("")
> +    LibvirtGLib.init(0, "")
>      LibvirtGLib.event_register()
> -#    libvirtglib.eventRegister()
>      vc = libvirt.open(uri)
>  
>      #Add 2 callbacks to prove this works with more than just one
>      vc.domainEventRegister(myDomainEventCallback1,None)
>      vc.domainEventRegister(myDomainEventCallback2,None)
>  
> -    gtk.main()
> +    Gtk.main()
>  
>  if __name__ == "__main__":
>      main()
> -- 
> 1.7.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]