File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -47,28 +47,32 @@ gl = Gitlab('http://192.168.123.107', 'JVNSESs8EwWRx5yDxM5q')
47
47
# Connect to get the current user
48
48
gl.auth()
49
49
# Print the user informations
50
- print gl.user
50
+ print ( gl.user)
51
51
52
52
# Get a list of projects
53
53
for p in gl.Project():
54
- print (p.name)
54
+ print (p.name)
55
55
# get associated issues
56
56
issues = p.Issue()
57
57
for issue in issues:
58
58
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))
60
60
# and close them all
61
61
issue.state_event = " close"
62
62
issue.save()
63
63
64
64
# Get the first 10 groups (pagination)
65
65
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)
67
71
68
72
# Create a new project (as another_user)
69
73
p = gl.Project({' name' : ' myCoolProject' , ' wiki_enabled' : False })
70
74
p.save(sudo = " another_user" )
71
- print p
75
+ print (p)
72
76
`````
73
77
74
78
## Command line use
You can’t perform that action at this time.
0 commit comments