Exemplo n.º 1
0
    def open_remsvc_file(self, uri):

        handle = uri.short_name[:-8]

        for rec_path in self.records:
            rec = bluetool.get_record(sys_bus, rec_path)
            if str(rec.GetHandle()) == handle:
                return RemSvcFileHandle(rec_path, self)

        raise gnomevfs.NotFoundError
Exemplo n.º 2
0
    def open_remsvc_file(self, uri):

        handle = uri.short_name[:-8]

        for rec_path in self.records:
            rec = bluetool.get_record(sys_bus, rec_path)
            if str(rec.GetHandle()) == handle:
                return RemSvcFileHandle(rec_path, self)

        raise gnomevfs.NotFoundError
Exemplo n.º 3
0
    def __init__(self, rec_path, dir_handle):
        VfsDesktopFileBase.__init__(self)

        print 'RemSvcFileHandle(', rec_path, ')'

        self.record = bluetool.get_record(sys_bus, rec_path)

        self.basename = str(self.record.GetHandle())

        ids = self.record.GetClassIdList()
        name = bluetool.SDP_SVCLASS_IDS[ids[0]]

        icon_path = 'file://' + bluetool.svclass2icon(ids[0])

        self.contents = REMSVC_FILE_PROTOTYPE % (name, icon_path)
Exemplo n.º 4
0
    def __init__(self, rec_path, dir_handle):
        VfsDesktopFileBase.__init__(self)

        print "RemSvcFileHandle(", rec_path, ")"

        self.record = bluetool.get_record(sys_bus, rec_path)

        self.basename = str(self.record.GetHandle())

        ids = self.record.GetClassIdList()
        name = bluetool.SDP_SVCLASS_IDS[ids[0]]

        icon_path = "file://" + bluetool.svclass2icon(ids[0])

        self.contents = REMSVC_FILE_PROTOTYPE % (name, icon_path)
	def add_record(self,service_store,rec_path):

		print 'new record @', rec_path

		rec = bluetool.get_record(self.bus,rec_path)

		obj = { 'path': rec_path, 'rec': rec }

		name = '<Unknown>'
		desc = ''
		try:
			name = rec.GetServiceName()
		except:
			pass

		try:
			svc_id = rec.GetClassIdList()
			#print svc_id
			desc = bluetool.SDP_SVCLASS_IDS[svc_id[0]]
		except:
			pass

		service_store.append(None,[obj, name, desc])