def get_status_icon(status, size): if not valid_status(status): status = 'normal' fname = '%dpx-status_icon_%s.png' % (size, status) return gtk.gdk.pixbuf_new_from_file_at_size(join(get_dir(ICON_DIR), fname), size, size)
for name in value: if name not in tempcommunities: communities.append(name) return communities userattributes['communities'] = Meta_Attribute(list, public=True, is_valid=lambda n, v: validate_list(v, valid_community), default=[DEFAULT_COMMUNITY_NAME]) userattributes['communities'].is_required() userattributes['communities'].process_before_save(community_filter) userattributes['faceversion'] = Meta_Attribute(int, public=True, is_valid=is_unsigned_int, default=0) userattributes['fscounter'] = Meta_Attribute(int, public=True, is_valid=is_unsigned_int, default=0) userattributes['fscounter'].is_required() userattributes['nick'] = Meta_Attribute(str, public=True, is_valid=lambda n, v: valid_nick(v), default=TP_NICK_DEFAULT) userattributes['nick'].is_required() userattributes['status_icon'] = Meta_Attribute(str, public=True, is_valid=lambda n, v: valid_status(v)) userattributes['uid'] = Meta_Attribute(str, public=True, is_valid=lambda n, v: valid_uid(v)) userattributes['uid'].is_required() # Private attributes userattributes['key_fname'] = privatestring() userattributes['privcommunities'] = Meta_Attribute(list, public=False, is_valid=lambda n, v: type(v) == list and validate_list(v, valid_cid), default=[]) userattributes['remotes'] = Meta_Attribute(list, public=False) userattributes['friend'] = Meta_Attribute(bool, public=False, save=True, default=False) userattributes['myfaceversion'] = privateunsignedint() # Private non-saved attributes userattributes['ip'] = Meta_Attribute(str, public=False, save=False, is_valid=lambda n, v: valid_ip(v)) userattributes['port'] = Meta_Attribute(int, public=False, save=False, is_valid=lambda n, v: valid_port(v)) userattributes['protocolversion'] = Meta_Attribute(int, public=False, save=False, is_valid=lambda n, v: valid_protocol_version(v), default=PROXIMATE_PROTOCOL_VERSION)