def build_user(self, result_data): user = User(result_data['user_id']) user.aliases = result_data['aliases'] if 'aliases' in result_data else None user.is_stashed = True user.last_modified = ( result_data['last_modified'] if 'last_modified' in result_data else None ) user.name = result_data['name'] if 'name' in result_data else None user.plugin_data = ( result_data['plugin_data'] if 'plugin_data' in result_data and isinstance(result_data['plugin_data'], dict) else None ) user.points = ( result_data['points'] if 'points' in result_data and isinstance(result_data['points'], (int, long)) else 0 ) user.timestamp = result_data['timestamp'] if 'timestamp' in result_data else None user.usernames = ( result_data['usernames'] if 'usernames' in result_data and isinstance(result_data['usernames'], dict) else None ) user.permissions = result_data['permissions'] if 'permissions' in result_data else None return user
def create_user_object(handle, name, aliases): client = 'skype' user = User(handle) user.aliases = aliases user.client = client user.name = name logger.debug("create_user_object - user is '%s'" % user) return user
def create_user_object(handle, name, aliases): client = 'skype' user = User(handle) user.aliases = aliases user.client = client user.name = name logger.debug("create_user_object - user is '%s'" % (user)) return user
def build_user(self, result_data): user = User(result_data.eid) user.name = result_data["name"] if "name" in result_data else None user.usernames = result_data["usernames"] if "usernames" in result_data else {} user.points = result_data["points"] if "points" in result_data else None user.permissions = result_data["permissions"] if "permissions" in result_data else [] user.aliases = result_data["aliases"] if "aliases" in result_data else [] user.is_stashed = True return user
def build_user(self, result_data): user = User(result_data.eid) user.name = result_data['name'] if 'name' in result_data else None user.usernames = result_data['usernames'] if 'usernames' in result_data else {} user.points = result_data['points'] if 'points' in result_data else None user.permissions = result_data['permissions'] if 'permissions' in result_data else [] user.aliases = result_data['aliases'] if 'aliases' in result_data else [] user.image = result_data['image'] if 'image' in result_data else None user.is_stashed = True return user