From 3c2188a75c562a76be42819893c3e6252f21fa61 Mon Sep 17 00:00:00 2001 From: Joe Jordan Date: Mon, 31 Jul 2017 14:22:50 -0600 Subject: [PATCH 1/2] Added files to project and modified necessary files, notes in readme --- README.md | 19 ++++++++++++++++++- fresh_tomatoes.py | 6 ++++-- 2 files changed, 22 insertions(+), 3 deletions(-) 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/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 ) From daed15a94654583b3ab003d294a30a15c00ca7de Mon Sep 17 00:00:00 2001 From: Joe Jordan Date: Mon, 31 Jul 2017 14:23:31 -0600 Subject: [PATCH 2/2] files added --- entertainment.py | 45 ++++++++++++++ fresh_tomatoes.html | 145 ++++++++++++++++++++++++++++++++++++++++++++ fresh_tomatoes.pyc | Bin 0 -> 5416 bytes media.py | 33 ++++++++++ media.pyc | Bin 0 -> 1560 bytes name.py | 12 ++++ 6 files changed, 235 insertions(+) create mode 100644 entertainment.py create mode 100644 fresh_tomatoes.html create mode 100644 fresh_tomatoes.pyc create mode 100644 media.py create mode 100644 media.pyc create mode 100644 name.py 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.pyc b/fresh_tomatoes.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6204613ad9ecba237f6a2ab4ef12d2428ed74e0c GIT binary patch literal 5416 zcmcIo-E!N;6<&(6Y^iqKw3B-JGt)KYn$*}JDO!?Ug>=%&a_z*HJ(3gG>ZBYHSQ4N> z0LCswF}9{Nb$ipBUiP9dkeBIQ-=q)FerEv?03}b;X)7DxVs~-&obP<+>{*omab@N2 zfBxMoizR;x`27@@e1e;e|0U)zb~tO7*kLK{Utos|%*MUU>@quCWcDIEyuj=W><@Tl ziP=lKagl@^)Gk7x`%nDs$-k{Iw$i@-;MvZLSI>93qekBSl{Wow&-4eKitsDcAx!)J z3ddi2B$UZ5$Bd*cBA17W&38mm%eY=e%%U2 zja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iG6Xd-?QwTE|GV)ZyxuMyy73!b4bD136saZ zdm?NqR4Y6RJXFr;cLyjo0y;azU=*owb}tSN7F>giJ9DbxBR5!uFpjG_|3 zst=m-Qi+bA1#zA+vW+c{n$hqE#zvgT;xd*_B!-1(0wi&Wr0F=@aypeaNoP0d?7H@8 zIz1Q+$U#Yv$GaBJ8FZ3Ock2Y~ESTP)j>C#wq}PGyjw27!bm`Wqv|3HTuFo5t%AJi? z`mWQuKSKdW;#1h$ihbA)(-B)p3j-mcq2aNB1-pRjJGgdm$-m%+1N&)-o&1TtW$eLM zzh|clOffdZ$$x>pU0}ln_HKclmf71f3qMVV@K_v*eoYgG_&Tu2-j$e-24km->}`pu z3v7rF1Q+xx_&~6v8<&`UQ8$*EeTlurTWs+z6nTAxy~IlgwPonG2Th>n72Il{v^&S0 zwcq^q=IU3sEh&OszAtkI8{Hw`#73o^Y3Q%$kd=eVpRSF zH@2`;x`OL!=`ya5N=xO-rDgr^g9Xh!Qj0Fly$B7s7xV+sh+<$$iRgy!OA7pA#G`kt z1U`Zf!$sl|NOujrCF)qhAS(ft;UzX))^k?q6;Ks47(z1GS7z5hJW%dksZ_FA@@Z;M zk{9Rfq=W$l7@HJWgd8IY`987@Hauv?m@g(SF{5@FH|=jKjMayD8euQ!QYn<8vrm-V z*Bm3KO(Gnh6wx=ENjX?kK_6~3=a3KxsL)i7_B+mZx=o!v4v(7H6VdBM!9-FG+z6wXk{wu)_+Z9TDy(xJjQ92oUQe{48mSMSgI_o JER~mk@Gk=Px#R!< literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..c584fef06947944724945ae0f305113c5e7414cd GIT binary patch literal 1560 zcmb_bUvJYe5O>?PW7P&o{CPvN%1e=GvoQf;V!&2JHEF9#+D*_G%T2sCTM|dMv#io2 z9>yD=j?cmefIFv4nUD|y()xU7`+oPk^SSbEt^W1Pr;i?)e-)VDz|apt`0y{0kdP55 zW#TUpzd}9}a!JU?Q3>}3%_^J=zQflus2<3(Kon@WvI|2$1t9poO&VGn#yBprh=MTBB+g7r}MAR6^}ICDi(0v z1SS-;MTd5tJ4eX%+A(dUnuS3uD5JY75XV%{Vi_eGB7>84pw~PSsf|!Hi1-BY_w0Q=IcC3B{x0JU`=xE4oc1;Rn2ZfT=edJ9f44xHxuI#QEIV4O56MBw*1jFjG2~ z8C*i_Q?3-Kzj2)!ljtqSNs~}=znulAK^|MGiGx;xOq{@X#?E-%$*Hu4f@`5#eOuP{ zNiz9^2w9f3XEHVEShPJEIT<(J^!3@c=lbU#`bRIiz4whpC9dUaO3+?i1MNlnU5)M9 z@3uBJ?Xqj_UZ=J3+`}Clc(4OQH$hyK$ORz`l(JR8tXKuiC96PB6L=#Sq}N;mY2S!# zMzex2SN&#ggO&FZv%SPp6`DKfkv9mNCy49z%^8H#B0P2rT#IIE1(I1__# z^DYg;f#Ke1N2W>(r#~}O89S-JzWI#7hJvo{NMAVloh37a50SAT4h&=WLD#rIN-Or~ zVTw440^J3}5OQK`bW$dlB~tpS7!};EgUG~qjGZKu%}6F9c9FL&nu{?kYb*Yi`YNF4 zsm$2Cm=DlKrli!wa?Nv#c_bLKtQd==pN4268OD6+fxZU%(a!$fTjuTz_j=udi_q>Z v5DS+7Le&K%g0->Lt=+7Z?^RZob8IB+A_IHq|HQMIzsz%eh4*L6vReKD*xhoT literal 0 HcmV?d00001 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__) +