Le vendredi 14 février 2014 11:04:14 UTC+1, Marc Leforestier a écrit :
>
>
>
> Le vendredi 14 février 2014 09:08:17 UTC+1, [email protected] a écrit :
>>
>> There is another way, please try it out!
>>
>> https://github.com/Itxaka/pyapi-gitlab
>> http://pyapi-gitlab.readthedocs.org/en/latest/
>>
>> git.createuser("name", "username", "password", "email", sudo="admin")
>>
>>
> Thanks. But it doesn't work :( 
> Perhaps because I have Gitlab 6.5.1 and it is too recent ?
> https://github.com/Itxaka/pyapi-gitlab 
>
> I have just tested the connection to gitlab and :
>
> # python
>
> Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
>
> [GCC 4.7.2] on linux2
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import gitlab
>
> >>> git = gitlab.Gitlab("gitlab.domain", private_token="myadmintoken")
>
> Traceback (most recent call last):
>
>   File "<stdin>", line 1, in <module>
>
> TypeError: __init__() got an unexpected keyword argument 'private_token'
>
> >>> git = gitlab.Gitlab("gitlab.domain")
>
> >>> git.login("admin","myadminpasswd")
>
> Traceback (most recent call last):
>
>   File "<stdin>", line 1, in <module>
>
>   File "/usr/local/lib/python2.7/dist-packages/gitlab/__init__.py", line 
> 58, in login
>
>     raise exceptions.HttpError(json.loads(request.content)['message'])
>
>   File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
>
>     return _default_decoder.decode(s)
>
>   File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
>
>     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
>
>   File "/usr/lib/python2.7/json/decoder.py", line 383, in raw_decode
>
>     raise ValueError("No JSON object could be decoded")
>
> ValueError: No JSON object could be decoded
>
>
>
Oups, it's woks better with :

 git = gitlab.Gitlab("*http://*gitlab.domain";, "myadmintoken")

But it answers *False* to all my requests ;)

# python

Python 2.7.3 (default, Jan  2 2013, 13:56:14) 

[GCC 4.7.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import gitlab

>>> git = gitlab.Gitlab("*http://*gitlab.domain";, "myadmintoken")

>>> print git.getusers()

False

>>> git.createuser("Test 1", "test", "toto", "[email protected]")

False

>>> git.createuser("Test 1", "test", "toto", "[email protected]",sudo="admin")

False

>>> 

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to