pivotalcli/api/__init__.py

16 lines
450 B
Python
Raw Normal View History

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}