Skip to content

Commit 6cc8126

Browse files
author
Gauvain Pocentek
committed
update README for list(all=True)
1 parent a9e8da9 commit 6cc8126

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,32 @@ gl = Gitlab('http://192.168.123.107', 'JVNSESs8EwWRx5yDxM5q')
4747
# Connect to get the current user
4848
gl.auth()
4949
# Print the user informations
50-
print gl.user
50+
print(gl.user)
5151

5252
# Get a list of projects
5353
for p in gl.Project():
54-
print (p.name)
54+
print(p.name)
5555
# get associated issues
5656
issues = p.Issue()
5757
for issue in issues:
5858
closed = 0 if not issue.closed else 1
59-
print (" %d => %s (closed: %d)" % (issue.id, issue.title, closed))
59+
print(" %d => %s (closed: %d)" % (issue.id, issue.title, closed))
6060
# and close them all
6161
issue.state_event = "close"
6262
issue.save()
6363

6464
# Get the first 10 groups (pagination)
6565
for g in gl.Group(page=1, per_page=10):
66-
print (g)
66+
print(g)
67+
68+
# To use pagination and retrieve all the items
69+
for g in gl.Group(all=True):
70+
print(g)
6771

6872
# Create a new project (as another_user)
6973
p = gl.Project({'name': 'myCoolProject', 'wiki_enabled': False})
7074
p.save(sudo="another_user")
71-
print p
75+
print(p)
7276
`````
7377

7478
## Command line use

0 commit comments

Comments
 (0)