GithubHelp home page GithubHelp logo

crespy's People

Contributors

jgoldshlag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

suevraylap sult

crespy's Issues

Regression introduced by last update

Running sample.py with the current version of the code results in the following error (under Python 2.7.5):

Traceback (most recent call last):
  File "sample.py", line 16, in <module>
    for item in prices['items']:
  File "C:\Users\Jonathan\Documents\EVE\crespy-master\crespy-master\crespy.py",
line 42, in __getitem__
    child._headers = self._headers
AttributeError: 'list' object has no attribute '_headers'

I'm not sure why we need headers if the child is not a href, but if we really need to keep them we need to make child a class which has a _headers attribute defined.

Header data is dropped when traversing object tree dictionary on keys other than 'href'

CrespyObj::__getitem__ will discard the _header values when key is not "href"
This causes Authenticated CREST calls to fail by stripping the Authorization-Header

Following alternative implementation fixed the problem for me:

def  __getitem__(self,key):
     if key == u"href":
            child = CrespyObj()
            child._url = self._data[key]
            child._headers = self._headers
            return child
        else:
            child = self._data[unicode(key)]
            child._headers = self._headers
            return child

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.