def to_yt_user(user): u = User() u.login = user[u"userName"] u.email = user[u"email"] if u"name" in user: u.fullName = user[u"name"] return u
def to_yt_user(user): u = User() u.login = user[u'userName'] u.email = user[u'email'] if u'name' in user: u.fullName = user[u'name'] return u
def _to_yt_user(fb_user) : user = User() user.login = fb_user.login.replace(' ', '_') user.fullName = fb_user.login user.email = fb_user.email user.group = fb_user.user_type return user
def _to_yt_user(self, value): user = self._source.get_user(value) yt_groups = [] for g in self._source.get_groups_for_user(value): ytg = Group() ytg.name = g yt_groups.append(ytg) yt_user = User() if user[u"email"] is None: yt_user.email = "*****@*****.**" yt_user.login = user[u"name"].replace(" ", "_") else: yt_user.email = user[u"email"] yt_user.login = yt_user.email yt_user.fullName = user[u"name"] yt_user.getGroups = lambda: yt_groups return yt_user
def _to_yt_user(self, value): yt_user = User() yt_user.login = value.replace(' ', '_') yt_user.fullName = value yt_user.email = value return yt_user
def import_user(target, user): yt_user = User() yt_user.login = user yt_user.email = user target.importUsers([yt_user])