microsoft / microsoft/azure-devops-python-api
Error in running the code give in ReadMe file.
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 684
- Fork
- 218
- Merge medio
- 8g 10h
- PR unite (30g)
- 1
Descrizione
Steps to re-produce:
provide the PAT and org name and execute the code.
The code used from the README File:
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
import pprint
# Fill in with your personal access token and org URL
personal_access_token = 'YOURPAT'
organization_url = 'https://dev.azure.com/YOURORG'
# Create a connection to the org
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)
# Get a client (the "core" client provides access to projects, teams, etc)
core_client = connection.clients.get_core_client()
# Get the first page of projects
get_projects_response = core_client.get_projects()
index = 0
while get_projects_response is not None:
for project in get_projects_response.value:
pprint.pprint("[" + str(index) + "] " + project.name)
index += 1
if get_projects_response.continuation_token is not None and get_projects_response.continuation_token != "":
# Get the next page of projects
get_projects_response = core_client.get_projects(continuation_token=get_projects_response.continuation_token)
else:
# All projects have been retrieved
get_projects_response = None
The Error I got:
project in get_projects_response.value:
AttributeError: 'list' object has no attribute 'value'
Suggested fix in code:
# Get a client (the "core" client provides access to projects, teams, etc)
core_client = connection.clients.get_core_client()
# Get the first page of projects
get_projects_response = core_client.get_projects()
index = 0
for project in get_projects_response:
pprint.pprint("[" + str(index) + "] " + project.name)
index += 1
The output:
'[0] Interns_round'
'[1] Smart_Iot_Lab'
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’esempio Python di elencazione dei progetti nel README ed eseguilo usando un PAT e l’URL di un’organizzazione. Confronta la gestione documentata della risposta con l’elenco osservato restituito da get_projects(); il lavoro è completato quando l’esempio nel README viene eseguito senza l’AttributeError e produce l’output dei progetti indicato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 48/100