Ejemplo n.º 1
0
    def __init__(self):
        VfsDirectoryBase.__init__(self)

        print 'RootDirectoryHandle()'

        self.uri = gnomevfs.URI('bluetooth:///')

        VfsCache.store(self.uri, self)

        self.basename = self.uri.path

        self.mgr = bluetool.get_manager(sys_bus)

        self.devs = self.mgr.ListDevices()
Ejemplo n.º 2
0
    def __init__(self):
        VfsDirectoryBase.__init__(self)

        print "RootDirectoryHandle()"

        self.uri = gnomevfs.URI("bluetooth:///")

        VfsCache.store(self.uri, self)

        self.basename = self.uri.path

        self.mgr = bluetool.get_manager(sys_bus)

        self.devs = self.mgr.ListDevices()
	def __init__(self):
		#
		#	create the treestore to be used as a model,
		#	its contents will be:
		#	( dbus_object, dev_name, dev_address, label, class, icon )
		#	while for a service
		#	( dbus_object, service_name, none, label, none, icon )

		self.device_store = gtk.TreeStore(object, gtk.TreeStore, str, str, str, int, gtk.gdk.Pixbuf)

		#
		#	create proxy for remote object (the manager)
		#
		self.bus = dbus.SystemBus()
		#self.obj = self.bus.get_object('org.bluetool','/org/bluetool/manager')
		self.iface = bluetool.get_manager(self.bus)

		#
		#	bind signals to local hook functions
		#
		self.iface.connect_to_signal('DeviceAdded',self.sig_DeviceAdded);
		self.iface.connect_to_signal('DeviceRemoved',self.sig_DeviceRemoved);

		#
		#	find devices
		#
		devices = self.iface.ListDevices()
		for devpath in devices:
			self.sig_DeviceAdded(devpath)

		#
		#	list modules
		#
		self.module_store = gtk.ListStore(str,str,str)

		self.moddb = bluetool.get_modules(self.bus)

		mods = self.moddb.ListModules()

		print mods

		for mod_path in mods:
			mod = bluetool.get_module(self.bus,mod_path)

			self.module_store.append([mod_path, mod.Name(), mod.Description()])