本文整理匯總了Python中movie.Movie.create_movie_from_imdb_query方法的典型用法代碼示例。如果您正苦於以下問題:Python Movie.create_movie_from_imdb_query方法的具體用法?Python Movie.create_movie_from_imdb_query怎麽用?Python Movie.create_movie_from_imdb_query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類movie.Movie
的用法示例。
在下文中一共展示了Movie.create_movie_from_imdb_query方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: rename
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import create_movie_from_imdb_query [as 別名]
def rename(filename):
filename_without_extension = filename
extension = ""
if os.path.isdir(filename) == False:
filename_without_extension, extension = os.path.splitext(filename)
query = ImdbQuery.create_query_from_filename(filename_without_extension)
movie = Movie.create_movie_from_imdb_query(query)
if movie.title == "None":
# sys.stdout.write("Query Was: " + query + "\n")
return "None"
return unicode(movie).encode("utf-8") + extension
示例2: test_create_movie_from_query_dots_and_hyphens
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import create_movie_from_imdb_query [as 別名]
def test_create_movie_from_query_dots_and_hyphens(self):
LOTR_2 = Movie.create_movie_from_imdb_query('lord.of.rings-two.towers')
self.assertEqual(LOTR_2,
Movie("The Lord of the Rings: The Two Towers", 2002))
示例3: test_create_movie_from_query_no_spaces
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import create_movie_from_imdb_query [as 別名]
def test_create_movie_from_query_no_spaces(self):
the_dark_knight = Movie.create_movie_from_imdb_query('TheDarkKnight')
self.assertEqual(the_dark_knight, Movie("The Dark Knight", 2008))
示例4: test_create_movie_from_query_partial_title
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import create_movie_from_imdb_query [as 別名]
def test_create_movie_from_query_partial_title(self):
the_matrix = Movie.create_movie_from_imdb_query('matrix')
self.assertEqual(the_matrix, Movie("The Matrix", 1999))
示例5: test_create_movie_from_query_exact_title
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import create_movie_from_imdb_query [as 別名]
def test_create_movie_from_query_exact_title(self):
the_prestige = Movie.create_movie_from_imdb_query('the prestige')
self.assertEqual(the_prestige, Movie("The Prestige", 2006))
示例6: rename
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import create_movie_from_imdb_query [as 別名]
def rename(filename):
filename_without_extension, extension = os.path.splitext(filename)
query = ImdbQuery.create_query_from_filename(filename_without_extension)
movie = Movie.create_movie_from_imdb_query(query)
return str(movie) + extension