Beispiel #1
0
def repo_starred_star(user_id: int, access_token: str):
    starred, code = user_starred(access_token)
    if not starred:
        return False

    attitudes = UserAttitude.liked_by_user(user_id)
    lst = [user_starred_star(r.repo.full_name, access_token) for r in attitudes
           if not [x for x in starred if x['full_name'] == r.repo.full_name]]

    return len(lst)
Beispiel #2
0
def repo_starred_star(user_id: int, access_token: str):
    starred, code = user_starred(access_token)
    if not starred:
        return False

    attitudes = UserAttitude.list_liked_by_user(user_id)

    lst_in = [repo_like(s['full_name'], user_id) for s in starred
              if not [a for a in attitudes if s['full_name'] == a.repo.full_name]]

    lst_out = [user_starred_star(r.repo.full_name, access_token) for r in attitudes
               if not [x for x in starred if x['full_name'] == r.repo.full_name]]

    return len(lst_out), len(list(filter(None, lst_in)))
Beispiel #3
0
def repo_starred_star(user_id: int, access_token: str):
    starred, code = user_starred(access_token)
    if not starred:
        return False

    attitudes = UserAttitude.list_liked_by_user(user_id)

    lst_in = [
        repo_like(s['full_name'], user_id) for s in starred
        if not [a for a in attitudes if s['full_name'] == a.repo.full_name]
    ]

    lst_out = [
        user_starred_star(r.repo.full_name, access_token) for r in attitudes
        if not [x for x in starred if x['full_name'] == r.repo.full_name]
    ]

    return len(lst_out), len(list(filter(None, lst_in)))