def userAllMovies(self): with DB() as db: values = (self.id,) rows = db.execute('SELECT Movies.id, Movies.title, Movies.description, Movies.directorId, Movies.ageLimit, Movies.date FROM Movies INNER JOIN Third ON Movies.id = Third.movieId WHERE Third.userId = ?' , values).fetchall() print(rows) return [Movies(*row) for row in rows]
def __init__(self): self.currMovies = 702625 self.g = Genres() self.m = Movies() self.imgURI = 'https://image.tmdb.org/t/p/w220_and_h330_face' self._apiKey = 'cab215b672637a6d24409a56bcd457c2' self._baseUri = 'https://api.themoviedb.org/' pass
def test_add_movie(self): db = "cinema.db" movies = Movies(db) #movies.add_movie("The Hunger Games: Catching Fire", 7.9) #movies.add_movie("Wreck-It Ralph", 7.8) #movies.add_movie("Her", 8.3) #TESTING SHOW MOVIES movies.show_movies()
def __init__(self, addon, artutils, options): '''Initializations pass our common classes and the widget options as arguments''' self.artutils = artutils self.addon = addon self.options = options self.movies = Movies(self.addon, self.artutils, self.options) self.tvshows = Tvshows(self.addon, self.artutils, self.options) self.songs = Songs(self.addon, self.artutils, self.options) self.albums = Albums(self.addon, self.artutils, self.options) self.pvr = Pvr(self.addon, self.artutils, self.options) self.episodes = Episodes(self.addon, self.artutils, self.options)
def add(): if not "user" in session: return redirect('/') if request.method == 'GET': return render_template('addmovie.html', user=Users.loadUserId(session["user"])) if request.method == 'POST': values = (None, request.form['title'], request.form['description'], session["user"], request.form['agelimit'], request.form['moviedate']) movie = Movies(*values).create() return redirect('/')
def editMovie(id): if not "user" in session: return redirect('/') if session["user"] is not Movies.findMovie(id).director: return redirect('/') if request.method == 'GET': return render_template('editmovies.html', movie=Movies.findMovie(id)) if request.method == 'POST': values = (id, request.form['title'], request.form["description"], session["user"], request.form['agelimit'], request.form['moviedate']) movie = Movies(*values).edit() return redirect('/mymovies')
def added_movie(): if session['username'] != "admin": return render_template("unworthy.html") if request.method =="POST": file = request.files['pic'] filename = None if 'pic' in request.files: filename = photos.save(request.files['pic']) movie = Movies(name = request.form['name'],cast = request.form['cast'], rat = int(request.form['rating']),lang = request.form['lang'], genre = request.form['genre'], img_link = filename,c_rating = int(request.form['c_rating']), avg_rating = int(request.form['avg_rating']),release_date = request.form['release_date'], duration = request.form['duration']) if Movies.query.filter_by(name = movie.name).first() != None: return render_template('unsuccessful.html',error = "Movie already exists!") db.session.add(movie) db.session.commit() return render_template('add_movie.html')
def run(self): print("\n Welcome to BookMyShow \n ") print("\n Please select Movie from following list: \n\n") movie = Movies() # Display movie list and select movie movieList = movie.getMovies() movie_id = super(BookMyShow, self).displayMovies(movieList) # Display date list and select date movieDates = movie.getMovieDates(movie_id) movies_dates_id = super(BookMyShow, self).displayDates(movie_id, movieList, movieDates) # Display time list and select time movieTimes = movie.getMovieDateTimes(movie_id, movies_dates_id) movies_time_id = super(BookMyShow, self).displayTimes(movie_id, movies_dates_id, movieList, movieDates, movieTimes) # Display seat nos and select seat bookedTicketNo = movie.getBookedSeats(movie_id, movies_dates_id, movies_time_id) seat_nos = super(BookMyShow, self).displaySeats(bookedTicketNo) decision = input("Want to Book Ticket \n Plese enter Y or N:") if (decision == 'Y'): for seat_no in seat_nos: movie.bookTicket(movie_id, movies_dates_id, movies_time_id, seat_no, 1) print("\n Booked seat no " + str(seat_no) + " for " + movieList[movie_id] + " movie on date " + str(movieDates[movies_dates_id]) + " and time " + str(movieTimes[movies_time_id]) + " Successfully ")
import fresh_tomatoes from movies import Movies the_avenger_infinity_war = Movies( 'Avengers: Infinity War', 'The Avengers and their allies must be willing to sacrifice all in an attempt to defeat the powerful Thanos before his blitz of devastation and ruin puts an end to the universe.', 'https://ia.media-imdb.com/images/M/MV5BMjMxNjY2MDU1OV5BMl5BanBnXkFtZTgwNzY1MTUwNTM@._V1_UX182_CR0,0,182,268_AL_.jpg', 'https://www.youtube.com/watch?v=6ZfuNTqbHE8') a_quiet_place = Movies( 'A Quiet Place', 'A family is forced to live in silence while hiding from creatures that hunt by sound.', 'https://ia.media-imdb.com/images/M/MV5BMjI0MDMzNTQ0M15BMl5BanBnXkFtZTgwMTM5NzM3NDM@._V1_UX182_CR0,0,182,268_AL_.jpg', 'https://www.youtube.com/watch?v=WR7cc5t7tv8') rampage = Movies( 'Rampage', 'When three different animals become infected with a dangerous pathogen, a primatologist and a geneticist team up to stop them from destroying Chicago.', 'https://ia.media-imdb.com/images/M/MV5BNDA1NjA3ODU3OV5BMl5BanBnXkFtZTgwOTg3MTIwNTM@._V1_UX182_CR0,0,182,268_AL_.jpg', 'https://www.youtube.com/watch?v=coOKvrsmQiI') movies = [the_avenger_infinity_war, a_quiet_place, rampage] fresh_tomatoes.open_movies_page(movies)
#!/usr/bin/python # -*- coding: utf-8 -*- import os from flask import Flask, render_template from flask_caching import Cache from movies import Movies from people import People mov = Movies() pep = People() def main(): FLASK_DEBUG = False app = create_app() app.run(port=8000, debug=FLASK_DEBUG, threaded=True) def create_app(): app = Flask(__name__, instance_relative_config=True) config = {'DEBUG': True} app.config.from_mapping(config) cache = Cache(app, config={ 'CACHE_TYPE': 'simple', 'CACHE_DEFAULT_TIMEOUT': 60 }) @app.route('/movies/', methods=['GET']) @cache.cached(timeout=60) def fetchMoviesWithPeople(): '''
def test_get_movie_name(self): db = "cinema.db" movies = Movies(db) movie = movies._get_movie_name(1) self.assertEqual(movie, "The Hunger Games: Catching Fire")
from movies import Movies from projections import Projections from reservation import Reservation db = "cinema.db" movies = Movies(db) projections = Projections(db) reservation = Reservation(db) reservation.clear_reservation_on_stratup() def start_mess(): start_message = "Hello, here is the cinema. You can \ use one of the the following commands:\ \n show_movies - print all movies ordered by rating\ \n show_movie_projections <movie_id> - \ print all projections of a given movie\ \n make_reservation\ \n cancel_reservation <name> - disintegrate given person's reservation\ \n exit\ \n help" return start_message def print_func(set_obj): for row in set_obj: print(row) def print_hall(matrix):
"country": item.get('area'), "studio": '', "sorttitle": get_sorttitle(item.get('title')), "shortplot": item.get('subTitle'), "trailer": '', "mpaa": '', "source_id": pptv_id, "playurl": "plugin://plugin.video.bigmovies/play/" + str(pptv_id), "path": "plugin://plugin.video.bigmovies/", "artwork": { "poster": detail['imgurl'] } } if __name__ == "__main__": with sqlite3.connect(KODI_DATABASE_PATH + "MyVideos107.db", 120) as kodi_conn,\ sqlite3.connect(KODI_DATABASE_PATH + "pptv.db", 120) as pp_conn: cursor = kodi_conn.cursor() pptv_cursor = pp_conn.cursor() mo = Movies(cursor, pptv_cursor) pptv = PPTVClass() s = pptv.get_channel_list(1, pn=1, ps=1000) total_count = s['count'] for item in s['videos']: # print(str(count) + item['title'].encode('gbk')) # print(get_sorttitle(item['title']).encode('gbk')) mo.add_update(item_remap(item)) pp_conn.commit() kodi_conn.commit()
def add_update_listitem(kodi_cursor, pptv_cursor, detail): mo = Movies(kodi_cursor, pptv_cursor, int(KODI)) mo.add_update(item_remap(detail))
from movies import Movies test = Movies() print(test.get_movie())
from movies import Movies movie = Movies() filename = 'data.json' moviedata = movie.get_movies_data(filename) searchtitle = str(input("Please enter movie title to update: ")) updatetitle = str(input("Please enter Updated movie title: ")) movie.update_movie(moviedata, searchtitle, updatetitle, filename)
import inspect import json import os from bson import json_util from flask import Response, request, Flask, render_template from typing import Any, Dict from movies import Movies from util.flask.flask_utils import reroute_to, preconditions, form_contains app = Flask(__name__, static_url_path='') movies = Movies() @app.route('/') def index(): # type: () -> Response return render_template('index.html') @app.route('/movies_queries', methods=['GET', 'POST']) def movies_queries(): # type: () -> Response return json.dumps(movies.queries()) @app.route('/bad', methods=['GET', 'POST']) def bad_request(): # type: () -> Response
def findDirectorMovies(self): with DB() as db: values = (self.id,) rows = db.execute('SELECT * FROM Movies WHERE directorId = ?', values).fetchall() return [Movies(*row) for row in rows]
def main(): genre_url = Genres().select() movies = Movies(genre_url) movies.show_movies()