From 80690774a460f04a82cf2475afee49048444d3fc Mon Sep 17 00:00:00 2001 From: Ddhruv <54676859+Ddhruv-IOT@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:18:19 +0530 Subject: [PATCH] Modified the example code The example code was not running. Modified the code to fix the error faced previously More reference here: https://github.com/microsoft/azure-devops-python-api/issues/494 --- README.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 30a41992..9deb91be 100644 --- a/README.md +++ b/README.md @@ -34,17 +34,11 @@ 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 +for project in get_projects_response: + pprint.pprint("[" + str(index) + "] " + project.name) + index += 1 ``` ## API documentation