本文整理汇总了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