[Python-modules-commits] [python-tmdbsimple] 01/04: Import python-tmdbsimple_1.4.1.orig.tar.gz

Michael Fladischer fladi at moszumanska.debian.org
Wed Jan 11 11:54:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository python-tmdbsimple.

commit d5332873d231a1096e31bf40447364302c09424f
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Wed Jan 11 12:36:49 2017 +0100

    Import python-tmdbsimple_1.4.1.orig.tar.gz
---
 setup.py                    |  4 +--
 tests/test_account.py       |  2 +-
 tests/test_changes.py       |  2 +-
 tests/test_configuration.py |  2 +-
 tests/test_discover.py      | 12 +++++++--
 tests/test_find.py          |  2 +-
 tests/test_genres.py        |  2 +-
 tests/test_movies.py        |  2 +-
 tests/test_people.py        |  2 +-
 tests/test_search.py        |  2 +-
 tests/test_tv.py            |  2 +-
 tmdbsimple/__init__.py      | 12 +++------
 tmdbsimple/account.py       |  2 +-
 tmdbsimple/base.py          |  2 +-
 tmdbsimple/changes.py       |  2 +-
 tmdbsimple/configuration.py |  2 +-
 tmdbsimple/discover.py      | 61 +++++++++++++++++++++++++++++++--------------
 tmdbsimple/find.py          |  2 +-
 tmdbsimple/movies.py        |  2 +-
 tmdbsimple/people.py        |  2 +-
 tmdbsimple/search.py        |  4 +--
 tmdbsimple/tv.py            |  2 +-
 22 files changed, 76 insertions(+), 51 deletions(-)

diff --git a/setup.py b/setup.py
index 29ce9b6..0a7ceff 100644
--- a/setup.py
+++ b/setup.py
@@ -13,14 +13,14 @@ def read(fname):
 # https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
 setup(
     name = 'tmdbsimple',
-    version = '1.4.0',
+    version = '1.4.1',
     author = 'Celia Oakley',
     author_email = 'celia.oakley at alumni.stanford.edu',
     description = 'A Python wrapper for The Movie Database API v3',
     keywords = ['movie', 'the movie database', 'movie database', 'tmdb', 
                 'wrapper', 'database', 'themoviedb', 'moviedb', 'api'],
     url = 'https://github.com/celiao/tmdbsimple',
-    download_url = 'https://github.com/celiao/tmdbsimple/tarball/1.4.0',
+    download_url = 'https://github.com/celiao/tmdbsimple/tarball/1.4.1',
     packages = ['tmdbsimple'],
     long_description=read('README.rst'),
     install_requires = ['requests==2.5.3'],
diff --git a/tests/test_account.py b/tests/test_account.py
index 808afb8..758f23b 100644
--- a/tests/test_account.py
+++ b/tests/test_account.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Account class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_changes.py b/tests/test_changes.py
index cebbe08..c8b8c1d 100644
--- a/tests/test_changes.py
+++ b/tests/test_changes.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Changes class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_configuration.py b/tests/test_configuration.py
index 0ef35be..e87e76a 100644
--- a/tests/test_configuration.py
+++ b/tests/test_configuration.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Configuration class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_discover.py b/tests/test_discover.py
index 5752248..e678b26 100644
--- a/tests/test_discover.py
+++ b/tests/test_discover.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Discover class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
@@ -31,9 +31,17 @@ class DiscoverTestCase(unittest.TestCase):
         response = discover.movie(page=1, year=DISCOVER_YEAR)
         self.assertTrue(hasattr(discover, 'results'))
 
-    def test_discover_tv(self):
+    # Test dot usage
+    def test_discover_tv_dot(self):
         discover = tmdb.Discover()
         kwargs = {'page':2, 'vote_average.gte': DISCOVER_VOTE_AVERAGE_GTE}
         response = discover.tv(**kwargs)
         self.assertTrue(hasattr(discover, 'results'))
 
+    # Test underscore usage
+    def test_discover_tv_underscore(self):
+        discover = tmdb.Discover()
+        response = discover.tv(page=2, 
+			vote_average_gte=DISCOVER_VOTE_AVERAGE_GTE)
+        self.assertTrue(hasattr(discover, 'results'))
+
diff --git a/tests/test_find.py b/tests/test_find.py
index 3b4dfd3..e9036b1 100644
--- a/tests/test_find.py
+++ b/tests/test_find.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Find class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_genres.py b/tests/test_genres.py
index c6407ee..5a64f42 100644
--- a/tests/test_genres.py
+++ b/tests/test_genres.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Genres class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_movies.py b/tests/test_movies.py
index e6e3c70..4e8eee2 100644
--- a/tests/test_movies.py
+++ b/tests/test_movies.py
@@ -7,7 +7,7 @@ This test suite checks the methods of the Movies class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_people.py b/tests/test_people.py
index 17a6e67..383cbe4 100644
--- a/tests/test_people.py
+++ b/tests/test_people.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the People class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_search.py b/tests/test_search.py
index cdd9dfc..485db7a 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Search class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tests/test_tv.py b/tests/test_tv.py
index 0bff758..ad93626 100644
--- a/tests/test_tv.py
+++ b/tests/test_tv.py
@@ -8,7 +8,7 @@ This test suite checks the methods of the Test class of tmdbsimple.
 
 Created by Celia Oakley on 2013-11-05
 
-:copyright: (c) 2013-2014 by Celia Oakley.
+:copyright: (c) 2013-2017 by Celia Oakley.
 :license: GPLv3, see LICENSE for more details.
 """
 
diff --git a/tmdbsimple/__init__.py b/tmdbsimple/__init__.py
index b1b593d..8774691 100644
--- a/tmdbsimple/__init__.py
+++ b/tmdbsimple/__init__.py
@@ -17,9 +17,9 @@ https://www.themoviedb.org/documentation/api/status-codes
 """
 
 __title__ = 'tmdbsimple'
-__version__ = '1.4.0'
+__version__ = '1.4.1'
 __author__ = 'Celia Oakley'
-__copyright__ = 'Copyright (c) 2013-1016 Celia Oakley'
+__copyright__ = 'Copyright (c) 2013-1017 Celia Oakley'
 __license__ = 'GPLv3'
 
 import os
@@ -36,12 +36,6 @@ from .people import People, Credits, Jobs
 from .search import Search
 from .tv import TV, TV_Seasons, TV_Episodes, Networks
 
-def _get_env_key(key):
-    try:
-        return os.environ[key]
-    except KeyError:
-        return None
 
-API_KEY = _get_env_key('TMDB_API_KEY')
+API_KEY = os.environ.get('TMDB_API_KEY', None)
 API_VERSION = '3'
-
diff --git a/tmdbsimple/account.py b/tmdbsimple/account.py
index 99a7ce8..e99d549 100644
--- a/tmdbsimple/account.py
+++ b/tmdbsimple/account.py
@@ -8,7 +8,7 @@ of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
diff --git a/tmdbsimple/base.py b/tmdbsimple/base.py
index a6da7ea..d6a41e6 100644
--- a/tmdbsimple/base.py
+++ b/tmdbsimple/base.py
@@ -7,7 +7,7 @@ This module implements the base class of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
diff --git a/tmdbsimple/changes.py b/tmdbsimple/changes.py
index 6930c1c..b084e1c 100644
--- a/tmdbsimple/changes.py
+++ b/tmdbsimple/changes.py
@@ -7,7 +7,7 @@ This module implements the Changes functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
diff --git a/tmdbsimple/configuration.py b/tmdbsimple/configuration.py
index e33b843..5afa1e3 100644
--- a/tmdbsimple/configuration.py
+++ b/tmdbsimple/configuration.py
@@ -9,7 +9,7 @@ functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
diff --git a/tmdbsimple/discover.py b/tmdbsimple/discover.py
index 98c3ed7..28ac8dd 100644
--- a/tmdbsimple/discover.py
+++ b/tmdbsimple/discover.py
@@ -7,7 +7,7 @@ This module implements the Discover functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
@@ -43,29 +43,32 @@ class Discover(TMDB):
             primary_release_year: (optional) Filter the results so that 
                                   only the primary release date year has 
                                   this value.  Expected value is a year.
-            vote_count.gte: (optional) Only include movies that are equal to,
-                            or have a vote count higher than this value. 
-                            Expected value is an integer.
-            vote_average.gte: (optional) Only include movies that are equal 
-                              to, or have a higher average rating than this 
-                              value.  Expected value is a float.
+            vote_count.gte or vote_count_gte: (optional) Only include movies 
+                            that are equal to, or have a vote count higher 
+                            than this value.  Expected value is an integer.
+            vote_average.gte or vote_average_gte: (optional) Only include 
+                              movies that are equal to, or have a higher 
+                              average rating than this value.  Expected value 
+                              is a float.
             with_genres: (optional) Only include movies with the specified 
                          genres.  Expected value is an integer (the id of 
                          a genre).  Multiple values can be specified. 
                          Comma separated indicates an 'AND' query, while 
                          a pipe (|) separated value indicates an 'OR'.
-            release_date.gte: (optional) The minimum release to include.
-                              Expected format is 'YYYY-MM-DD'.
-            release_date.lte: (optional) The maximum release to include. 
-                              Expected format is 'YYYY-MM-DD'.
+            release_date.gte or release_date_gte: (optional) The minimum 
+                              release to include.  Expected format is 
+                              'YYYY-MM-DD'.
+            releaste_date.lte or release_date_lte: (optional) The maximum 
+                              release to include.  Expected format is 
+                              'YYYY-MM-DD'.
             certification_country: (optional) Only include movies with
                                    certifications for a specific country. When
                                    this value is specified, 'certification.lte'
                                    is required. An ISO 3166-1 is expected.
-            certification.lte: (optional) Only include movies with this
-                               certification and lower. Expected value is a 
-                               valid certification for the specified 
-                               'certification_country'.
+            certification.lte or certification_lte: (optional) Only include 
+                               movies with this certification and lower. 
+                               Expected value is a valid certification for 
+                               the specified 'certification_country'.
             with_companies: (optional) Filter movies to include a specific 
                             company.  Expected value is an integer (the id 
                             of a company).  They can be comma separated 
@@ -74,6 +77,14 @@ class Discover(TMDB):
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
+        # Periods are not allowed in keyword arguments but several API 
+        # arguments contain periods. See both usages in tests/test_discover.py.
+        for param in kwargs:
+            if '_lte' in param:
+                kwargs[param.replace('_lte', '.lte')] = kwargs.pop(param)
+            if '_gte' in param:
+                kwargs[param.replace('_gte', '.gte')] = kwargs.pop(param)
+        
         path = self._get_path('movie')
 
         response = self._GET(path, kwargs)
@@ -94,10 +105,12 @@ class Discover(TMDB):
             first_air_year: (optional) Filter the results release dates to 
                             matches that include this value. Expected value 
                             is a year.
-            vote_count.gte: (optional) Only include TV shows that are equal to,
+            vote_count.gte or vote_count_gte: (optional) Only include TV shows 
+                            that are equal to,
                             or have vote count higher than this value. Expected
                             value is an integer.
-            vote_average.gte: (optional) Only include TV shows that are equal 
+            vote_average.gte or vote_average_gte: (optional) Only include TV 
+                              shows that are equal 
                               to, or have a higher average rating than this 
                               value.  Expected value is a float.
             with_genres: (optional) Only include TV shows with the specified 
@@ -109,14 +122,24 @@ class Discover(TMDB):
                            network. Expected value is an integer (the id of a
                            network).  They can be comma separated to indicate an
                            'AND' query.
-            first_air_date.gte: (optional) The minimum release to include. 
+            first_air_date.gte or first_air_date_gte: (optional) The minimum 
+                                release to include. 
                                 Expected format is 'YYYY-MM-DD'.
-            first_air_date.lte: (optional) The maximum release to include. 
+            first_air_date.lte or first_air_date_lte: (optional) The maximum 
+                                release to include. 
                                 Expected format is 'YYYY-MM-DD'.
           
         Returns:
             A dict respresentation of the JSON returned from the API.
         """
+        # Periods are not allowed in keyword arguments but several API 
+        # arguments contain periods. See both usages in tests/test_discover.py.
+        for param in kwargs:
+            if '_lte' in param:
+                kwargs[param.replace('_lte', '.lte')] = kwargs.pop(param)
+            if '_gte' in param:
+                kwargs[param.replace('_gte', '.gte')] = kwargs.pop(param)
+        
         path = self._get_path('tv')
 
         response = self._GET(path, kwargs)
diff --git a/tmdbsimple/find.py b/tmdbsimple/find.py
index 3935c0b..015ae2c 100644
--- a/tmdbsimple/find.py
+++ b/tmdbsimple/find.py
@@ -7,7 +7,7 @@ This module implements the Find functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
diff --git a/tmdbsimple/movies.py b/tmdbsimple/movies.py
index e8c8afc..438b7f7 100644
--- a/tmdbsimple/movies.py
+++ b/tmdbsimple/movies.py
@@ -8,7 +8,7 @@ Reviews functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
diff --git a/tmdbsimple/people.py b/tmdbsimple/people.py
index ebe9870..6d67863 100644
--- a/tmdbsimple/people.py
+++ b/tmdbsimple/people.py
@@ -8,7 +8,7 @@ of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
diff --git a/tmdbsimple/search.py b/tmdbsimple/search.py
index 66aab9e..c9d6310 100644
--- a/tmdbsimple/search.py
+++ b/tmdbsimple/search.py
@@ -7,7 +7,7 @@ This module implements the Search functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 
@@ -201,4 +201,4 @@ class Search(TMDB):
 
         response = self._GET(path, kwargs)
         self._set_attrs_to_values(response)
-        return response
\ No newline at end of file
+        return response
diff --git a/tmdbsimple/tv.py b/tmdbsimple/tv.py
index 5b9acdb..a2e4f02 100644
--- a/tmdbsimple/tv.py
+++ b/tmdbsimple/tv.py
@@ -8,7 +8,7 @@ functionality of tmdbsimple.
 
 Created by Celia Oakley on 2013-10-31.
 
-:copyright: (c) 2013-2014 by Celia Oakley
+:copyright: (c) 2013-2017 by Celia Oakley
 :license: GPLv3, see LICENSE for more details
 """
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-tmdbsimple.git



More information about the Python-modules-commits mailing list