Advertisement
Guest User

pyGIOBoggusGI_IS_CALLABLE_INFO

a guest
May 25th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.49 KB | None | 0 0
  1. #I have many instance of this object
  2. class BlargProblematic(object):
  3.     #nothing wrong where
  4.     def __init__(self, con, rule):
  5.         self.con = con #GDBusConnection
  6.         self.rule = rule #string
  7.         proxy = Gio.DBusProxy.new_sync(
  8.                 self.con, #cpmmectopm
  9.                 Gio.DBusProxyFlags.NONE,
  10.                 None, #DBusInterfaceInfo
  11.                 "org.freedesktop.DBus", #name
  12.                 "/", #path
  13.                 "org.freedesktop.DBus", #iface
  14.                 None)
  15.         proxy.AddMatch("(s)", self.rule)
  16.  
  17.     # something goes wrong here :/
  18.     def __del__(self):
  19.         proxy = Gio.DBusProxy.new_sync(
  20.                 self.con, #cpmmectopm
  21.                 Gio.DBusProxyFlags.NONE,
  22.                 None, #DBusInterfaceInfo
  23.                 "org.freedesktop.DBus", #name
  24.                 "/", #path
  25.                 "org.freedesktop.DBus", #iface
  26.                 None)
  27.         proxy.RemoveMatch(self.rule)
  28.  
  29.  
  30. #I have many instance of this object too
  31. class BlargTestingSolution(object):
  32.     #nothing wrong here
  33.     def __init__(self, con, rule):
  34.         self.con = con #GDBusConnection
  35.         self.rule = rule #string
  36.         self.proxy = Gio.DBusProxy.new_sync(
  37.                 self.con, #cpmmectopm
  38.                 Gio.DBusProxyFlags.NONE,
  39.                 None, #DBusInterfaceInfo
  40.                 "org.freedesktop.DBus", #name
  41.                 "/", #path
  42.                 "org.freedesktop.DBus", #iface
  43.                 None)
  44.         self.proxy.AddMatch("(s)", self.rule)
  45.  
  46.     # (probably) nothing wrong here (I'm testing)
  47.     def __del__(self):
  48.         self.proxy.RemoveMatch(self.rule)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement