summaryrefslogtreecommitdiffstats
path: root/libvirt-override-virStream.py
blob: f50a7efe90712d2ae78d118da4e214113eb4c17b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    def __del__(self):
        try:
            if self.cb:
                libvirtmod.virStreamEventRemoveCallback(self._o)
        except AttributeError:
           pass

        if self._o != None:
            libvirtmod.virStreamFree(self._o)
        self._o = None

    def eventAddCallback(self, cb, opaque):
        """ """
        try:
            self.cb = cb
            self.opaque = opaque
            ret = libvirtmod.virStreamEventAddCallback(self._o, self)
            if ret == -1: raise libvirtError ('virStreamEventAddCallback() failed', conn=self._conn)
        except AttributeError:
            pass