Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 1e9e9e35 authored by vernada's avatar vernada
Browse files

added in the leankit py library the card, board endpoint support fixes #25751

parent 0e36a459
Branches EDELIVERY-13982-upgrade-libraries-and-plugins
No related tags found
No related merge requests found
...@@ -14,16 +14,57 @@ def get_users(): ...@@ -14,16 +14,57 @@ def get_users():
return api._get('/io/user?limit=200') return api._get('/io/user?limit=200')
def get_user(user_info):
log.debug('Getting user')
return api._get('/io/user?search=' + user_info)
def create_user(duser): def create_user(duser):
log.debug('Creating users') log.debug('Creating users')
return api._post('/io/user', duser) return api._post('/io/user', duser)
''' def get_invitations():
log.debug('Getting intation user pending')
return api._get('/io/invitation?limit=200')
def get_boards(): def get_boards():
log.debug('Getting boards') log.debug('Getting boards')
return api._get('/Boards') return api._get('/io/board?limit=100')
def get_board(board_name):
log.debug('Getting board')
return api._get('/io/board?limit=100&search=' + board_name)
def get_board_detail(board_id):
log.debug('Getting board')
return api._get('/io/board/' + board_id)
def get_card(card_id):
log.debug('Getting card')
return api._get('/io/card/' + card_id)
def create_card(dcard):
log.debug('Assigning card')
return api._post('/io/card/', dcard)
def card_assign(assign_card):
log.debug('Assigning card')
return api._post('/io/card/assign', assign_card)
def get_cardtype_from_board(board_id):
log.debug('Getting card')
return api._get('/io/board/' + board_id + '/cardType')
'''
def get_newer_if_exists(board_id, version, timezone='UTC'): def get_newer_if_exists(board_id, version, timezone='UTC'):
""" Downloads a board if a newer version number exists """ """ Downloads a board if a newer version number exists """
url = '/Board/{}/BoardVersion/{}/GetNewerIfExists' url = '/Board/{}/BoardVersion/{}/GetNewerIfExists'
...@@ -35,5 +76,4 @@ def get_newer_if_exists(board_id, version, timezone='UTC'): ...@@ -35,5 +76,4 @@ def get_newer_if_exists(board_id, version, timezone='UTC'):
return None return None
''' '''
log = getLogger(__name__) log = getLogger(__name__)
import logging import logging
import requests import requests
from pprint import pformat
from json import dumps as json_dumps
from . import env_user from . import env_user
...@@ -56,6 +58,18 @@ class Leankit(object): ...@@ -56,6 +58,18 @@ class Leankit(object):
except ValueError: except ValueError:
raise IOError("Invalid response") raise IOError("Invalid response")
else: else:
print(request.status_code)
print(request.content)
print('Playload:%s' % (json_dumps(params, sort_keys=True, indent=4)))
try:
print('HEADERS:' % (pformat(request.headers)))
except:
pass
try:
print('TEXT:' % (pformat(request.text)))
except:
pass
msg = 'Server responded with code {0.status_code}'.format(request) msg = 'Server responded with code {0.status_code}'.format(request)
raise ConnectionError(msg) raise ConnectionError(msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment