ooxcb.atoms

class ooxcb.atoms.AtomDict(conn, *boo, **far)

A dictionary which is able to lazily load an atom and that contains all predefined atoms from ooxcb.constant.

dic = AtomDict(my_connection)
print dic['WM_CLASS'] # Yay, it is lazily loaded!
aid = dic['WM_CLASS'].get_internal()
# ... and vice-versa:
assert dic.get_by_id(aid) == dic['WM_CLASS']

You should not modify the dictionary manually.

add_atom(name, atom)

add the atom atom with the name name to the cache.

get_by_id(aid)

return an atom instance for the ID aid.

That is not part of the connection’s XID cache because atom ids do not seem to be part of the XID space; they have their own space.

For aid == 0, it will return None, but this may change in the future.

Todo:currently, this depends on ooxcb.protocol.xproto. That’s not really consistent.