@@ -25,7 +25,7 @@ pip install python-gitlab
2525
2626python-gitlab is considered stable.
2727
28- ## Bugs reports
28+ ## Bug reports
2929
3030Please report bugs and feature requests at
3131https://github.com/gpocentek/python-gitlab/issues
@@ -51,10 +51,10 @@ gl.auth()
5151print (gl.user)
5252
5353# Get a list of projects
54- for p in gl.Project ():
54+ for p in gl.projects.list ():
5555 print (p.name)
5656 # get associated issues
57- issues = p.Issue ()
57+ issues = p.issues.list ()
5858 for issue in issues:
5959 closed = 0 if not issue.closed else 1
6060 print (" %d => %s (closed: %d )" % (issue.id, issue.title, closed))
@@ -63,23 +63,23 @@ for p in gl.Project():
6363 issue.save()
6464
6565# Get the first 10 groups (pagination)
66- for g in gl.Group (page = 1 , per_page = 10 ):
66+ for g in gl.groups.list (page = 1 , per_page = 10 ):
6767 print (g)
6868
6969# To use pagination and retrieve all the items
70- for g in gl.Group (all = True ):
70+ for g in gl.groups.list (all = True ):
7171 print (g)
7272
7373# Create a new project (as another_user)
74- p = gl.Project ({' name' : ' myCoolProject' , ' wiki_enabled' : False })
75- p.save( sudo = " another_user" )
74+ p = gl.project.create ({' name' : ' myCoolProject' , ' wiki_enabled' : False },
75+ sudo = " another_user" )
7676print (p)
7777`````
7878
7979## Command line use
8080
8181To use the command line tool, you need to define which GitLab server(s) can be
82- accessed. this can be done in 2 files:
82+ accessed. This can be done in 2 files:
8383
8484* /etc/python-gitlab.cfg
8585* ~ /.python-gitlab.cfg
@@ -116,16 +116,16 @@ validated (use false for self signed certificates, only useful with https).
116116The ` timeout ` option defines after how many seconds a request to the Gitlab
117117server should be abandonned.
118118
119- Choosing a different server than the default one can be done at run time:
119+ You can choose a different server than the default one at run time:
120120
121121`````
122- gitlab --gitlab= remote [command]
122+ gitlab --gitlab remote [command]
123123`````
124124
125125gitlab always requires 2 mandatory arguments.
126126
127- The first argument is the object type on which we will act, the second one is
128- the action:
127+ The first argument is the object type on which the program will act, the second
128+ one is the action:
129129
130130`````
131131gitlab project list
@@ -148,24 +148,24 @@ Some examples:
148148gitlab project list
149149
150150# limit to 5 items per request, display the 1st page only
151- gitlab project list --page= 1 --per-page= 5
151+ gitlab project list --page 1 --per-page 5
152152
153153# get a specific project (id 2):
154- gitlab project get --id= 2
154+ gitlab project get --id 2
155155
156156# get a list of snippets for this project:
157- gitlab project-issue list --project-id= 2
157+ gitlab project-issue list --project-id 2
158158
159159# delete a Snippet (id 3):
160- gitlab project-snippet delete --id= 3 --project-id= 2
160+ gitlab project-snippet delete --id 3 --project-id 2
161161
162162# update a Snippet:
163- gitlab project-snippet update --id= 4 --project-id= 2 --code= " My New Code"
163+ gitlab project-snippet update --id 4 --project-id 2 --code " My New Code"
164164
165165# create a Snippet:
166- gitlab project-snippet create --project-id= 2
166+ gitlab project-snippet create --project-id 2
167167Impossible to create object (Missing attribute(s): title, file-name, code)
168168
169169# oops, let's add the attributes:
170- gitlab project-snippet create --project-id= 2 --title= " the title" --file-name= " the name" --code= " the code"
170+ gitlab project-snippet create --project-id 2 --title " the title" --file-name " the name" --code " the code"
171171`````
0 commit comments