New wrappers

you go ceasar you go
ᐧ

On Wed, Sep 24, 2014 at 1:15 PM, Ceasar Bautista <notifications@github.com>
wrote:

> In penn/directory.py:
>
> > +
> > +    @property
> > +    def headers(self):
> > +        """The HTTP headers needed for signed requests"""
> > +        return {
> > +            "Authorization-Bearer": self.bearer,
> > +            "Authorization-Token": self.token,
> > +        }
> > +
> > +    def _request(self, url, params=None):
> > +        """Make a signed request to the API, raise any API errors, and returning a tuple
> > +        of (data, metadata)"""
> > +        response = requests.get(url, params=params, headers=self.headers).json()
> > +
> > +        if response['service_meta']['error_text']:
> > +            raise ValueError(response['service_meta']['error_text'])
>
> This is duplicated. Probably worth making an abstract base class somewhere.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pennappslabs/penn-sdk-python/pull/15/files#r17985513>.
>