diff --git a/README.md b/README.md index 36ae53b62..f23c407b5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ # ud036_StarterCode -Source code for a Movie Trailer website. +Author: Joe Jordan +email: joewjordan -at- yahoo.com +Course: Full Stack web Development - Programming foundations with Python +Project: Final Project + +Requirments- +Device runing Python 2.7 + + +Installing - +download zip from repo: https://github.com/jpyces76/ud036_StarterCode +unpack into desired folder. + +Running - +from command line: Python entertainment.py + +from idle: open entertainment.py then -> Run -> Run module (F5) + diff --git a/entertainment.py b/entertainment.py new file mode 100644 index 000000000..8374fe15f --- /dev/null +++ b/entertainment.py @@ -0,0 +1,45 @@ +import media +import fresh_tomatoes +""" This python script creates 6 movie instances into an array of movies + and supplies the list to fresh_tomatoes, which presents the movies in an + html page, that can be interacted with. + + cmd line: Python entertainment.py""" + + +# create several instances of class movie +beetlejuice = media.Movie("Beetlejuice", + "Beetlejuice is the ghostus with the mostus", + "https://images-na.ssl-images-amazon.com/images/M/MV5BZDdmNjBlYTctNWU0MC00ODQxLWEzNDQtZGY1NmRhYjNmNDczXkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SY1000_SX670_AL_.jpg", + "https://www.youtube.com/watch?v=2hovKm9oFiM") + +potter = media.Movie("Harry Potter - Sorcerer's Stone", + "Magic boy finally gets cake", + "https://images-na.ssl-images-amazon.com/images/M/MV5BNjQ3NWNlNmQtMTE5ZS00MDdmLTlkZjUtZTBlM2UxMGFiMTU3XkEyXkFqcGdeQXVyNjUwNzk3NDc@._V1_.jpg", + "https://www.youtube.com/watch?v=K1KPcXRMMo4") + +school = media.Movie("School of Rock", + "Rock music is fun to learn from", + "https://upload.wikimedia.org/wikipedia/en/1/11/School_of_Rock_Poster.jpg", + "https://www.youtube.com/watch?v=3PsUJFEBC74") + +spawn = media.Movie("Spawn", + "A funny clown helps burn victims, but is misunderstood", + "https://images-na.ssl-images-amazon.com/images/M/MV5BN2ZkMWFlODEtNzIyOC00NmU2LTg5MDQtYWQxY2UyYmQxZGJlL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SY1000_CR0,0,678,1000_AL_.jpg", + "https://www.youtube.com/watch?v=5KMYx8lG59A") + +labyrinth = media.Movie("Labyrinth", + "A girl trying to save her brother from the goblin king", + "https://images-na.ssl-images-amazon.com/images/M/MV5BMjM2MDE4OTQwOV5BMl5BanBnXkFtZTgwNjgxMTg2NzE@._V1_SY1000_CR0,0,648,1000_AL_.jpg", + "https://www.youtube.com/watch?v=_8ZmiqLiZbk") + +btlc = media.Movie("Big trouble in little China", + "Rescue girl from evil chinese mob boss", + "http://www.theofficialjohncarpenter.com/wp-content/uploads/2016/01/john-carpenter-big-trouble-in-little-china-poster.jpg", + "https://www.youtube.com/watch?v=592EiTD2Hgo") + +# create the list of movies for fresh_tomatoes +movies = [beetlejuice, school, spawn, labyrinth, btlc, potter] + +# call launch tomatoes with list of movies created above. +fresh_tomatoes.open_movies_page(movies) diff --git a/fresh_tomatoes.html b/fresh_tomatoes.html new file mode 100644 index 000000000..ab6f9ccc4 --- /dev/null +++ b/fresh_tomatoes.html @@ -0,0 +1,145 @@ + + + + + + Jordan's movie list! + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +

Beetlejuice

+

Beetlejuice is the ghostus with the mostus

+
+ +
+ +

School of Rock

+

Rock music is fun to learn from

+
+ +
+ +

Spawn

+

A funny clown helps burn victims, but is misunderstood

+
+ +
+ +

Labyrinth

+

A girl trying to save her brother from the goblin king

+
+ +
+ +

Big trouble in little China

+

Rescue girl from evil chinese mob boss

+
+ +
+ +

Harry Potter - Sorcerer's Stone

+

Magic boy finally gets cake

+
+ +
+ + diff --git a/fresh_tomatoes.py b/fresh_tomatoes.py index 5cd75599c..f152b49ec 100644 --- a/fresh_tomatoes.py +++ b/fresh_tomatoes.py @@ -9,7 +9,7 @@ - Fresh Tomatoes! + Jordan's movie list! @@ -107,7 +107,7 @@ @@ -125,6 +125,7 @@

{movie_title}

+

{movie_desc}

''' @@ -144,6 +145,7 @@ def create_movie_tiles_content(movies): # Append the tile for the movie with its content filled in content += movie_tile_content.format( movie_title=movie.title, + movie_desc = movie.storyline, poster_image_url=movie.poster_image_url, trailer_youtube_id=trailer_youtube_id ) diff --git a/fresh_tomatoes.pyc b/fresh_tomatoes.pyc new file mode 100644 index 000000000..6204613ad Binary files /dev/null and b/fresh_tomatoes.pyc differ diff --git a/media.py b/media.py new file mode 100644 index 000000000..38573dccf --- /dev/null +++ b/media.py @@ -0,0 +1,33 @@ +import webbrowser + +class Movie() : + """ This a class of the type Movie + Params : + title - Title of the movie + storyline _ Brief synompsis of movie + poster image - Image the represents the movie + movie trailer - Movie trailer URL that can be played + + To create an intance of movie (example) + avatar = media.Movie("Avatar", + "Blue people with bows and arrows", + "https://upload.wikimedia.org/wikipedia/id/b/b0/Avatar-Teaser-Poster.jpg", + "https://www.youtube.com/watch?v=cRdxXPV9GNQ") + + """ + # list of current movie ratings from MPAA + VALID_RATINGS = ["G", "PG", "PG-13", "R", "NC-17"] + + # Movie contstructor params defined in docs + def __init__(self, title, story, poster, trailer) : + self.title = title + self.storyline = story + self.poster_image_url = poster + self.trailer_youtube_url = trailer + + # Movie method to play the movie trailer url + def show_trailer(self) : + webbrowser.open(self.trailer_youtube_url) + + + diff --git a/media.pyc b/media.pyc new file mode 100644 index 000000000..c584fef06 Binary files /dev/null and b/media.pyc differ diff --git a/name.py b/name.py new file mode 100644 index 000000000..fa0f4ac9d --- /dev/null +++ b/name.py @@ -0,0 +1,12 @@ +import media + + +# print medias documentation +print(media.Movie.__doc__) + +# print the module that contains Movie class +print(media.Movie.__module__) + +# print the name of the class +print(media.Movie.__name__) +