Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
jens.kleineheismann
python-kitgvapi
Commits
9012b335
Commit
9012b335
authored
Jul 31, 2015
by
jens.kleineheismann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed creation of new groups...
Added a note about basicConfig() to the readme file.
parent
68009c03
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
README.rst
README.rst
+6
-1
kitgvapi/client.py
kitgvapi/client.py
+6
-2
setup.py
setup.py
+1
-1
No files found.
README.rst
View file @
9012b335
...
...
@@ -25,16 +25,21 @@ USAGE
iism = Oe('IISM')
for g in iism.get_groups():
print g.name
iism.create_group('IISM-EM-newgroup', 'Neue Gruppe')
staff = Group('IISM-EM-OU-Staff')
for u in staff.get_users(effective=True):
print "%s %s (%s)" % (u.firstname, u.lastname, u.samaccount)
for g in staff.get_groups():
print
g.name
print
"%s (%s)" % (g.name, g.description)
me = User('zy8373')
others = me.oe.get_users()
Note:
-----
basicConfig() is not thread safe and is subject to change.
LICENCE
=======
...
...
kitgvapi/client.py
View file @
9012b335
...
...
@@ -34,10 +34,14 @@ class Client(object):
r
.
raise_for_status
()
return
r
def
_post
(
self
,
url
,
data
=
None
):
def
_post
(
self
,
url
,
data
=
None
,
headers
=
None
):
if
data
is
None
:
data
=
{}
r
=
requests
.
post
(
url
,
verify
=
True
,
auth
=
self
.
config
.
credentials
,
data
=
data
)
if
headers
is
None
:
headers
=
{}
if
'content-type'
not
in
headers
:
headers
[
'content-type'
]
=
'application/json'
r
=
requests
.
post
(
url
,
verify
=
True
,
auth
=
self
.
config
.
credentials
,
data
=
data
,
headers
=
headers
)
if
r
.
status_code
!=
requests
.
codes
.
ok
:
r
.
raise_for_status
()
return
r
...
...
setup.py
View file @
9012b335
...
...
@@ -8,7 +8,7 @@ def readme():
setup
(
name
=
'python-kitgvapi'
,
version
=
'0.
2
.dev0'
,
version
=
'0.
3
.dev0'
,
description
=
(
'Python bindings for KIT Gruppenverwaltung REST API'
),
long_description
=
readme
(),
author
=
'Jens Kleineheismann'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment