Ejemplo n.º 1
0
#!/usr/bin/env python

from gi.repository import Foo, GObject

Foo.hello()
print(Foo.make_n_object(20))
print(Foo.return_two())
Ejemplo n.º 2
0
from gi.repository import Foo
import sys

Foo.hello(str(Foo))
Foo.hello("from, %s" % __file__)
print(sys.executable)
print(sys.argv)
print(__name__)

print(Foo.hello)
Ejemplo n.º 3
0
#!/usr/bin/env python

from gi.repository import Foo, GObject, Gio


class Test1(GObject.Object):
    def __init__(self):
        print(1)


class Test2(GObject.Object):
    def __init__(self, a):
        print(a)


Foo.n(Test1)
# Foo.n(Test2)

import socket


class Socket(Gio.Socket):
    def __init__(self, **kwargs):
        print(self.get_family())
        super().__init__(family=2, **kwargs)
        print(33)


p0, p1 = socket.socketpair()
print(p0.fileno())
s = Foo.n1(Socket, "fd", p0.fileno())
Ejemplo n.º 4
0
#!/usr/bin/env python

from gi.repository import Foo, GObject

Foo.hello()
print(Foo.make_n_object(20))