def open_device_dir(self, uri): for dev_path in self.devs: hci = bluetool.get_local_hci(sys_bus, dev_path) if hci.GetProperty("address") == uri.short_name: return DeviceDirectoryHandle(uri, dev_path) raise gnomevfs.NotFoundError
def open_device_dir(self, uri): for dev_path in self.devs: hci = bluetool.get_local_hci(sys_bus, dev_path) if hci.GetProperty('address') == uri.short_name: return DeviceDirectoryHandle(uri, dev_path) raise gnomevfs.NotFoundError
def open_device_file(self, uri): address = uri.short_name[:-8] #print 'open_device_file: address =',address, 'self =', self print 'devs=', self.devs for dev_path in self.devs: hci = bluetool.get_local_hci(sys_bus, dev_path) if hci.GetProperty('address').replace(':', '') == address: return DeviceFileHandle(dev_path) raise gnomevfs.NotFoundError
def __init__(self, dev_path): VfsDesktopFileBase.__init__(self) print "DeviceFileHandle(", dev_path, ")" self.hci = bluetool.get_local_hci(sys_bus, dev_path) self.name = self.hci.GetProperty("name") self.address = self.hci.GetProperty("address") if len(self.name) == 0: self.name = self.address self.contents = DEVICE_FILE_PROTOTYPE % (self.name, "file:///usr/share/pixmaps/bt-logo.png", self.address) self.basename = self.address.replace(":", "")
def open_device_file(self, uri): address = uri.short_name[:-8] # print 'open_device_file: address =',address, 'self =', self print "devs=", self.devs for dev_path in self.devs: hci = bluetool.get_local_hci(sys_bus, dev_path) if hci.GetProperty("address").replace(":", "") == address: return DeviceFileHandle(dev_path) raise gnomevfs.NotFoundError
def __init__(self, dev_path): VfsDesktopFileBase.__init__(self) print 'DeviceFileHandle(', dev_path, ')' self.hci = bluetool.get_local_hci(sys_bus, dev_path) self.name = self.hci.GetProperty('name') self.address = self.hci.GetProperty('address') if len(self.name) == 0: self.name = self.address self.contents = DEVICE_FILE_PROTOTYPE % ( self.name, 'file:///usr/share/pixmaps/bt-logo.png', self.address) self.basename = self.address.replace(':', '')
def __init__(self, dev_path): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("destroy", self.on_quit) self.window.set_title("Scanning...") self.window.set_border_width(0) self.window.set_position(gtk.WIN_POS_CENTER) vbox = gtk.VBox(False, 3) vbox.set_border_width(10) self.window.add(vbox) vbox.show() self.progress = gtk.ProgressBar() self.progress.set_text('Searching devices, please wait') vbox.pack_start(self.progress, False, False, 0) self.progress.show() separator = gtk.HSeparator() vbox.pack_start(separator, False, False, 0) separator.show() bbox = gtk.HButtonBox() vbox.pack_start(bbox, False, False, 0) bbox.show() button = gtk.Button(stock='gtk-cancel') button.connect("clicked", self.on_quit) bbox.add(button) button.show() w, h = self.window.get_size() self.window.set_default_size(w * 2, h) #self.window.set_resizable(False) self.window.show() sys_bus = dbus.SystemBus() self.hci = bluetool.get_local_hci(sys_bus, dev_path) self.hci.StartInquiry(reply_handler=self.on_quit, error_handler=self.on_scan_error) gobject.timeout_add(100, self.on_redraw_progress)
def __init__(self, dev_path): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("destroy", self.on_quit) self.window.set_title("Scanning...") self.window.set_border_width(0) self.window.set_position(gtk.WIN_POS_CENTER) vbox = gtk.VBox(False, 3) vbox.set_border_width(10) self.window.add(vbox) vbox.show() self.progress = gtk.ProgressBar() self.progress.set_text('Searching devices, please wait') vbox.pack_start(self.progress, False, False, 0) self.progress.show() separator = gtk.HSeparator() vbox.pack_start(separator, False, False, 0) separator.show() bbox = gtk.HButtonBox() vbox.pack_start(bbox, False, False, 0) bbox.show() button = gtk.Button(stock='gtk-cancel') button.connect("clicked", self.on_quit) bbox.add(button) button.show() w, h = self.window.get_size() self.window.set_default_size(w*2, h) #self.window.set_resizable(False) self.window.show() sys_bus = dbus.SystemBus() self.hci = bluetool.get_local_hci(sys_bus, dev_path) self.hci.StartInquiry( reply_handler=self.on_quit, error_handler=self.on_scan_error ) gobject.timeout_add(100, self.on_redraw_progress)
def __init__(self, uri, dev_path): VfsDirectoryBase.__init__(self) print 'DeviceDirectoryHandle(', dev_path, ')' self.uri = uri VfsCache.store(self.uri, self) self.dev_path = dev_path self.basename = uri.short_name self.hci = bluetool.get_local_hci(sys_bus, dev_path) #self.name = self.hci.GetProperty('name') self.address = self.hci.GetProperty('address') self.devs = self.hci.InquiryCache() for dev in self.devs: self.store_handle(RemDevFileHandle(dev, self))
def __init__(self, uri, dev_path): VfsDirectoryBase.__init__(self) print "DeviceDirectoryHandle(", dev_path, ")" self.uri = uri VfsCache.store(self.uri, self) self.dev_path = dev_path self.basename = uri.short_name self.hci = bluetool.get_local_hci(sys_bus, dev_path) # self.name = self.hci.GetProperty('name') self.address = self.hci.GetProperty("address") self.devs = self.hci.InquiryCache() for dev in self.devs: self.store_handle(RemDevFileHandle(dev, self))