Skip to content

Commit 46c84f8

Browse files
authored
Merge pull request #261 from microsoft/users/tedchamb/ct
get rid of debug print statement, fix readme to adapt to continuation token support.
2 parents e7b68a9 + 390fff5 commit 46c84f8

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,19 @@ connection = Connection(base_url=organization_url, creds=credentials)
3232
# Get a client (the "core" client provides access to projects, teams, etc)
3333
core_client = connection.clients.get_core_client()
3434

35-
# Get the list of projects in the org
36-
projects = core_client.get_projects()
37-
38-
# Show details about each project in the console
39-
for project in projects:
40-
pprint.pprint(project.__dict__)
35+
# Get the first page of projects
36+
get_projects_response = core_client.get_projects()
37+
index = 0
38+
while get_projects_response is not None:
39+
for project in get_projects_response.value:
40+
pprint.pprint("[" + str(index) + "] " + project.name)
41+
index += 1
42+
if get_projects_response.continuation_token is not None and get_projects_response.continuation_token != "":
43+
# Get the next page of projects
44+
get_projects_response = core_client.get_projects(continuation_token=get_projects_response.continuation_token)
45+
else:
46+
# All projects have been retrieved
47+
get_projects_response = None
4148
```
4249

4350
## API documentation

azure-devops/azure/devops/client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ def _create_request_message(self, http_method, location_id, route_values=None,
128128
route_values)
129129
logger.debug('Route template: %s', location.route_template)
130130
url = self._client.format_url(route_template, **route_values)
131-
import pprint
132-
pprint.pprint("url=" + url)
133131
request = ClientRequest(method=http_method, url=self._client.format_url(url))
134132
if query_parameters:
135133
request.format_parameters(query_parameters)

azure-devops/azure/devops/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
VERSION = "5.1.0b2"
6+
VERSION = "5.1.0b3"

azure-devops/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from setuptools import setup, find_packages
77

88
NAME = "azure-devops"
9-
VERSION = "5.1.0b2"
9+
VERSION = "5.1.0b3"
1010

1111
# To install the library, run the following
1212
#

0 commit comments

Comments
 (0)