def deviceDescription(self): '''Get the C{NSDevice} description (L{Adict}). ''' if self._deviceDescription is None: # d = nsDescription2dict(self.NS.deviceDescription()) # _ = d.NSDeviceIsPrinter # preload self._deviceDescription = ns2py(self.NS.deviceDescription()) return self._deviceDescription
def screens(self): '''Get the BuiltIn and other, External screens iff present (C{dict} of C{Screen}s). @note: Each screen is represented twice and accessable by 2 C{int} keys, a 0-based index and its C{displayID}. The BuiltIn screen has index key 0, always. @see: Methods C{__call__} and C{items}. ''' if not self._screens: x, d = 1, {0: None} for ns in ns2py(self.NS.screens()): s = Screen(ns) if s.isBuiltIn: d[0] = d[s.displayID] = BuiltInScreen(s) else: d[x] = d[s.displayID] = ExternalScreen(s) x += 1 self._screens = d self._len = x return self._screens
def deviceDescription(self): '''Get the device descriptions (L{Adict}). ''' if self._deviceDescription is None: self._deviceDescription = ns2py(self.NS.deviceDescription()) return self._deviceDescription
def __contains__(self, elem): if isinstance(elem, ObjCInstance): elem = ns2py(elem) return self._set.__contains__(elem)
def description(self): '''Get printer description (C{json}). ''' # XXX use send_message, avoiding printer.NS.description() d = send_message(self.NS, 'description', restype=Id_t) return ns2py(d)
def deviceDescription(self): '''Get the C{NSDevice} description (C{dict}). ''' return ns2py(self.NS.deviceDescription())