def prompt_show_watched_movies():
    username = database.check_username(input('username: '******'{username[0][0]} has watched no movies yet')
    else:
        print('No such user exists')
Exemplo n.º 2
0
 def __init__(self,connection, discoveryOptions):
     self.connection = connection
     self.discoveryOptions = discoveryOptions
     self.sqlDataBaseProps = DatabaseProps.SqlDbProps(connection, discoveryOptions)
     self.sqlServerConfig = SqlServerConfig.getSqlServerConfig(connection, discoveryOptions)
     self.clusterConfiguration =ClusterConfiguration.ClusterConfiguration(connection, discoveryOptions)
     self.sqlDatabase = SqlDatabase.SqlDatabase(connection, discoveryOptions)
Exemplo n.º 3
0
def main():
    handler = fh.FileHandler(INPUT_FOLDER, INCORRECT_FOLDER, PROCESSED_FOLDER)
    handler.remove_invalid_files_from_folder()
    parser = p.Parser(handler.get_fb2_file())
    bookname = parser.get_book_name()
    number_of_paragraph = parser.get_number_of_paragraph()
    number_of_words = parser.get_number_of_words()
    number_of_letters = parser.get_number_of_letters()
    word_Upper = parser.get_words_in_uppercase()
    word_lower = parser.get_words_in_lower()
    words = parser.get_words_stats()
    db = sql.SqlDatabase(DB_FOLDER, DB_NAME)
    db.create_book_stat_table()
    db.create_input_file_stat_table()
    db.insert_book_stat_values(bookname[0], number_of_paragraph[0],
                               number_of_words[0], number_of_letters[0],
                               word_Upper, word_lower)
    for items in words.items():
        db.insert_input_file_stat_values(items[0], items[1][0], items[1][1])
    handler.remove_processed_files_from_input_folder()
    print("Ok")
def prompt_watch_movie():
    username = input('Who watched the movie?: ')
    movie_id = input('Movie ID:?')
    database.watch_movie(username, movie_id)
def prompt_add_movie():
    title = input('Movie title: ')
    release_date_timestamp = datetime.datetime.strptime(
        input('Release date (dd-mm-yyyy): '), '%d-%m-%Y').timestamp()

    database.add_movie(title, release_date_timestamp)

def prompt_show_watched_movies():
    username = database.check_username(input('username: '******'{username[0][0]} has watched no movies yet')
    else:
        print('No such user exists')


print(welcome)
database.create_tables()

user_input = 0

while user_input != '7':
    print(menu)
    user_input = input('Please enter your selection: ')
    if user_input == '1':
        prompt_add_movie()
    elif user_input == '2':
        movies = database.get_movies(True)
        print_movie_list('UPCOMING', movies)
    elif user_input == '3':
        movies = database.get_movies()
        print_movie_list('ALL', movies)
    elif user_input == '4':