2019-02-05 15:10:31 +00:00
|
|
|
from typing import Any, Callable, Dict
|
|
|
|
from config import Config
|
|
|
|
|
|
|
|
_BASE_URL = 'https://www.pivotaltracker.com/services/v5'
|
|
|
|
|
|
|
|
|
|
|
|
def _with_token(function: Callable) -> Callable:
|
|
|
|
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
|
|
|
return function(token=Config['user']['api_token'],
|
|
|
|
*args, **kwargs)
|
|
|
|
return wrapper
|
|
|
|
|
|
|
|
|
|
|
|
def _headers(token: str, **other: str) -> Dict[str, Any]:
|
|
|
|
return {'X-TrackerToken': token, **other}
|