Attachment 'scan.py'
Download 1 import sys
2 import dbus
3
4 def main():
5 name = "org.freedesktop.DBus"
6 bus = dbus.bus.BusConnection("tcp:host=192.168.2.4,port=6667")
7 p = bus.get_object(name, "/" + name.replace(".", "/"))
8 i = dbus.Interface(p, dbus_interface=name)
9
10 for s in i.ListNames():
11 print
12 if str(s).find(":") != -1:
13 print "skipped %s." % s
14 continue
15 if str(s).find("-") != -1:
16 print "skipped %s." % s
17 continue
18 else:
19 scan(str(s))
20
21 def scan(name):
22 print "= %s =" % name
23 bus = dbus.bus.BusConnection("tcp:host=192.168.2.4,port=6667")
24 p = bus.get_object(name, "/" + name.replace(".", "/"))
25 i = dbus.Interface(p, dbus_interface="org.freedesktop.DBus")
26
27 print "== functions =="
28 try:
29 print p.Introspect()
30 except:
31 print "Introspect() failed."
32
33 print "== objects =="
34 try:
35 for s in i.ListNames():
36 print s
37 except:
38 print "ListNames() failed."
39
40 print "== properties =="
41 i = dbus.Interface(p, dbus_interface="org.freedesktop.DBus.Properties")
42 try:
43 results = i.GetAll()
44 for s in results:
45 print s
46 except:
47 print "GetAll() failed."
48
49 if __name__ == "__main__":
50 main()
Attached Files
Normal Sort Sort + uniq Sort + uniq + countYou are not allowed to attach a file to this page.