Skip to content

Commit

Permalink
Add debugging mode for tmdb3.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerrp committed Jul 7, 2013
1 parent 3664da7 commit 2256e30
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mythtv/programs/scripts/metadata/Movie/tmdb3.py
Expand Up @@ -11,7 +11,7 @@
#-----------------------
__title__ = "TheMovieDB.org V3"
__author__ = "Raymond Wagner"
__version__ = "0.3.4"
__version__ = "0.3.5"
# 0.1.0 Initial version
# 0.2.0 Add language support, move cache to home directory
# 0.3.0 Enable version detection to allow use in MythTV
Expand All @@ -20,6 +20,7 @@
# parental ratings
# 0.3.3 Use translated title if available
# 0.3.4 Add support for finding by IMDB under -D (simulate previous version)
# 0.3.5 Add debugging mode

from optparse import OptionParser
import sys
Expand Down Expand Up @@ -227,6 +228,9 @@ def main():
dest="language", help="Specify language for filtering.")
parser.add_option('-a', "--area", metavar="COUNTRY", default=None,
dest="country", help="Specify country for custom data.")
parser.add_option('--debug', action="store_true", default=False,
dest="debug", help=("Disable caching and enable raw "
"data output."))

opts, args = parser.parse_args()

Expand All @@ -238,7 +242,13 @@ def main():

from MythTV.tmdb3 import set_key, set_cache, set_locale
set_key('c27cb71cff5bd76e1a7a009380562c62')
set_cache(engine='file', filename='~/.mythtv/pytmdb3.cache')

if opts.debug:
import MythTV.tmdb3
MythTV.tmdb3.request.DEBUG = True
set_cache(engine='null')
else:
set_cache(engine='file', filename='~/.mythtv/pytmdb3.cache')

if opts.language:
set_locale(language=opts.language, fallthrough=True)
Expand Down

0 comments on commit 2256e30

Please sign in to comment.