поэтому я прочитал всю документацию о библиотеке python-gitlab, но не смог найти для него некоторые атрибуты.
это мой код
Код: Выделить всё
import gitlab
import time
from gitlab.exceptions import GitlabCreateError
gitlab_url = 'gitlab.com'
new_gitlab_url = 'gitlab.com'
private_token = 'something in token'
new_private_token = 'something in token'
group_id = 1804
new_group_id = 4178
gl = gitlab.Gitlab(new_gitlab_url, private_token=new_private_token)
gl.auth()
print("Authentication to NEW is successful!")
new_group = gl.groups.get(new_group_id)
new_projects = new_group.projects.list(get_all=True, iterator=True)
new_projects_ids = [(project.id, project.name) for project in new_projects]
print(new_projects_ids)
def get_group_full_url_by_id(new_group_id):
group = gl.groups.get(new_group_id)
projects = group.projects.list(get_all=True, iterator=True)
projects_urls = [project.full_path for project in projects]
# print(projects_ids)
return projects_urls
project_urls = get_group_full_url_by_id(new_group_id)
print(project_urls)
Код: Выделить всё
Exception has occurred: AttributeError
'GroupProject' object has no attribute 'full_path'
was created via a
list() call and only a subset of the data may be present. To ensure
all data is present get the object using a get(object.id) call. For
more details, see:
https://python-gitlab.readthedocs.io/en/v4.2.0/faq.html#attribute-error-list
File "C:\Users\KAMBAROK\Desktop\bot\testing verions\test.py", line 30, in get_group_full_url_by_id
projects_urls = [project.full_path for project in projects]
^^^^^^^^^^^^^^^^^
File "C:\Users\KAMBAROK\Desktop\bot\testing verions\test.py", line 34, in
project_urls = get_group_full_url_by_id(new_group_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GroupProject' object has no attribute 'full_path'
was created via a
list() call and only a subset of the data may be present. To ensure
all data is present get the object using a get(object.id) call. For
more details, see:
https://python-gitlab.readthedocs.io/en/v4.2.0/faq.html#attribute-error-list
Подробнее здесь: https://stackoverflow.com/questions/777 ... -in-python