diff options
-rw-r--r-- | README.md | 38 |
1 files changed, 19 insertions, 19 deletions
@@ -25,7 +25,7 @@ pip install python-gitlab python-gitlab is considered stable. -## Bugs reports +## Bug reports Please report bugs and feature requests at https://github.com/gpocentek/python-gitlab/issues @@ -51,10 +51,10 @@ gl.auth() print(gl.user) # Get a list of projects -for p in gl.Project(): +for p in gl.projects.list(): print(p.name) # get associated issues - issues = p.Issue() + issues = p.issues.list() for issue in issues: closed = 0 if not issue.closed else 1 print(" %d => %s (closed: %d)" % (issue.id, issue.title, closed)) @@ -63,23 +63,23 @@ for p in gl.Project(): issue.save() # Get the first 10 groups (pagination) -for g in gl.Group(page=1, per_page=10): +for g in gl.groups.list(page=1, per_page=10): print(g) # To use pagination and retrieve all the items -for g in gl.Group(all=True): +for g in gl.groups.list(all=True): print(g) # Create a new project (as another_user) -p = gl.Project({'name': 'myCoolProject', 'wiki_enabled': False}) -p.save(sudo="another_user") +p = gl.project.create({'name': 'myCoolProject', 'wiki_enabled': False}, + sudo="another_user") print(p) ````` ## Command line use To use the command line tool, you need to define which GitLab server(s) can be -accessed. this can be done in 2 files: +accessed. This can be done in 2 files: * /etc/python-gitlab.cfg * ~/.python-gitlab.cfg @@ -116,16 +116,16 @@ validated (use false for self signed certificates, only useful with https). The `timeout` option defines after how many seconds a request to the Gitlab server should be abandonned. -Choosing a different server than the default one can be done at run time: +You can choose a different server than the default one at run time: ````` -gitlab --gitlab=remote [command] +gitlab --gitlab remote [command] ````` gitlab always requires 2 mandatory arguments. -The first argument is the object type on which we will act, the second one is -the action: +The first argument is the object type on which the program will act, the second +one is the action: ````` gitlab project list @@ -148,24 +148,24 @@ Some examples: gitlab project list # limit to 5 items per request, display the 1st page only -gitlab project list --page=1 --per-page=5 +gitlab project list --page 1 --per-page 5 # get a specific project (id 2): -gitlab project get --id=2 +gitlab project get --id 2 # get a list of snippets for this project: -gitlab project-issue list --project-id=2 +gitlab project-issue list --project-id 2 # delete a Snippet (id 3): -gitlab project-snippet delete --id=3 --project-id=2 +gitlab project-snippet delete --id 3 --project-id 2 # update a Snippet: -gitlab project-snippet update --id=4 --project-id=2 --code="My New Code" +gitlab project-snippet update --id 4 --project-id 2 --code "My New Code" # create a Snippet: -gitlab project-snippet create --project-id=2 +gitlab project-snippet create --project-id 2 Impossible to create object (Missing attribute(s): title, file-name, code) # oops, let's add the attributes: -gitlab project-snippet create --project-id=2 --title="the title" --file-name="the name" --code="the code" +gitlab project-snippet create --project-id 2 --title "the title" --file-name "the name" --code "the code" ````` |