From fcd36257d5c53f2badc7e0601f4fe1f7b23b96f8 Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Tue, 18 Apr 2017 23:44:57 -0400 Subject: [PATCH 01/10] Add media.py --- media.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 media.py diff --git a/media.py b/media.py new file mode 100644 index 00000000..f068ce76 --- /dev/null +++ b/media.py @@ -0,0 +1,22 @@ +''' +Project_name: movie_website +Author: Yuhan Lin +Description: this is a Movie class. Allow user to create instances of Movie. +Last_update:4/18/2017 +''' + +import webbrowser + + +class Movie(): + """ this is a Movie class. Allow user to create instances of Movie. """ + def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube): + """ __init__(movie_title, movie_storyline, poster_image, trailer_youtube) """ + self.title = movie_title + self.storyline = movie_storyline + self.poster_image_url = poster_image + self.trailer_youtube_url = trailer_youtube + + def show_trailer(self): + """ open browser to load the URL """ + webbrowser.open(self.trailer_youtube_url) \ No newline at end of file From 87c65655dab6e239862e40b90a0f63372b862f04 Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Tue, 18 Apr 2017 23:56:19 -0400 Subject: [PATCH 02/10] Add entertainment_center.py --- entertainment_center.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 entertainment_center.py diff --git a/entertainment_center.py b/entertainment_center.py new file mode 100644 index 00000000..faeb00f8 --- /dev/null +++ b/entertainment_center.py @@ -0,0 +1,32 @@ +''' +Project_name: movie_website +Author: Yuhan Lin +Description: This is a main fuction. + Allow user to create instances of Movie. + And use open_movies_page(movies) to create movie website +Last_update:4/18/2017 +''' +import media +import fresh_tomatoes + +# create instances of Movie +toy_story = media.Movie("Toy Story", + "A story of a boy and his toys that come to life", + "https://upload.wikimedia.org/wikipedia/en/thumb/f/f9/ToyStory4poster.jpg/200px-ToyStory4poster.jpg", + "https://youtu.be/Bj4gS1JQzjk") + +avatar = media.Movie("Avatar", + "A marine on an alien planet", + "https://upload.wikimedia.org/wikipedia/en/thumb/b/b0/Avatar-Teaser-Poster.jpg/220px-Avatar-Teaser-Poster.jpg", + "https://youtu.be/H9S-K71JD_E") + +warcraft = media.Movie("Warcraft", + "Draenor, the homeworld of the orcs, is being torn apart by a mysterious force known as fel magic.", + "https://upload.wikimedia.org/wikipedia/en/thumb/5/56/Warcraft_Teaser_Poster.jpg/220px-Warcraft_Teaser_Poster.jpg", + "https://youtu.be/RhFMIRuHAL4") + +# create a list to store the movies +movies = [toy_story, avatar, warcraft] + +# use open_movies_page(movies) to create movie website +fresh_tomatoes.open_movies_page(movies) From fda197c221f546cb46e739b8dad6464688072b98 Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Tue, 18 Apr 2017 23:58:00 -0400 Subject: [PATCH 03/10] Built movie website --- fresh_tomatoes.html | 124 ++++++++++++++++++++++++++++++++++++++++++++ fresh_tomatoes.pyc | Bin 0 -> 5321 bytes media.pyc | Bin 0 -> 1227 bytes 3 files changed, 124 insertions(+) create mode 100644 fresh_tomatoes.html create mode 100644 fresh_tomatoes.pyc create mode 100644 media.pyc diff --git a/fresh_tomatoes.html b/fresh_tomatoes.html new file mode 100644 index 00000000..4f2ca120 --- /dev/null +++ b/fresh_tomatoes.html @@ -0,0 +1,124 @@ + + + + + + Fresh Tomatoes! + + + + + + + + + + + + + + + + +
+ +
+ +

Toy Story

+
+ +
+ +

Avatar

+
+ +
+ +

Warcraft

+
+ +
+ + diff --git a/fresh_tomatoes.pyc b/fresh_tomatoes.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52425d70659ecfd0e36c1b681608cb86ee330ee5 GIT binary patch literal 5321 zcmcIo-EP~+6&_iR6T8W#+ad^BpumJqBN+)LS+Skem9pD9cH{2G3GD1<*UeU-$dO2e zA{EZavNrKWkzV({FVJV{EA%Z26zJ{tJ3~?=We43Bt!$FRnKNh3&v(w8Vfi1|R`&n) z&#!Ej{1)*16qo!QHwXVE<}-FYYnRw@DeYfi#|zBCz0904J6>eYB0IjsoJ;JF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6epVtH`(UvW1ew;5wch zPY%7DOjhJsCM@rWfP@>10#mT{hW)I>q|(rLH*5X=$W=P5PBzS~=EEb;-)lTkPsUH2 z@#gNgr;i`JJbd#kieBtL_Bv19-QR3=-n>3gUwpRtvj5<-=dZ)wsPpA-!@UQGN6pXO z)5-4M&a?IXohQe>ZHAq;Y^+Y&&5b)QZbm&eIK?2usau8Dob_^hdcoA^GG&259UQWb zR{k~jk~B5STjcqtNV?d%0RNrX7Z>_H%g*T%d3OiaNf*g0exRO13dT;Dy!O0P;ZUJ! z@F?_AIiug}qu2=P*c2P12#xcLX@lh~l&~gDW5dX}XgVCdV$>v5-N*`@^q912%pJb? zQz``00Fd);$(xa!mNRnhCEv`6d0vsXI`MRlM*Z@cS1@>-%4Hnq@1$I_u z@5*fSX*z`0;!yMz5e#trUu5q~EI@;?vqko<#MC7=z!!i^dJ4V(Ea}D-=3Hj)K+MVy zu>PBC>?LTAs#hS=0R(__*Kn(T(rTZy*M9f=JFDN^l^-QNT~SZEJfc)Tz%6w?)K)*l z`@HegkBBnPt2qx<$ry^hbwolf;UR?;*{=HW1=Mf>lwpj{79+KY)&XjA%{X1%7aam7 zprV=e!U#K~o}|A*9MVEn;-QE2EUD;wNIHwgbhlO_LsAEPZ1)g546EXbZ}L7`d)u$} zj$S@~^*jpuI6k}@JB|BW9bLwWXa`6AS3UY7(!q&Ke-WvTrs}7dha)vM?M^1SOhv~x z8zzZ_Ei9F;;ksVBit9#cseHAxjK7Z-G?vH$bZIO_XuxlP6M#dIf#*vEAAAr}zzZW> zyk{lg3yvNv5-tFuo9Hc3#}Wov3APwqVS{B&vqDn`$EV literal 0 HcmV?d00001 diff --git a/media.pyc b/media.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70b766a18a3033150d4bc67f03cd61169c943001 GIT binary patch literal 1227 zcmbtUQEL-H5T3iFsX1E|^jQ|4t|Doxq7p=`E%hZ9xggpQST=XtX2acWxScZ;`c{8| z|Ic3`_^LCTG>N`xFWJe=?9A+Z-%hUaV>^2I{paTt7EgnI-_UY9Br<>j$pEqt@&E>; zG$7l6tO;KMt^iI4A@B9$7N>k85q+raM5icARp_oL>=&cuOplyF9Uas-wpCZ0)?-zQ zo++av?b6Cj(b%#paBQ5QuM+P$O{BSUt|Jce+|ESpbS2P=w9*Q-Fr`CPrrHU6HV^Ma zJ>^i=(~S1J&vy4;?mpSue-W8q^qk-ZHRsDNp$6o6%Y6$HnxGOql7uK=cmskOdZh_T zKW1Vahu^eKAyV#zS4iuSmWxST25<==NeR6|X2UCFHoZa(1;jOHxpyRll%_N&Wjv=D z4d(jsf^&zqy2wpQj;VF1D`^UKP8L?mB&;cZgZTEja_dsTjmeCy?X&|jsQ9`M3FBJH?4Jnnxw8q%np zSE?A++1}IVvX81Fn1?pg!$N09b*2}1i^8v2+9utx1HyK|pOhzn*YY0jlYsyee-)Du zt^x>FoIjvlVW+wjqsq<}^O#$e(MV|VG3gPNJSG^CpqXDpc|JHTVPaxFFkznl9~E=v z#&#wbJaOBOK|naafjMmc3rgv`k+QH^owK<~VNzx`l``Q*6Xs>ri`V{<=7cH$U$*1- mKr3hk?ag^brX%4AN_gAH-RvlTqp#**Ui-HWliCWm8ovP&$1Yj` literal 0 HcmV?d00001 From a65b3cefa96bdda5b7f2e2b98ae223a78f10e52a Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Wed, 19 Apr 2017 00:28:44 -0400 Subject: [PATCH 04/10] Modify README.md --- README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36ae53b6..328f1a07 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,26 @@ -# ud036_StarterCode -Source code for a Movie Trailer website. +# Movie Trailer website + +This is a project to let user to create a Movie Trailer website. + +## Guidelines + +Edit **entertainment_center.py**: +* Create your Movie object like the following example: + +``` +toy_story = media.Movie("Toy Story", // title + "A story of a boy and his toys that come to life", // story line + "https://upload.wikimedia.com/200px-ToyStory4poster.jpg", // poster image URL + "https://youtu.be/Bj4gS1JQzjk" //trailer URL ) // trailer URL +``` +* Store those Movie object in a list like the following example: +``` +movies = [toy_story, avatar, warcraft] +``` +* Call open_movies_page() function to take in your list of movies and generate an HTML file including this content, and produce website to showcase your favorite movies. +``` +fresh_tomatoes.open_movies_page(movies) +``` +## License + +The content of this repository is licensed under a [MIT License](https://choosealicense.com/licenses/mit/) \ No newline at end of file From d2aca2f808fafa5ab0d53a27fa90f590b876dc5f Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Wed, 19 Apr 2017 00:33:59 -0400 Subject: [PATCH 05/10] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 328f1a07..231aa842 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ Edit **entertainment_center.py**: ``` toy_story = media.Movie("Toy Story", // title - "A story of a boy and his toys that come to life", // story line - "https://upload.wikimedia.com/200px-ToyStory4poster.jpg", // poster image URL - "https://youtu.be/Bj4gS1JQzjk" //trailer URL ) // trailer URL + "A story of a boy and his toys that come to life", // story line + "https://upload.wikimedia.com/200px-ToyStory4poster.jpg", // poster image URL + "https://youtu.be/Bj4gS1JQzjk" //trailer URL ) // trailer URL ``` * Store those Movie object in a list like the following example: ``` @@ -23,4 +23,4 @@ fresh_tomatoes.open_movies_page(movies) ``` ## License -The content of this repository is licensed under a [MIT License](https://choosealicense.com/licenses/mit/) \ No newline at end of file +The content of this repository is licensed under a [MIT License](https://choosealicense.com/licenses/mit/) From a0ba687856b37796d2da6b62a6034494db278b5c Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Wed, 19 Apr 2017 19:46:04 -0400 Subject: [PATCH 06/10] Reformat the code for PEP8 --- entertainment_center.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/entertainment_center.py b/entertainment_center.py index faeb00f8..a924cd90 100644 --- a/entertainment_center.py +++ b/entertainment_center.py @@ -12,17 +12,22 @@ # create instances of Movie toy_story = media.Movie("Toy Story", "A story of a boy and his toys that come to life", - "https://upload.wikimedia.org/wikipedia/en/thumb/f/f9/ToyStory4poster.jpg/200px-ToyStory4poster.jpg", + "https://upload.wikimedia.org/wikipedia/en/thumb/f/f9/" + "ToyStory4poster.jpg/200px-ToyStory4poster.jpg", "https://youtu.be/Bj4gS1JQzjk") avatar = media.Movie("Avatar", "A marine on an alien planet", - "https://upload.wikimedia.org/wikipedia/en/thumb/b/b0/Avatar-Teaser-Poster.jpg/220px-Avatar-Teaser-Poster.jpg", + "https://upload.wikimedia.org/wikipedia/en/thumb/b/b0/" + "Avatar-Teaser-Poster.jpg/220px-Avatar-Teaser-Poster.jpg", "https://youtu.be/H9S-K71JD_E") warcraft = media.Movie("Warcraft", - "Draenor, the homeworld of the orcs, is being torn apart by a mysterious force known as fel magic.", - "https://upload.wikimedia.org/wikipedia/en/thumb/5/56/Warcraft_Teaser_Poster.jpg/220px-Warcraft_Teaser_Poster.jpg", + "Draenor, the homeworld of the orcs, is being torn" + "apart by a mysterious force known as fel magic.", + "https://upload.wikimedia.org/wikipedia/en/thumb/5/" + "56/Warcraft_Teaser_Poster.jpg/" + "220px-Warcraft_Teaser_Poster.jpg", "https://youtu.be/RhFMIRuHAL4") # create a list to store the movies From 714089a46c850d8626de1bd6231273fac324db66 Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Wed, 19 Apr 2017 20:06:16 -0400 Subject: [PATCH 07/10] reformat the code with PEP8 --- media.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media.py b/media.py index f068ce76..5b50443b 100644 --- a/media.py +++ b/media.py @@ -11,7 +11,9 @@ class Movie(): """ this is a Movie class. Allow user to create instances of Movie. """ def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube): - """ __init__(movie_title, movie_storyline, poster_image, trailer_youtube) """ + """ + + """ self.title = movie_title self.storyline = movie_storyline self.poster_image_url = poster_image From 899dc806bcf29a55a3f4494ef6f6c8f5e075a7e6 Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Wed, 19 Apr 2017 20:07:40 -0400 Subject: [PATCH 08/10] Add more guildline info --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 231aa842..854b7bff 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ This is a project to let user to create a Movie Trailer website. ## Guidelines -Edit **entertainment_center.py**: +Install [Python](https://www.python.org/)(if you don't have one) + +Download or clone this repository + +Edit **entertainment_center.py** with the editor you like: * Create your Movie object like the following example: ``` @@ -21,6 +25,8 @@ movies = [toy_story, avatar, warcraft] ``` fresh_tomatoes.open_movies_page(movies) ``` +* Build entertainment_center.py with python + ## License The content of this repository is licensed under a [MIT License](https://choosealicense.com/licenses/mit/) From 14aace828d605e330c958922ed329d1e066ca078 Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Wed, 19 Apr 2017 20:13:53 -0400 Subject: [PATCH 09/10] add some periods --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 854b7bff..2ddc2f8b 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This is a project to let user to create a Movie Trailer website. ## Guidelines -Install [Python](https://www.python.org/)(if you don't have one) +Install [Python](https://www.python.org/)(if you don't have one). -Download or clone this repository +Download or clone this repository. Edit **entertainment_center.py** with the editor you like: * Create your Movie object like the following example: @@ -25,7 +25,7 @@ movies = [toy_story, avatar, warcraft] ``` fresh_tomatoes.open_movies_page(movies) ``` -* Build entertainment_center.py with python +* Build entertainment_center.py with python. ## License From 1db8b1bfd2773bb0931de111215eef30febffc66 Mon Sep 17 00:00:00 2001 From: Yuhan Lin Date: Wed, 19 Apr 2017 22:48:58 -0400 Subject: [PATCH 10/10] add _doc_ info --- media.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/media.py b/media.py index 5b50443b..7ee7a21b 100644 --- a/media.py +++ b/media.py @@ -12,7 +12,11 @@ class Movie(): """ this is a Movie class. Allow user to create instances of Movie. """ def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube): """ - + Args: + param1(str): movie_title. + param2(str): movie_storyline. + param3(str): poster_image URL. + param4(str): movie_storyline URL. """ self.title = movie_title self.storyline = movie_storyline