Commit 9012b335 authored by jens.kleineheismann's avatar jens.kleineheismann

Fixed creation of new groups...

Added a note about basicConfig() to the readme file.
parent 68009c03
......@@ -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
=======
......
......@@ -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
......
......@@ -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',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment