示例#1
0
def main():
    while True:
        print(" 1.Console   ")
        print(" 2.GUI       ")
        chosenUi = input("Choose interface:")
        if chosenUi == "1":
            game = Console()
            game.run()
        elif chosenUi == "2":
            pass
        else:
            print("Invalid option!")
import numpy as np
import matplotlib as mpl
from sklearn.model_selection import train_test_split
from repository import Repository
from controller import Controller
from ui import Console

if __name__ == "__main__":

    repository = Repository()
    controller = Controller(repository)
    console = Console(controller)
    console.run()
示例#3
0
'''
Created on Feb 6, 2019
@author: Marius
'''
from ui import Console
from bussines import Service
from persistance import Repository
from validation import Validator

repository = Repository()
validator = Validator()
service = Service(repository, validator)
console = Console(service)
console.run()
def main():
    repo = Repository("bdate2.txt")
    contr = Controller(repo)
    console = Console(contr)
    console.run()
示例#5
0
from domain import Jucator
from repository import RepositoryJucator, FileRepositoryJucator
from validare import ValidareJucator
from service import ServiceJucator
from ui import Console
from exceptii import *
from teste import TesteJucator

repo = FileRepositoryJucator("jucatori.txt", Jucator.read, Jucator.write)
valid = ValidareJucator()
srv = ServiceJucator(valid, repo)
ui = Console(srv)
teste = TesteJucator()

teste.ruleaza()
ui.run()
示例#6
0
from domain import Melodie
from repository import RepositoryMelodie, FileRepositoryMelodie
from valid import *
from service import ServiceMelodie
from ui import Console

repo = FileRepositoryMelodie("melodii.txt", Melodie.read, Melodie.write)
valid = Validator()
service = ServiceMelodie(repo, valid)
ui = Console(service)

ui.run()
示例#7
0
from ui import Console

ui = Console()
ui.run()
示例#8
0
文件: bman.py 项目: thetoast/bman
            for dir_name, bundle_type in bundle_types.values():
                if os.path.isdir(os.path.join(name, dir_name)):
                    bundles[name] = bundle_type(name)


    return bundles



if __name__ == "__main__":
    bundles = {}
    bundle_types = {"git" : (".git", GitBundle), "hg" : (".hg", HgBundle)}

    # create a console
    from ui import Console
    console = Console()

    # usage is handy
    usage = "%prog <command> [args]\n\nCommands:\n"
    for name in sorted(commands.command_list.keys()):
        usage += "\t%s%s%s\n" % (name, " "*(16-len(name)), commands.command_help[name])


    # parse args
    parser = OptionParser(usage=usage, version="%prog 0.1")
    parser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False)
    parser.add_option("-a", "--all", help="operate on all bundles", dest="all", action="store_true", default=False)
    parser.add_option("-r", "--revision", help="operate on a particular revision", dest="revision", default=None)
    parser.add_option("-l", "--limit", help="limit output to a number of items", dest="limit", default=None)

    if len(sys.argv) < 2:
示例#9
0
        service_client = ServiceClients(repository_client, valid_client,
                                        undo_stack, redo_stack,
                                        repository_rental)
        service_rental = ServiceRentals(repository_movie, repository_client,
                                        repository_rental, valid_rental,
                                        undo_stack, redo_stack)
        service_undo = ServiceUndo(undo_stack, redo_stack)

    file.close()

except IOError as error:
    print(str(error))
'''
service_rental.rent_movie(1, 1, 1, '1/1/2018', '2/2/2018')
service_rental.return_movie(1, '9/1/2018')
service_rental.rent_movie(2, 5, 6, '3/3/2018','3/3/2019')
service_rental.rent_movie(4, 7, 8,'11/11/2018', '11/11/2019')
service_rental.return_movie(2, '4/3/2019')
service_rental.rent_movie(3, 1, 7, '4/4/2018', '5/5/2018')
service_rental.return_movie(3,'8/8/2018')
service_rental.rent_movie(5, 9, 8, '1/1/2019', '6/6/2019')
service_rental.rent_movie(6, 6, 4, '11/11/2019', '1/1/2020')
service_rental.rent_movie(7, 1, 2, '13/11/2019', '23/11/2019')
service_rental.rent_movie(8, 8, 3, '12/9/2019', '13/1/2020')
service_rental.return_movie(8, '23/10/2019')
service_rental.rent_movie(9, 10, 10, '12/11/2019', '1/1/2020')
'''
service_undo.clear()
''' UI '''
ui = Console(service_movie, service_client, service_rental, service_undo)
ui.run()
示例#10
0
def main():
    repo = Repository("balance-scale.data")
    contr = Controller(repo)
    console = Console(contr)
    console.run()
示例#11
0
    repoClients.add(Client(36, "Joshua Kimmich"))
    #____________________________________________________________________________

    repoRental.add(
        Rental(1, Book(1, "The Secret Crusade", "Oliver Bowden"),
               Client(20, "John Wright"), datetime.date(2019, 10, 5), None))
    repoRental.add(
        Rental(2, Book(2, "The Illustrated Man", "Ray Bradbury"),
               Client(40, "Andrei Ivan"), datetime.date(2019, 10, 7), None))

    #repoRental.add(Rental(3, Book(3, "The Glass Castle", "Jeannette Walls"), Client(35, "Frank Lampard"), datetime.date(2019, 10, 15), None))
    repoRental.add(
        Rental(4, Book(4, "Still Alice", "Lisa Genova"),
               Client(78, "Gerard Pique"), datetime.date(2019, 11, 1), None))
    repoRental.add(
        Rental(5, Book(5, "Olive Again", "Elizabeth Strout"),
               Client(24, "Moussa Dembele"), datetime.date(2019, 11, 7), None))
    repoRental.add(
        Rental(6, Book(6, "The Nightshift Before Christmas", "Adam Kay"),
               Client(12, "Mohamed Salah"), datetime.date(2019, 11, 9), None))
    repoRental.add(
        Rental(7, Book(7, "The Tales of Beedle the Bard", "J K Rowling"),
               Client(4, "Virgil Van Dijk"), datetime.date(2019, 11, 15),
               None))
    repoRental.add(
        Rental(8, Book(8, "This is Going to Hurt", "Adam Kay"),
               Client(80, "Luuk De Jong"), datetime.date(2019, 11, 17), None))

    c = Console(Srv, validatorInteger, validatorDate)
    c.run()