Skip to content

Commit

Permalink
added staticmethod decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
celiao committed Dec 17, 2013
1 parent d0a0e7a commit d559d07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tmdbsimple/tmdbsimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, api_key, version=3):
TMDB.api_key = str(api_key)
TMDB.url = 'https://api.themoviedb.org' + '/' + str(version)

@staticmethod
def _request(method, path, params={}, json_body={}):
url = TMDB.url + '/' + path + '?api_key=' + TMDB.api_key
if method == 'GET':
Expand Down Expand Up @@ -46,6 +47,7 @@ def _request(method, path, params={}, json_body={}):
# >>> response = movie.info()
# >>> movie.title # instead of response['title']
#
@staticmethod
def _set_attrs_to_values(object, response={}):
for key in response.keys():
setattr(object, key, response[key])
Expand Down

0 comments on commit d559d07

Please sign in to comment.