Пример #1
0
 def __init__(self):
     self.tk = Tk()
     self.tk.configure(background='black')
     self.topFrame = Frame(self.tk, background='black')
     self.bottomFrame = Frame(self.tk, background='black')
     self.topFrame.pack(side=TOP, fill=BOTH, expand=YES)
     self.bottomFrame.pack(side=BOTTOM, fill=BOTH, expand=YES)
     self.state = False
     self.tk.bind("<Return>", self.fullscreen)
     self.tk.bind("<Escape>", self.finishFullscreen)
     self.splash = splash.Splash(
         self.topFrame, 'JVacations Facial Recognition Smart Mirror', 48)
     self.splash.pack(side=TOP, anchor=CENTER, padx=100, pady=60)
     self.cam = cam.Cam(self.topFrame, enableCameraPreview)
     self.cam.pack(anchor=CENTER, padx=100, pady=60)
     self.instructions1 = splash.Splash(
         self.bottomFrame, "To add or edit users visit: " +
         socket.gethostbyname(socket.gethostname()) + ":3000", 28)
     self.instructions1.pack(side=BOTTOM, anchor=N, padx=100, pady=20)
     self.instructions2 = splash.Splash(
         self.bottomFrame,
         "Stand in front of the mirror until the mirror recognises you and loads your settings.",
         28)
     self.instructions2.pack(side=BOTTOM, anchor=N, padx=100, pady=20)
     self.getUserName()
     thread1.start()
Пример #2
0
 def checkStillViewing(self):
     if self.cam.readUserName() == "No User Detected":
         print("NO USER")
         #self.showuser.pack_forget()
         for widget in self.topFrame.winfo_children():
             widget.destroy()
         for widget in self.bottomFrame.winfo_children():
             widget.destroy()
         self.splash = splash.Splash(
             self.topFrame, 'JVacations Facial Recognition Smart Mirror',
             48)
         self.splash.pack(side=TOP, anchor=CENTER, padx=100, pady=60)
         self.cam = cam.Cam(self.topFrame, enableCameraPreview)
         self.cam.pack(anchor=CENTER, padx=100, pady=60)
         self.instructions1 = splash.Splash(
             self.bottomFrame, "To add or edit users visit: " +
             socket.gethostbyname(socket.gethostname()) + ":3000", 28)
         self.instructions1.pack(side=BOTTOM, anchor=N, padx=100, pady=20)
         self.instructions2 = splash.Splash(
             self.bottomFrame,
             "Stand in front of the mirror until the mirror recognises you and loads your settings.",
             28)
         self.instructions2.pack(side=BOTTOM, anchor=N, padx=100, pady=20)
         self.getUserName()
     else:
         self.tk.after(10000, self.checkStillViewing)
Пример #3
0
 def start_game(self):
     school_player1 = self.schools_scores.keys()[
         self.players_selection[0][0] * 5 + self.players_selection[0][1]]
     school_player2 = self.schools_scores.keys()[
         self.players_selection[1][0] * 5 + self.players_selection[1][1]]
     self.game.players[0].university = school_player1
     self.game.players[1].university = school_player2
     self.game.state = splash.Splash(self.game)
Пример #4
0
    def game_done(self):
        results = self.minigame.get_results()
        for player, result in zip(self.game.players, results):
            if not result:
                player.lives -= 1
        self.game.state = splash.Splash(self.game)

        if self.game.minigame.is_singleplayer():
            if self.game.second_turn:
                self.game.difficulty += 1
                self.game.choose_minigame()
            self.game.active_player = 1 - self.game.active_player
            self.game.second_turn = not self.game.second_turn
        else:
            self.game.difficulty += 1
            self.game.choose_minigame()
Пример #5
0
import sys
import pygame as pg

from state_engine import Game, GameState
import prepare
import splash, shooting, high_score_screen

states = {"SPLASH": splash.Splash(),
               "SHOOTING": shooting.Shooting(),
               "HIGHSCORES": high_score_screen.HighScores()}
game = Game(prepare.SCREEN, states, "SPLASH")
game.run()
pg.quit()
sys.exit()
Пример #6
0
    def start_game(self):
        for i, player in enumerate(self.game.players):
            player.university = self.schools[self.selections[i]]

        self.game.state = splash.Splash(self.game)
    r"^((?:mzspec|mzdraft):GNPSTASK-[a-z0-9]{32}:.+:scan:\d+)|"
    # Legacy GNPS library.
    r"((?:mzspec|mzdraft):GNPSLIBRARY:CCMSLIB\d+)|"
    # Legacy MassBank.
    r"((?:mzspec|mzdraft):MASSBANK:[^:]+)|"
    # Legacy MotifDB.
    r"((?:mzspec|mzdraft):MOTIFDB:motif:[^:]+)|"
    # Legacy MS2LDA.
    r"((?:mzspec|mzdraft):MS2LDATASK-[^:]+:document:[^:]+)$",
    flags=re.IGNORECASE,
)
gnps_task_pattern = re.compile(r"^TASK-([a-z0-9]{32})-(.+)$",
                               flags=re.IGNORECASE)
ms2lda_task_pattern = re.compile(r"^TASK-(\d+)$", flags=re.IGNORECASE)

splash_builder = splash.Splash()


def parse_usi(usi: str) -> Tuple[sus.MsmsSpectrum, str, str]:
    """
    Retrieve the spectrum associated with the given USI.

    Parameters
    ----------
    usi : str
        The USI of the spectrum to be retrieved from its resource.

    Returns
    -------
    Tuple[sus.MsmsSpectrum, str, str]
        A tuple of the `MsmsSpectrum`, its source link, and its SPLASH.
Пример #8
0
import sys
import pygame as pg

from state_engine import Game, GameState
import prepare
import splash, gameplay

states = {"SPLASH": splash.Splash(), "GAMEPLAY": gameplay.Gameplay()}
game = Game(prepare.SCREEN, states, "SPLASH")
game.run()
pg.quit()
sys.exit()
Пример #9
0
import sys
import pygame as pg

from state_engine import Game
import prepare
import splash, carving

states = {"SPLASH": splash.Splash(), "CARVING": carving.Carving()}

game = Game(prepare.SCREEN, states, "SPLASH")
game.run()
pg.quit()
sys.exit()
Пример #10
0
import sys
import json

init()

devMode = ('DEV' in os.environ) if True else False

commandConfig = command.config.Config('config.json')

disk = commandConfig.get_disk()
lang = commandConfig.get_lang()
config = commandConfig.get_config()

version = commandConfig.get_version()

spl = splash.Splash()
if not devMode:
    spl.header_screen_writer()

# Load modules
modules = []
loadModulesList = [
    f for f in os.listdir('./commands') if re.match(r'[^_].*\.py', f)
]
loadModulesStep = 100 / len(loadModulesList)
loadProgress = 0

cmd = ''
for i in loadModulesList:
    try:
        className = i[:-3]