Esempio n. 1
0
 def __init__(self, size = (50,50), bs = (8,8)):
     if not view.initialized():
         view.init()
     self.size = 1 + 2 * size[0], 1 + 2 * size[1]
     self.ui = view.UI()
     self.ui.blocksize = bs
     self.ui.colors = Console.default_colors
     self.maze = model.Maze(size)
Esempio n. 2
0
 def __init__(self, size=(50, 50), bs=(8, 8)):
     if not view.initialized():
         view.init()
     self.size = 1 + 2 * size[0], 1 + 2 * size[1]
     self.ui = view.UI()
     self.ui.blocksize = bs
     self.ui.colors = Console.default_colors
     self.maze = model.Maze(size)
Esempio n. 3
0
def controller(stdscr):
    view.init(stdscr)
    global H, W, MENU_H, MENU_W, INFO_H, INFO_W
    H, W = stdscr.getmaxyx()
    MENU_H = H - 8
    MENU_W = 24
    INFO_H = MENU_H
    INFO_W = W - (MENU_W + 12)

    menu = {
        'current tournament': ("More options for the current tournament:\n"
                               "* save tournament\n"
                               "* register round or match\n"
                               "* declare winner\n"
                               "..."),
        'start a tournament':
        "Start a new tournament",
        'load a tournament': ("Load a previously started tournament,"
                              " from the tournament database"),
        'tournament list':
        "Display the list of tournaments in the database",
        'add a player':
        "Add a new player to the database",
        'show all players':
        "Show all players in the database",
        'exit':
        "Exit the program. Don't forget to save your stuff !"
    }

    menu = view.MenuWin(MENU_H, MENU_W, 2, 2, **menu)
    tournament = None
    while True:
        menu.draw()
        # menu.refresh()
        selected = menu.navigate()
        if selected == QUIT:
            break
        elif selected == 0:
            if tournament is not None:
                menu.clear()
                tournament_menu(tournament)
            else:
                view.Popup("info", "No tournament selected,"
                           "load one from the database or start a new one")\
                    .draw()
        elif selected == 1:
            tournament = new_tournament()
        elif selected == 2:
            tournament = load_tournament()
        elif selected == 3:
            list_tournaments()
        elif selected == 4:
            new_player()
        elif selected == 5:
            list_players()
    view.stop()
Esempio n. 4
0
def main():

    #create model instance
    mymodel = model.AddressBook(filename='carnet_2.txt')
    #create the view instance
    root, myview = view.init()

    #create the controller instance
    mycontroller = controller.Controller(mymodel, myview)

    #launch !
    root.mainloop()
Esempio n. 5
0
from lib import wait_for_job, check_file_exists

repo_path = os.path.dirname(sys.path[0])
  
sys.path.append(os.path.join(repo_path, "src/gui"))
import model as M
import view as V
import controller as C

os.makedirs(os.path.join(repo_path, "test/scratch/seeds"))
shutil.copy(os.path.join(repo_path, "configuration.pysh"),
            os.path.join(repo_path, "test/scratch/seeds"))

M.init(None, os.path.join(repo_path, "test/scratch/seeds/configuration.pysh"))
V.init(None)
C.init(None)

os.makedirs(os.path.join(repo_path, "test/scratch/seeds/groundtruth-data/round1"))
shutil.copy(os.path.join(repo_path, "data/PS_20130625111709_ch3.wav"),
            os.path.join(repo_path, "test/scratch/seeds/groundtruth-data/round1"))

run(["hetero", "start", "1", "1", "1"])

shutil.copy(os.path.join(repo_path, "data/PS_20130625111709_ch3-annotated-person1.csv"),
            os.path.join(repo_path, "test/scratch/seeds/groundtruth-data/round1"))

V.context_ms_string.value = "204.8"
V.shiftby_ms_string.value = "0.0"
V.optimizer.value = "adam"
V.learning_rate_string.value = "0.0002"
Esempio n. 6
0
from sys import argv

bokehlog = logging.getLogger("songexplorer")
bokehlog.setLevel(logging.INFO)
#bokehlog.info(...)

_, configuration_file = argv

import model as M
import view as V
import controller as C

doc = curdoc()

M.init(doc, configuration_file)
V.init(doc)
C.init(doc)

cluster_buttons = row(V.which_layer,
                      V.which_species,
                      V.which_word,
                      V.which_nohyphen,
                      V.which_kind,
                      column(V.color_picker, width=75, align='end'),
                      width=M.gui_width_pix - 75)
navigate_buttons = row(
    column(Spacer(height=41, width=40), column(V.panleft, width=50),
           Spacer(height=41, width=40), column(V.allleft, width=50)),
    column(V.zoomin, V.reset, V.zoomout, V.allout, width=50),
    column(Spacer(height=41, width=40), column(V.panright, width=50),
           Spacer(height=41, width=40), column(V.allright, width=50)))
Esempio n. 7
0
from view import init

if __name__ == '__main__':
    init()