Ejemplo n.º 1
0
    def OnButtonAdd(self, evt):
        """Add button pressed. Select a movie to add to the batch."""
        try:
            movie = movies.Movie(self.dir,
                                 interactive=True,
                                 parentframe=self.frame,
                                 open_now=True,
                                 open_multiple=True,
                                 default_extension=self.default_extension)
        except ImportError:
            return

        movie_objs = [movie]
        if hasattr(movie, 'fullpaths_mult'):
            # "open movie" selected multiple filenames,
            # first file is the returned "movie" variable,
            # init movie objects for the other files
            for fullpath in movie.fullpaths_mult[1:]:
                try:
                    movie_objs.append(
                        movies.Movie(fullpath,
                                     interactive=False,
                                     open_now=True))
                except ImportError:
                    return

        for movie in movie_objs:
            self.dir = movie.dirname
            base, self.default_extension = os.path.splitext(movie.filename)

            # check for duplicates
            add_flag = True
            for datum in self.file_list:
                if datum['filename'] == movie.fullpath:
                    wx.MessageBox(
                        movie.fullpath +
                        " has already been added;\nnot duplicating",
                        "Duplicate", wx.ICON_WARNING | wx.OK)
                    add_flag = False
                    break

            if add_flag:
                movie_data = {
                    "filename": movie.fullpath,
                    "nframes": movie.get_n_frames(),
                    "startframe": 0,
                    "endframe": inf
                }
                self.file_list.append(movie_data)
                self.list_box.Set(self.file_list)
Ejemplo n.º 2
0
def read_movies(filename="data/movies2019.csv"):
    df = pd.read_csv(filename)
    movie_list = []
    for index, row in df.iterrows():
        m = movies.Movie(row.Name, row.rating, row.time_min)
        movie_list.append(m)
    return movie_list
Ejemplo n.º 3
0
def reply():
    body = request.values.get('Body', None)
    number = request.values.get('From', None)
    print("Sender Number: " + number)
    command = base_command.Command(body).command
    return_text = ''
    print("Command: " + command)
    if command == "help":
        response = helps.Help(body)
        return_text = response.exec()
    elif command == "stock":
        response = stock.Stock(body)
        return_text = response.exec()
    elif command == "mail":
        response = mail.Mail(body)
        return_text = response.exec()
    elif command == "weather":
        response = weather.Weather(body)
        return_text = response.exec()
    elif command == "translate":
        response = translate.Translate(body)
        return_text = response.exec()
    elif command == "movie":
        response = movies.Movie(body)
        return_text = response.exec()

    if return_text == '':
        send_message("please type !help for response", number)
    else:
        print("RETURN MESSAGE:", return_text)
        send_message(return_text, number)
    return str(return_text)
Ejemplo n.º 4
0
def setup_tracking(moviefile, pre4):
    """Create all tracking objects."""
    # open movie
    testmovie = test_movie_for_known_movie(moviefile)
    movie = movies.Movie(testmovie, interactive=False)

    # create background model calculator
    if pre4:
        bg_model = bg_pre4.BackgroundCalculator(movie)
    else:
        bg_model = bg.BackgroundCalculator(movie)
    bg_img_shape = (movie.get_height(), movie.get_width())
    bg_model.set_buffer_maxnframes()

    # open annotation file
    ann_file = ann.AnnotationFile(annname(moviefile, pre4))
    ann_file.InitializeData()

    # calculate bg
    bg_model.OnCalculate()

    # estimate fly shapes
    havevalue = (not params.maxshape.area == 9999.)
    haveshape = (not num.isinf(params.maxshape.area))
    if (not haveshape) or (not havevalue):
        if pre4:
            params.movie = movie
            ell_pre4.est_shape(bg_model)
            params.movie = None
        else:
            ell.est_shape(bg_model)

    hindsight = hs.Hindsight(ann_file, bg_model)

    return movie, bg_model, ann_file, hindsight
Ejemplo n.º 5
0
 def test_colums_compare(self):
     o = movies.Movie()
     self.assertEqual(o.compare('Se7en','Memento', 'imdbRating'), "Comparison result = > The film Se7en: 8.6")
     self.assertEqual(o.compare('Green Book','Fargo', 'Year'), 'Comparison result = > The film Green Book: 2018')
     self.assertEqual(o.compare('Inception','Blade Runner', 'Runtime'), 'Comparison result = > The film Inception: 148 ' )
     self.assertEqual(o.compare('Jurassic Park','Room', 'Awards'), 'Comparison result => The film Room: Won 1 Oscar. Another 103 wins & 136 nominations.')
     self.assertEqual(o.compare('Coco','The Hunt', 'BoxOffice'), 'Comparison result = > The film Coco: 208,487,719')
Ejemplo n.º 6
0
def read_ims(mov, frms):
    '''
    Read the frames in frms (0-based) and return in a list
    '''
    cap = movies.Movie(mov)
    ims = [cap.get_frame_unbuffered(i)[0] for i in frms]
    cap.close()
    return ims
Ejemplo n.º 7
0
def main(argv):
    args = parse_args(argv)

    vtdir = args.gencompare
    jsf = os.path.join(vtdir, 'info.json')
    with open(jsf, 'r') as f:
        jsdata = json.load(f)

    mov = jsdata['mov']
    if not os.path.isabs(mov):
        vtparentdir = os.path.dirname(vtdir)
        mov = os.path.join(vtparentdir, mov)
        print("Relative moviename specified in info.json. Expanding to {}".
              format(mov))

    frms1b = jsdata['frms']  # json is written as 1-based from matlab
    frms0b = [x - 1 for x in frms1b]

    cap = movies.Movie(mov)
    if jsdata['nmaxsupplied']:
        nmax = jsdata['nmaxused']
        print("nmax={}")
    else:
        nmax = cap.get_n_frames()
        print("nmax not supplied, using nmax={}".format(nmax))
    cap.close()
    # nmax is 1-past-end of 0-based frames

    assert all([x < nmax for x in frms0b
                ]), "One or more frames out of range given nmax."

    ims_sq = read_seq(mov, nmax)
    ims_ra = read_ims(mov, frms0b)

    jsdataout = get_jsondata(mov, nmax, frms0b)
    vtdirout = get_testdir(mov, vtdir, jsdataout)
    assert not os.path.exists(vtdirout)
    os.mkdir(vtdirout)
    print("Made output dir {}".format(vtdirout))

    for ndx, im in enumerate(ims_sq):
        ndx1b = ndx + 1
        fname = 'sr_{:06d}.png'.format(ndx1b)
        fname = os.path.join(vtdirout, fname)
        cv2.imwrite(fname, im)
    print("Wrote SRs")

    for ndx, im in enumerate(ims_ra):
        ndx1b = ndx + 1
        fname = 'rar_{:06d}_{:06d}.png'.format(ndx1b, frms1b[ndx])
        fname = os.path.join(vtdirout, fname)
        cv2.imwrite(fname, im)
    print("Wrote RARs")

    fname = os.path.join(vtdirout, 'info.json')
    with open(fname, 'w') as f:
        json.dump(jsdataout, f)
    print("Wrote {}".format(fname))
def create_own_movie_object(movie_object, youtube_video_url):
    """
    Mirros IMDB movie object with our own Movie object
    :param movie_object: A movie object from IMDB
    :param youtube_video_url: Youtube URL for the movie
    :return: Our own Movie object
    """
    movie = movies.Movie(movie_object['title'], movie_object['plot outline'],
                         movie_object['cover url'], youtube_video_url,
                         movie_object['rating'])
    return movie
Ejemplo n.º 9
0
    def add_movie(self):
        # Récupérer le texte da,s le line edit
        # Créer une instance 'Movie'
        # Ajouter le film dans le fichier json
        # Ajouter le titre du film dans le list widget

        le_value = self.le_movie_title.text()
        if not le_value:
            return False

        movie = movies.Movie(title=le_value)

        result = movie.add_to_movies()
        if result:
            lw_item = QtWidgets.QListWidgetItem(movie.title)
            lw_item.setData(QtCore.Qt.UserRole, movie)
            self.li_films.addItem(lw_item)
        self.le_movie_title.setText("")
Ejemplo n.º 10
0
    def OnInit( self ):
        
        rsrc = xrc.XmlResource(RSRC_FILE)
        self.frame = rsrc.LoadFrame(None,"FRAME")
        self.frame.Show()
        self.img_panel = xrc.XRCCTRL(self.frame,"PANEL")
        box = wx.BoxSizer( wx.VERTICAL )
        self.img_panel.SetSizer( box )
        self.img_wind = wxvideo.DynamicImageCanvas( self.img_panel, -1 )
        self.img_wind.set_resize(True)
        box.Add( self.img_wind, 1, wx.EXPAND )
        self.img_panel.SetAutoLayout( True )
        self.img_panel.Layout()

        wx.EVT_LEFT_DOWN(self.img_wind,self.MouseClick)
        #self.img_wind.Bind(wx.EVT_LEFT_DOWN,self.MouseClick)

        self.filename = '/home/kristin/FLIES/data/walking_arena/movie20071009_155327.sbfmf'
        self.movie = movies.Movie(self.filename,True)
        imd,stamp = self.movie.get_frame( 1 )
        print 'imd = ' + str(imd)
        print 'minv = ' + str(nx.min(imd))
        im8 = imagesk.double2mono8(imd)
        print 'im8 = ' + str(im8)
        print 'minv = ' + str(nx.min(im8))
        print 'im8.shape = ' + str(im8.shape)

        #im8 = nx.zeros((1024,1024),dtype=nx.uint8)

        point = [[500,500]]
        line = [[250,250,750,750]]
        pointcolors = [(1,0,0)]
        linecolors = [(1,1,0)]

        self.img_wind.update_image_and_drawings('camera',im8,format='MONO8',
                                                linesegs=line,points=point,
                                                point_colors=pointcolors,
                                                lineseg_colors=linecolors)
    
        return True
Ejemplo n.º 11
0
import server_render
import movies

# Creating movies by creating the instances of the Class Movie
spiderman = movies.Movie(
    "Spider-Man: Homecoming (2017)",
    "http://www.cinema.com.my/images/movies/2017/7amazingspider300_450.jpg",
    "https://www.youtube.com/watch?v=U0D3AOldjMU",
    """Peter Parker balances his life as an ordinary high school student in Queens 
    with his superhero alter-ego Spider-Man, and finds himself on the trail of a 
    new menace prowling the skies of New York City.""", "Jon Watts",
    "Jonathan Goldstein (screenplay by), John Francis Daley (screenplay by)", [
        'Tom Holland', 'Michael Keaton', 'Robert Downey Jr.', 'Marisa Tomei',
        'Zendaya', 'Gwyneth Paltrow'
    ], movies.Movie.RATINGS[3])

lion = movies.Movie(
    "Lion (2016)",
    "https://cdn.traileraddict.com/content/the-weinstein-company/lion-2016-poster-3.jpg",
    "https://www.youtube.com/watch?v=-RNI9o06vqo",
    """A five-year-old Indian boy gets lost on the streets of Calcutta, thousands of
    kilometers from home. He survives many challenges before being adopted by a 
    couple in Australia. 25 years later, he sets out to find his lost family""",
    "Garth Davis ",
    """Saroo Brierley (adapted from the book \"A Long Way Home\" by), Luke Davies 
    (screenplay by)""", ['Dev Patel', 'Nicole Kidman', 'Rooney Mara'],
    movies.Movie.RATINGS[4])

thewalk = movies.Movie(
    "The Walk (2015)",
    "http://www.justknow.in/cinema_images/1813088342the-walk-3d.jpg",
Ejemplo n.º 12
0
import movies
import fresh_tomatoes

Toy_Story = movies.Movie(
    "Toy Story", "a toy that comes to live",
    "https://www.youtube.com/watch?v=KYz2wyBy3kc",
    "https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg")
School_of_Rock = movies.Movie(
    "School of Rock", "A fake teacher rocks with some school kids",
    "https://www.youtube.com/watch?v=AiJauwvuXbQ",
    "https://upload.wikimedia.org/wikipedia/en/1/11/School_of_Rock_Poster.jpg")
Imitation_Game = movies.Movie(
    "Imitation Game",
    "Alan Turing saving the world but getting f****d cause hes gay",
    "https://www.youtube.com/watch?v=nuPZUUED5uk",
    "https://upload.wikimedia.org/wikipedia/en/8/87/The_Imitation_Game_%282014%29.png"
)

movies = [Toy_Story, School_of_Rock, Imitation_Game]

fresh_tomatoes.open_movies_page(movies)
#!/usr/local/bin/python
import movies
import fresh_tomatoes

"""
Favorite movies object with 4 args each:
title (movie's title)
year (year movie was released)
poster_url (url to poster image)
"""

jurassic_park = movies.Movie("Jurassic park",
                            "15 April 1994",
                            "https://upload.wikimedia.org/wikipedia/"
                            "en/e/e7/Jurassic_Park_poster.jpg",
                            "https://www.youtube.com/watch?v=_IesovZQR4g")

time_bandits = movies.Movie("Time Bandits",
			    "10 July 1981",
			    "http://goo.gl/yndMxB",
			    "https://www.youtube.com/watch?v=JwnjENpIyq0")

fight_club = movies.Movie("Fight Club",
			  "21 Sep 1999",
			  "http://goo.gl/BR5nIh",
		          "https://www.youtube.com/watch?v=SUXWAEX2jlg")

interstellar = movies.Movie("Interstellar",
                            "7 Nov 2014",
                            "https://upload.wikimedia.org/wikipedia/"
                            "en/b/bc/Interstellar_film_poster.jpg",
Ejemplo n.º 14
0
import movies

star_wars = movies.Movie(
    "Star Wars - Episode I: The Phantom Menace",
    "The Trade Federation upsets order in the Galactic Republic by blockading the planet Naboo in preparation for a full-scale invasion. The Republic's leader, Supreme Chancellor Valorum, dispatches Jedi Master Qui-Gon Jinn and his apprentice, Obi-Wan Kenobi, to negotiate with Trade Federation Viceroy Nute Gunray. Darth Sidious, a Sith Lord and the Trade Federation's secret benefactor, orders the Viceroy to kill the Jedi and begin their invasion with an army of battle droids.",
    "https://m.media-amazon.com/images/M/MV5BYTRhNjcwNWQtMGJmMi00NmQyLWE2YzItODVmMTdjNWI0ZDA2XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_.jpg",
    "https://www.youtube.com/watch?v=bD7bpG-zDJQ")

black_panther = movies.Movie(
    "Black Panther",
    "After the events of Captain America: Civil War, Prince T'Challa returns home to the reclusive, technologically advanced African nation of Wakanda to serve as his country's new king. However, T'Challa soon finds that he is challenged for the throne from factions within his own country. When two foes conspire to destroy Wakanda, the hero known as Black Panther must team up with C.I.A. agent Everett K. Ross and members of the Dora Milaje, Wakandan special forces, to prevent Wakanda from being dragged into a world war.",
    "https://upload.wikimedia.org/wikipedia/en/0/0c/Black_Panther_film_poster.jpg",
    "https://www.youtube.com/watch?v=xjDjIWPwcPU")

logan = movies.Movie(
    "Logan",
    "In a dystopian 2029, no mutants have been born in 25 years. Logan's healing ability has weakened and he has physically aged. The adamantium coating on his skeleton has begun to leak into his body, poisoning him. Hiding in plain sight, Logan spends his days working as a limo driver in El Paso, Texas. In an abandoned smelting plant in northern Mexico, he and mutant tracker Caliban care for 90-year-old Charles Xavier, Logan's mentor and founder of the X-Men. Gabriela Lopez, a former nurse for biotechnology corporation Alkali-Transigen, tries to hire Logan to escort her and an 11-year-old girl, Laura, to Eden, a refuge in North Dakota.",
    "https://upload.wikimedia.org/wikipedia/en/3/37/Logan_2017_poster.jpg",
    "https://www.youtube.com/watch?v=Div0iP65aZo")

print(star_wars.title)
print(black_panther.title)
print(logan.title)
star_wars.show_trailer()
Ejemplo n.º 15
0
import movies
import fresh_tomatoes

step_brothers = movies.Movie(
    "Step Brothers", "Two grown children do a bunch of goofy stuff",
    "https://upload.wikimedia.org/wikipedia/en/d/d9/StepbrothersMP08.jpg",
    "https://www.youtube.com/watch?v=CewglxElBK0")

#print step_brothers.storyline

#step_brothers.showtrailer()

movies2 = []
for _ in range(0, 8):
    movies2.append(step_brothers)

#fresh_tomatoes.open_movies_page(movies)
print(movies.Movie.__module__)
import movies
import fresh_tomatoes

the_butler = movies.Movie(
    "The Butler", "Cecil Gaines gets the opportunity of a lifetime"
    " when he is hired as a butler at the White House.",
    "http://weinsteinco.com/sites/leedanielsthebutler/"
    "images/TheButler.jpg", "https://www.youtube.com/watch?v=FuojHqfe4Vk")

concussion = movies.Movie(
    "Concussion", "Dr. Bennet Omalu discovers neurological"
    " deterioration that is similar to"
    " Alzheimer's disease.", "http://taylorholmes.com/wp-content/uploads"
    "/2015/12/concussion-failed-movie.jpg",
    "https://www.youtube.com/watch?v=Io6hPdC41RM")

deadpool = movies.Movie(
    "Deadpool", "Wade Wilson's world comes crashing down when"
    " evil scientist Ajax tortures, disfigures and"
    " transforms him into Deadpool.",
    "http://www.space.ca/wp-content/uploads/2016/09"
    "/deadpool.jpg", "https://www.youtube.com/watch?v=ZIM1HydF9UA")

movies = [the_butler, concussion, deadpool]

fresh_tomatoes.open_movies_page(movies)
Ejemplo n.º 17
0
import movies
import freshtomatoes

#Initialize 6 movies with the variables defined in the Movie class.
sully = movies.Movie("Sully", "Captain Sully who saved 155 lives aboard the disabled Airbus A320 jet",
                    "https://upload.wikimedia.org/wikipedia/commons/e/ee/Sully_Movie_Logo.png",
                    "https://www.youtube.com/watch?v=ofDzbPXBxP4")

#print(sully.storyline) #Debug statement, test to print storyline

fateOfTheFurious = movies.Movie("The Fate of the Furious", "A mysterious woman seduces Dom to betray the globe-trotting team",
                      "https://upload.wikimedia.org/wikipedia/en/2/2d/The_Fate_of_The_Furious_Theatrical_Poster.jpg",
                      "https://www.youtube.com/watch?v=9GvX2uexGkA")

#print(fateOfTheFurious.storyline) #Debug statement, tested to print storyline of movie

#fateOfTheFurious.showTrailer() #Debug statement, tested to open browser and play trailer.

theEmojiMovie = movies.Movie("The Emoji Movie", "Gene, an emoji embarks on a journey to become a real emoji",
                     "https://upload.wikimedia.org/wikipedia/en/6/63/The_Emoji_Movie_film_poster.jpg",
                     "https://www.youtube.com/watch?v=o_nfdzMhmrA")

loganLucky = movies.Movie("Logan Lucky", "Two brothers plan a robbery during Memorial Day Weekend at NASCAR Race in North Carolina",
                          "https://upload.wikimedia.org/wikipedia/en/e/e6/Logan_Lucky.png",
                          "https://www.youtube.com/watch?v=wsOIuzxMplA")

babyDriver = movies.Movie("Baby Driver", "A young driver is coerced to perform a robbery that later fails.",
                          "https://upload.wikimedia.org/wikipedia/en/8/8e/Baby_Driver_poster.jpg",
                          "https://www.youtube.com/watch?v=RWC3uA7YWg8")

kingsmanTheGoldenCircle = movies.Movie("Kingsman: The Golden Circle","Two secret organizations fight to defeat a common enemy",
Ejemplo n.º 18
0
import movies
import fresh_tomatoes

TOYSTORY = movies.Movie(
    "Toy Story", "A story of a boy and his toys that come to life.",
    "http://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
    "https://www.youtube.com/watch?v=vwyZH85NQC4")

# print(TOYSTORY.storyline)

AVATAR = movies.Movie(
    "Avatar", "A marine on an alien planet.",
    "https://upload.wikimedia.org/wikipedia/en/b/b0/Avatar-Teaser-Poster.jpg",
    "https://www.youtube.com/watch?v=5PSNL1qE6VY")

# print(AVATAR.storyline)
# AVATAR.showTrailer()
SCHOOLOFROCK = movies.Movie(
    "School of Rock", "Using rock music to learn.",
    "https://upload.wikimedia.org/wikipedia/" +
    "en/1/11/School_of_Rock_Poster.jpg",
    "https://www.youtube.com/watch?v=XCwy6lW5Ixc")

RATATOUILLE = movies.Movie(
    "Ratatouille", "A rat is a chef in Paris",
    "https://upload.wikimedia.org/wikipedia/en/5/50/RatatouillePoster.jpg",
    "https://www.youtube.com/watch?v=c3sBBRxDAqk")

MIDNIGHTINPARIS = movies.Movie(
    "Midnight in Paris", "Going back in time to meet authors.",
    "https://upload.wikimedia.org/wikipedia/" +
Ejemplo n.º 19
0
import movies
import fresh_tomatoes

toy_story = movies.Movie("Toy Story", "A story of a boy and his toys",
                         "https://goo.gl/images/h95syN",
                         "https://www.youtube.com/watch?v=KYz2wyBy3kc")
# print (toy_story.storyline)

avatar = movies.Movie("Avatar", "A marine on an alien planet",
                      "https://goo.gl/images/EJ7mBN",
                      "https://www.youtube.com/watch?v=cRdxXPV9GNQ")
# print(avatar.storyline)
# avatar.show_trailer()

movies = [toy_story, avatar]
fresh_tomatoes.open_movies_page(movies)
Ejemplo n.º 20
0
def classify_movie(mov_file, pred_fn, conf, crop_loc):
    cap = movies.Movie(mov_file)
    sz = (cap.get_height(), cap.get_width())
    n_frames = int(cap.get_n_frames())
    bsize = conf.batch_size
    flipud = False

    pred_locs = np.zeros([n_frames, conf.n_classes, 2])
    pred_ulocs = np.zeros([n_frames, conf.n_classes, 2])
    preds = np.zeros([
        n_frames,
        int(conf.imsz[0] // conf.rescale),
        int(conf.imsz[1] // conf.rescale), conf.n_classes
    ])
    pred_locs[:] = np.nan
    uconf = np.zeros([n_frames, conf.n_classes])

    to_do_list = []
    for cur_f in range(0, n_frames):
        to_do_list.append([cur_f, 0])

    n_list = len(to_do_list)
    n_batches = int(math.ceil(float(n_list) / bsize))
    cc = [c - 1 for c in crop_loc]
    for cur_b in range(n_batches):
        cur_start = cur_b * bsize
        ppe = min(n_list - cur_start, bsize)
        all_f = apt.create_batch_ims(to_do_list[cur_start:(cur_start + ppe)],
                                     conf,
                                     cap,
                                     flipud, [None],
                                     crop_loc=cc)

        # base_locs, hmaps = pred_fn(all_f)
        ret_dict = pred_fn(all_f)
        base_locs = ret_dict['locs']
        hmaps = ret_dict['hmaps']
        if model_type == 'mdn':
            uconf_cur = ret_dict['conf_unet']
            ulocs_cur = ret_dict['locs_unet']
        else:
            uconf_cur = ret_dict['conf']
            ulocs_cur = ret_dict['locs']

        for cur_t in range(ppe):
            cur_entry = to_do_list[cur_t + cur_start]
            cur_f = cur_entry[0]
            xlo, xhi, ylo, yhi = crop_loc
            base_locs_orig = base_locs[cur_t, ...].copy()
            base_locs_orig[:, 0] += xlo
            base_locs_orig[:, 1] += ylo
            pred_locs[cur_f, :, :] = base_locs_orig[...]
            u_locs_orig = ulocs_cur[cur_t, ...].copy()
            u_locs_orig[:, 0] += xlo
            u_locs_orig[:, 1] += ylo
            pred_ulocs[cur_f, :, :] = u_locs_orig[...]
            preds[cur_f, ...] = hmaps[cur_t, ...]
            uconf[cur_f, ...] = uconf_cur[cur_t, ...]

        if cur_b % 20 == 19:
            sys.stdout.write('.')
        if cur_b % 400 == 399:
            sys.stdout.write('\n')

    cap.close()
    return pred_locs, preds, pred_ulocs, uconf
Ejemplo n.º 21
0
import movies
import page_generator

rocky = movies.Movie(
    'Rocky', 'https://www.youtube.com/watch?v=3VUblDwa648',
    'The story of boxer making his way to the top',
    'https://www.movieposter.com/posters/archive/main/90/MPW-45270')

be_blood = movies.Movie(
    'There Will Be Blood', 'https://www.youtube.com/watch?v=FeSLPELpMeM',
    'A story exploring a man\'s quest for power',
    'http://cdn.collider.com/wp-content/uploads/there_will_be_blood_movie_poster_rolling_roadshow_2010_olly_moss.jpg'
)

old_men = movies.Movie(
    'No Country for Old Men', 'https://www.youtube.com/watch?v=38A__WT3-o0',
    'A story about a man caught up in crime and violence',
    'https://aswedetalksmovies.files.wordpress.com/2012/04/no-country-for-old-men.jpg'
)

the_future = movies.Movie(
    'Back to the Future', 'https://www.youtube.com/watch?v=yosuvf7Unmg',
    'A boy travels in time using a delorean',
    'http://www.movieposter.com/posters/archive/main/50/MPW-25074')

space_jam = movies.Movie(
    'Space Jam', 'https://www.youtube.com/watch?v=IzU0x1tlfSQ',
    'Michael Jordan plays basketball with the Loony Toons and some Aliens',
    'https://www.movieposter.com/posters/archive/main/93/MPW-46645')

my_movies = [rocky, be_blood, old_men, the_future, space_jam]
Ejemplo n.º 22
0
 def test_filter_by(self):
     o = movies.Movie()
     output = [('The Usual Suspects', 'Bryan Singer')]
     self.assertEqual(o.filter_by('director','Bryan Singer'), output)
Ejemplo n.º 23
0
import movies
import fresh_tomatoes

print(movies.Movie.__module__)
print(movies.Movie.__name__)
print(movies.Movie.__doc__)

divergent = movies.Movie(
    "divergent",
    "As each person enters adulthood-must choose a faction and commit to it for life",
    "https://upload.wikimedia.org/wikipedia/en/thumb/d/d4/Divergent.jpg/220px-Divergent.jpg",
    "https://www.youtube.com/watch?v=zFBZM-eA1K0")

insurgent = movies.Movie(
    "Insurgent", "Divergent -Sequal",
    "https://upload.wikimedia.org/wikipedia/en/thumb/a/af/Insurgent_poster.jpg/220px-Insurgent_poster.jpg",
    "https://www.youtube.com/watch?v=IR-l_TSjlEo")

allegiant = movies.Movie(
    "Allegiant", "Insurgent-Sequal",
    "https://upload.wikimedia.org/wikipedia/en/thumb/f/f8/Allegiantfilmposter.jpg/220px-Allegiantfilmposter.jpg",
    "https://www.youtube.com/watch?v=0G0C-vMHcQY")

midnight_in_paris = movies.Movie(
    "Midnight In Paris", "One of my all time Favorites",
    "https://upload.wikimedia.org/wikipedia/en/9/9f/Midnight_in_Paris_Poster.jpg",
    "https://www.youtube.com/watch?v=BYRWfS2s2v4")

fantastic_beasts = movies.Movie(
    "Fantastic Beasts: The Crimes of Grindelwald", "To all poter-heads",
    "https://upload.wikimedia.org/wikipedia/en/3/3c/Fantastic_Beasts_-_The_Crimes_of_Grindelwald_Poster.png",
import movies
import fresh_tomatoes

moving_castle = movies.Movie(
    "Howl's Moving Castle", "2004", "Hayao Miyazaki",
    "When a young woman is cursed with an old body by a spiteful witch, her only chance of breaking the spell lies with a self-indulgent yet insecure young wizard and his companions in his legged, walking castle.",
    "https://upload.wikimedia.org/wikipedia/en/a/a0/Howls-moving-castleposter.jpg",
    "https://www.youtube.com/watch?v=iwROgK94zcM")

princess_mononoke = movies.Movie(
    "Princess Mononoke", "1997", "Hayao Miyazaki",
    "On a journey to find the cure for a Tatarigami's curse, Ashitaka finds himself in the middle of a war between the forest gods and Tatara, a mining colony. In this quest he also meets San, the Mononoke Hime.",
    "https://upload.wikimedia.org/wikipedia/en/2/24/Princess_Mononoke_Japanese_Poster_%28Movie%29.jpg",
    "https://www.youtube.com/watch?v=pkWWWKKA8jY")

spirited_away = movies.Movie(
    "Spirited Away", "2001", "Hayao Miyazaki",
    "During her family's move to the suburbs, a sullen 10-year-old girl wanders into a world ruled by gods, witches, and spirits, and where humans are changed into beasts.",
    "https://upload.wikimedia.org/wikipedia/en/3/30/Spirited_Away_poster.JPG",
    "https://www.youtube.com/watch?v=ByXuk9QqQkk")

your_name = movies.Movie(
    "Your Name", "2016", "Makoto Shinkai",
    "Two strangers find themselves linked in a bizarre way. When a connection forms, will distance be the only thing to keep them apart?",
    "https://upload.wikimedia.org/wikipedia/en/0/0b/Your_Name_poster.png",
    "https://www.youtube.com/watch?v=hRfHcp2GjVI")

ghost_in_shell = movies.Movie(
    "Ghost in the Shell", "1995", "Kazunori Itō",
    "A cyborg policewoman and her partner hunt a mysterious and powerful hacker called the Puppet Master.",
    "https://upload.wikimedia.org/wikipedia/en/c/ca/Ghostintheshellposter.jpg",
import movies
import fresh_tomatoes

toy_story = movies.Movie(
    "Toy Story", "Storyline of the trailer",
    "https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
    "https://www.youtube.com/watch?v=KYz2wyBy3kc")

avatar = movies.Movie(
    "Toy Story", "Storyline of the avatar",
    "https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
    "https://www.youtube.com/watch?v=KYz2wyBy3kc")
# here what we see movies is the file name anf in that class movie is called in that class
# init function is called which creates an instance or object of the class Movie
# init function also called a constructor because it creates an space in the memory
# self is aded by default

three_idiots = movies.Movie(
    "3 idiots", "Storyline of the movie 3 idiots",
    "https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
    "https://www.youtube.com/watch?v=K0eDlFX9GMc")

three_idiots = movies.Movie(
    "3 idiots", "Storyline of the movie 3 idiots",
    "https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
    "https://www.youtube.com/watch?v=K0eDlFX9GMc")

three_idiots = movies.Movie(
    "3 idiots", "Storyline of the movie 3 idiots",
    "https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
    "https://www.youtube.com/watch?v=K0eDlFX9GMc")
 """The main module which interface movies(data) and html display fresh_tomatoes.py"""

import movies
import fresh_tomatoes

# justice league movie

justiceleague=movies.Movie("Justice League",
			   "Batman and other heroes join together to defeat stepphenwolf",
			   "http://t0.gstatic.com/images?q=tbn:ANd9GcTbr9aajZtJiuhXc_biRws9jzCi4u1q4MWvyPVe0rGO9Z0RwDqT", #noqa
			   "https://www.youtube.com/watch?v=r9-DM9uBtVI")
# it(2017)movie

it=movies.Movie("It(2017)",
		""" Seven young outcasts in Derry, Maine, are about 
		    to face their worst nightmare
		    -- an ancient, shape-shifting evil that emerges 
		    from the sewer every 27 years
		    to prey on the town's children """",
		"http://t1.gstatic.com/images?q=tbn:ANd9GcTALjGaaCwNAfgH2Fa0jVpp2mEOhGRRw1v0lkRrHlUtXyKW0buX", # noqa
		"https://www.youtube.com/watch?v=FnCdOQsX5kc")

# wonderwoman movie

wonderwoman=movies.Movie("Wonder Woman",
			"""Before she was Wonder Woman (Gal Gadot), she was Diana, princess of 
			   the Amazons, trained to be an unconquerable warrior. Raised on a
			   sheltered island paradise, Diana meets an American pilot (Chris Pine)
			   who tells her about the massive conflict that's
			   raging in the outside world.""",
			"http://t1.gstatic.com/images?q=tbn:ANd9GcQcCAOmt-FsRsR8GebIzI67qSvdQ2JLYDRLxeAcbH-541fzqq1H", #noqa
Ejemplo n.º 27
0
import movies
import fresh_tomatoes

# Creating the instances of Movie class

avatar = movies.Movie("Avatar", 162,
                      "https://www.youtube.com/watch?v=5PSNL1qE6VY",
                      """A paraplegic marine dispatched to the moon Pandora on a
                      Unique mission becomes torn between following his orders
                      and protecting the world he feels is his home.""",
                      'https://resizing.flixster.com/Yq4pN3qojAZDF6QJFd_yE2Zmr1o=/206x305/v1.bTsxMTE3Njc5MjtqOzE3ODU5OzEyMDA7ODAwOzEyMDA'  # NOQA
                      )

moana = movies.Movie("Moana", 107,
                     "https://www.youtube.com/watch?v=LKFuXETZUsI",
                     """In Ancient Polynesia, when a terrible curse incurred
                     by the Demigod Maui reaches Moana's island, she answers
                     the Ocean's call to seek out the Demigod to set things
                     right.""",
                     'https://m.media-amazon.com/images/M/MV5BMjI4MzU5NTExNF5BMl5BanBnXkFtZTgwNzY1MTEwMDI@._V1_SY1000_CR0,0,674,1000_AL_.jpg'  # NOQA
                     )

it = movies.Movie("It", 135,
                  "https://www.youtube.com/watch?v=FnCdOQsX5kc",
                  """In the summer of 1989, a group of bullied
                   kids band together to destroy a shapeshifting
                    monster, which disguises itself as a clown
                   and preys on the children of Derry, their small Maine
                   town.""",
                  'https://m.media-amazon.com/images/M/MV5BZDVkZmI0YzAtNzdjYi00ZjhhLWE1ODEtMWMzMWMzNDA0NmQ4XkEyXkFqcGdeQXVyNzYzODM3Mzg@._V1_SY1000_CR0,0,666,1000_AL_.jpg'  # NOQA
                  )
"""Info for trailers site."""


import movies
import site_compile

# Create "Movie" instance for Resident Evil Movie
resident_evil_1 = movies.Movie(
    'Resident Evil',
    '''Underneath Raccoon City exists a genetic research facility called the Hive,
    owned by the Umbrella Corporation. A thief steals the genetically
    engineered T-virus and contaminates the Hive with it. In response, the
    facility\'s artificial intelligence, the Red Queen, seals the Hive and
    kills everyone inside.''',
    'http://static.tvtropes.org/pmwiki/pub/images/683290_413.jpg',
    'https://www.youtube.com/watch?v=u6uDnd_v5Bw')

# Create "Movie" instance for Silent Hill Movie
silent_hill_1 = movies.Movie(
    'Silent Hill',
    '''Rose and her husband, Christopher Da Silva, are concerned about their
    adopted daughter, 9-year old Sharon, who has been sleepwalking while
    calling the name of a town, "Silent Hill". Desperate for answers, Rose
    takes Sharon to Silent Hill. As they approach the town, she is pursued by
    police officer Cybil Bennett, who has become suspicious of Rose\'s motives
    after witnessing Sharon panic at a gas station when her drawings are
    mysteriously vandalized. A mysterious child appears in the road, causing
    Rose to swerve and crash the car, knocking herself unconscious. When she
    awakens, Sharon is missing, while fog and falling ash blanket the town.''',
    'http://www.impawards.com/2006/posters/silent_hill_xlg.jpg',
    'https://www.youtube.com/watch?v=WWMGZe6iucw')
Ejemplo n.º 29
0
# webbrowser library required to open/view the html file
import webbrowser

# os library reqiured to find the path of current working directory
import os

# movies file contains Movie class to generate individual movie database
import movies

# create movies database
toy_story = movies.Movie(
    'Toy Story', 1995, 8.3,
    'https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg',
    'https://www.youtube.com/watch?v=KYz2wyBy3kc')
gladiator = movies.Movie(
    'Gladiator', 2000, 8.5,
    'https://upload.wikimedia.org/wikipedia/en/8/8d/Gladiator_ver1.jpg',
    'https://www.youtube.com/watch?v=owK1qxDselE')
the_shawshank_redemption = movies.Movie(
    'The Shawshank Redemption',
    1994,
    9.3,
    'https://upload.wikimedia.org/wikipedia/en/8/81/ShawshankRedemptionMoviePoster.jpg',  #noqa
    'https://www.youtube.com/watch?v=6hB3S9bIaco')
finding_nemo = movies.Movie(
    'Finding Nemo', 2003, 8.1,
    'https://upload.wikimedia.org/wikipedia/en/2/29/Finding_Nemo.jpg',
    'https://www.youtube.com/watch?v=wZdpNglLbt8')
badlapur = movies.Movie(
    'Badlapur', 2015, 7.5,
    'http://www.bollywoodirect.com/wp-content/uploads/2014/12/badlapur1.jpg',
Ejemplo n.º 30
0
import quentin
import movies

# Movie Instances using the 'movies' Class
# Hateful Eight Movie: movie title, movie rating, poster image & trailer
hateful_eight = movies.Movie("The Hateful Eight", "7.8/10",
                             "https://goo.gl/yz1RWg",
                             "https://www.youtube.com/watch?v=6_UI1GzaWv0")

# Inglourious Basterds Movie: movie title, movie rating, poster image & trailer
inglourious_basterds = movies.Movie(
    "Inglourious Basterds", "8.3/10", "https://goo.gl/rQv6cZ",
    "https://www.youtube.com/watch?v=6AtLlVNsuAc")

# Django Unchained Movie: movie title, movie rating, poster image & trailer
django_unchained = movies.Movie("Django Unchained", "8.4/10",
                                "https://goo.gl/Zh0ezg",
                                "https://www.youtube.com/watch?v=_iH0UBYDI4g")

# Jackie Brown Movie: movie title, movie rating, poster image & trailer
jackie_brown = movies.Movie("Jackie Brown", "7.5/10", "https://goo.gl/adK6V0",
                            "https://www.youtube.com/watch?v=HlAECQzTkfY")

# Pulp Fiction Movie: movie title, movie rating, poster image & trailer
pulp_fiction = movies.Movie("Pulp Fiction", "8.9/10", "https://goo.gl/VZWHVq",
                            "https://www.youtube.com/watch?v=tGpTpVyI_OQ")

# Reservoir Dogs Movie: movie title, movie rating, poster image & trailer
reservoir_dogs = movies.Movie("Reservoir Dogs", "8.3/10",
                              "https://goo.gl/b42X8h",
                              "https://www.youtube.com/watch?v=vayksn4Y93A")