Skip to content

Commit

Permalink
update README for list(all=True)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed Aug 21, 2015
1 parent a9e8da9 commit 6cc8126
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Expand Up @@ -47,28 +47,32 @@ gl = Gitlab('http://192.168.123.107', 'JVNSESs8EwWRx5yDxM5q')
# Connect to get the current user
gl.auth()
# Print the user informations
print gl.user
print(gl.user)

# Get a list of projects
for p in gl.Project():
print (p.name)
print(p.name)
# get associated issues
issues = p.Issue()
for issue in issues:
closed = 0 if not issue.closed else 1
print (" %d => %s (closed: %d)" % (issue.id, issue.title, closed))
print(" %d => %s (closed: %d)" % (issue.id, issue.title, closed))
# and close them all
issue.state_event = "close"
issue.save()

# Get the first 10 groups (pagination)
for g in gl.Group(page=1, per_page=10):
print (g)
print(g)

# To use pagination and retrieve all the items
for g in gl.Group(all=True):
print(g)

# Create a new project (as another_user)
p = gl.Project({'name': 'myCoolProject', 'wiki_enabled': False})
p.save(sudo="another_user")
print p
print(p)
`````

## Command line use
Expand Down

0 comments on commit 6cc8126

Please sign in to comment.