-
Notifications
You must be signed in to change notification settings - Fork 0
/
media.py
32 lines (28 loc) · 1.06 KB
/
media.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import webbrowser
# SAH Added starring and rating to default movie class
class Movie():
""" Class Movie
This adds the init module to create an object of type, 'Movie'
which contains it's title. storyline, poster image, trailer,
star and an arbitrary rating.
"""
def __init__(self, movie_title, movie_storyline, poster_url,
trailer_youtube, starring, rating):
""" docstring for the init constructor
this allows us to store all the standard variables for the default
movie class
"""
self.title = movie_title
self.storyline = movie_storyline
self.poster_image_url = poster_url
self.trailer_youtube_url = trailer_youtube
self.starring = starring
self.rating = rating
def show_trailer(self):
"""show_trailer() docstring
this returns a webbrowser call to open the provided url
"""
webbrowser.open(self.trailer_url)
# no longer required - was there to test
# def to_string(self):
# return self.title + ": " + self.storyline