'Return the contents of a property as a GetPropertyReply
If unpack is specified, a tuple of values is returned.  The type to
unpack, either `str` or `int` must be specified.'

def get_property(self, prop, type=None, unpack=None):

    if (type is None):
        if (prop not in PropertyMap):
            raise ValueError('Must    specify    type    for    unknown    property.')
        else:
            (type, _) = PropertyMap[prop]
    try:
        r = self.conn.conn.core.GetProperty(False, self.wid, (self.conn.atoms[prop] if isinstance(prop, six.string_types) else prop), (self.conn.atoms[type] if isinstance(type, six.string_types) else type), 0, ((2 ** 32) - 1)).reply()
    except (xcffib.xproto.WindowError, xcffib.xproto.AccessError):
        logger.warning('X    error    in    GetProperty    (wid=%r,    prop=%r),    ignoring', self.wid, prop)
        if unpack:
            return []
        return None
    if (not r.value_len):
        if unpack:
            return []
        return None
    elif unpack:
        if (unpack is int):
            return r.value.to_atoms()
        elif (unpack is str):
            return r.value.to_string()
    else:
        return r
