Guest User

Untitled

a guest
Sep 19th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.89 KB | None | 0 0
  1. from typing import Dict, AnyStr, TypeVar, NamedTuple
  2.  
  3. ReqResponse = TypeVar('ReqResponse', Dict, AnyStr)
  4.  
  5. UrlReq = NamedTuple('UrlReq', [
  6.     ('url', str),
  7.     ('key', str),
  8.     ('method', str),
  9.     ('as_json', bool),
  10.     ('raw', bool)
  11. ])
  12.  
  13. # ====================================================
  14.  
  15. class BitBucket(object):
  16.     def __init__(
  17.             self,
  18.             options: Dict,
  19.             username: AnyStr=None,
  20.             password: AnyStr=None,
  21.         ) -> None:
  22.  
  23.         pass
  24.  
  25.     def __req(
  26.             self,
  27.             url: AnyStr,
  28.             method: AnyStr='GET',
  29.             as_json: bool=True,
  30.             raw: bool=False,
  31.             timeout: Union[float, tuple]=(5.00, 20.00), # tuple(connect, read) timeout
  32.             **params
  33.         ) -> ReqResponse:
  34.  
  35.         pass
  36.  
  37.     def __do_reqs(
  38.         self,
  39.         urls: Sequence[UrlReq],
  40.         new_binding_key: AnyStr,
  41.         binding_attribute: Dict,
  42.         bind_errors: bool=False,
  43.     ) -> Dict:
  44.  
  45.         pass
  46.  
  47.     @property
  48.     def user(self) -> Dict:
  49.         return self.__req('/user')
  50.  
  51.     @property
  52.     def repositories(self) -> Dict:
  53.         if self._repositories is None:
  54.             self._repositories = self.get_repositories()
  55.         return self._repositories
  56.  
  57.     def get_repositories(
  58.             self,
  59.             with_readme: bool=True
  60.         ) -> Dict:
  61.  
  62. # ====================================================
  63.  
  64. from typing import Iterable, Dict, AnyStr, Tuple
  65.  
  66. def has_graph_subsection(data: AnyStr=''):
  67.     pass
  68.  
  69. def make_graph(
  70.         repos: Iterable[Dict]=None,
  71.         graphviz_kwargs: Dict=None,
  72.         graphviz_attrs: Dict=None,
  73.         flat_text: Tuple[AnyStr, AnyStr]=None
  74.     ):
  75.  
  76.     pass
  77.  
  78. # ====================================================
  79.  
  80. from typing import List
  81.  
  82. def settings_with_precidence(modules: List=None, overwrite: bool=True):
  83.     pass
Advertisement
Add Comment
Please, Sign In to add comment