Esempio n. 1
0
def main():
    # Set up GUI
    globalvars.init()
    window = tk.Tk()  # Makes main window
    window.wm_title("Focus_GUI: Root Window")
    window.config(background="#FFFFFF")

    globalvars.lbl1 = tk.StringVar()
    globalvars.lbl2 = tk.StringVar()

    globalvars.lbl1.set("Choose the required Directory")
    globalvars.lbl2.set("Choose a Video Folder")

    # Button to choose Video directory with the .jpg and .npy files
    but_direc = tk.Button(window,
                          text="Directory",
                          width=10,
                          command=browse_directory)
    but_direc.grid(row=0, column=1)

    # Label to dynamically display the current directory
    label1 = tk.Label(window, textvariable=globalvars.lbl1)
    label1.grid(row=0, column=3)

    but_preview = tk.Button(window,
                            text="Preview",
                            width=10,
                            command=lambda: preview(window))
    but_preview.grid(row=2, column=1)

    but_view = tk.Button(window,
                         text="View Video",
                         width=10,
                         command=lambda: view(window))
    but_view.grid(row=4, column=1)

    but_quitApp = tk.Button(window,
                            text="Quit",
                            width=10,
                            command=window.destroy)
    but_quitApp.grid(row=6, column=1)

    window.mainloop()  # Starts GUI
Esempio n. 2
0
        elif str(gv.showpagecommand) == "openFindMatchResultsPage":
            createwindow(ResultsPage, "550x700",
                         "MatchMakeMe - Matched Results")


######################################################################################################################
######################################################################################################################

######################################################################################################################
################################################ Main Function #######################################################
######################################################################################################################

if __name__ == "__main__":
    ##########################################################################################################
    # start up the GUI with loginpage
    gv.init()

    # call function to retrieve from a .txt file, which stores names of tables to create, and their column names
    dbinfo = pull()

    # call function to create the DB file with respective tables and names
    createDBfile(dbinfo)

    # create the login page, and launch it
    createwindow(LoginPage, "500x300", "MatchMakeMe - Login")

    ##########################################################################################################
    # once login confirmed, come back to here (main.py) to execute processSamples() to let user add any new profiles
    maindict = {}  # Initialize variables

    # Function to process data from selected sample files into a dictionary
Esempio n. 3
0
import globalvars
from api.dirlayout import app as api_dirlayout_blueprint
from api.volume import app as api_volume_blueprint
from api.volumes import app as api_volumes_blueprint

app = Flask(__name__)


@app.route("/")
@app.route("/volume/<vol_name>")
def index(vol_name=None):
    return render_template("index.html")


if __name__ == "__main__":
    if os.getuid() != 0:
        sys.stderr.write("Only root can run this\n")
        sys.exit(1)

    globalvars.init()

    app.register_blueprint(api_volumes_blueprint)
    app.register_blueprint(api_volume_blueprint)
    app.register_blueprint(api_dirlayout_blueprint)

    # Threaded must be activated since possibility of self request in getting brick range
    app.run(host='0.0.0.0',
            debug=globalvars.args.debug,
            port=globalvars.args.port,
            threaded=True)
Esempio n. 4
0
from flask import Flask, render_template

import globalvars
from api.dirlayout import app as api_dirlayout_blueprint
from api.volume import app as api_volume_blueprint
from api.volumes import app as api_volumes_blueprint

app = Flask(__name__)


@app.route("/")
@app.route("/volume/<vol_name>")
def index(vol_name=None):
    return render_template("index.html")


if __name__ == "__main__":
    if os.getuid() != 0:
        sys.stderr.write("Only root can run this\n")
        sys.exit(1)

    globalvars.init()

    app.register_blueprint(api_volumes_blueprint)
    app.register_blueprint(api_volume_blueprint)
    app.register_blueprint(api_dirlayout_blueprint)

    # Threaded must be activated since possibility of self request in getting brick range
    app.run(host='0.0.0.0', debug=globalvars.args.debug, port=globalvars.args.port, threaded=True)
Esempio n. 5
0
def runserver():
    globalvars.init("classifier/data/pc")
    app.register_blueprint(routes.app)
    app.register_blueprint(api.app)
    app.run(debug=True)
Esempio n. 6
0
def runserver():
    globalvars.init("classifier/data/pc")
    app.register_blueprint(routes.app)
    app.register_blueprint(api.app)
    app.run(debug=True)
Esempio n. 7
0
pygame.init()

import os
import collections
from pygame.locals import *
import globalvars as gv
import game
import menu
import screen

# Skapa ordlista för spelvy och menyvy.
windows = {}

try:
    # Initiera globala variabler, skärm samt sätt fönstertitel.
    gv.init()
    window = pygame.display.set_mode(gv.size)
    pygame.display.set_caption("SnakeMath")
    
    # Aktivera endast Events som används.
    pygame.event.set_allowed(None) # blockera samtliga events
    pygame.event.set_allowed(pygame.QUIT)
    pygame.event.set_allowed(pygame.KEYDOWN)
    pygame.event.set_allowed(USEREVENT)

    # Skapa färgobjekt för att ta bort pixelytor med.
    gv.graphics["color_black"] = gv.black
    
    # Läs in ljudfiler.
    gv.sounds["theme"] = pygame.mixer.Sound(os.path.join("sound", "theme.wav"))
    gv.sounds["eat"] = pygame.mixer.Sound(os.path.join("sound", "eat.wav"))