示例#1
0
    def test_remove_empty_player(self):

        app = App()
        response = app.remove_player(None)

        self.assertFalse(response.ok)
        self.assertEqual('The player name can\'t be empty.', response.message)
示例#2
0
def main():
    # Initialize the app and the shell using the configuration data
    app = App(cache_folder=CACHE_FOLDER, database_folder=DATABASE_FOLDER)
    # Create all the necessary folders
    app.cache.init()
    # Initialize the shell and run it with the given arguments
    load_shell(app=app, style=style).run(argv)
示例#3
0
    def test_remove_nonexistent_player(self):

        app = App()
        reponse = app.remove_player('Rafael')

        self.assertFalse(reponse.ok)
        self.assertEqual('Rafael not in the list', reponse.message)
示例#4
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--model",
                        default="assets/models/cnn_113_80_quantized.tflite")
    parser.add_argument("--checkpoint", action="store_true")
    parser.add_argument("--large", action="store_true")
    args = parser.parse_args()

    from load_model import load_any_model_filepath
    model, (HEIGHT, WIDTH) = load_any_model_filepath(args.model,
                                                     not args.checkpoint,
                                                     args.large)

    # screen box is (x, y, width, height)
    bounding_box = (677, 289, 322, 455)
    app = App()
    app.bounding_box = bounding_box

    callback = ImageCallback(*bounding_box[2:4])
    app.image_callback = callback.on_image

    screenshotter = MSSScreenshot()
    # screenshotter = D3DScreenshot()

    predictor = Predictor(model, (HEIGHT, WIDTH))
    predictor.acceleration = 2.5

    def on_press(key):
        if key == Key.f1:
            print("[Resumed]")
            app.is_paused = False
        elif key == Key.f2:
            print("[Paused]")
            app.is_paused = True
        elif key == Key.f3:
            print("[Exit]")
            app.stop()
            # callback.stop_threads()
        elif key == Key.f4:
            callback.is_preview = not callback.is_preview
            print(f"[Preview={callback.is_preview}]")
        elif key == Key.f5:
            app.show_debug = not app.show_debug
            print("[Debug={0}]".format(app.show_debug))
        elif key == Key.f6:
            app.track_only = not app.track_only
            print("[Track={0}]".format(app.track_only))
        elif key == Key.f7:
            callback.is_recording = not callback.is_recording
            print(f"[Recording={callback.is_recording}]")

    input_listener = Listener(on_press=on_press)
    input_listener.start()
    display_controls()

    callback.start_threads()
    app.start(predictor, screenshotter)
    input_listener.stop()
    callback.stop_threads()
示例#5
0
def main():
    attach_logger_to_stdout()
    if _download_necessary_files() == False:
        return
    q_app = QtWidgets.QApplication(sys.argv)
    app = App()
    app.display_main_menu()
    sys.exit(q_app.exec())
示例#6
0
    def test_remove_player_successfully(self):

        app = App()
        reponse = app.add_player('Rafael')
        response = app.remove_player('Rafael')

        self.assertTrue(reponse.ok)
        self.assertEqual('Rafael was succesfully removed.', response.message)
示例#7
0
    def test_add_player_succesfully(self):
        app = App()
        reponse = app.add_player('Rafael')

        self.assertTrue(reponse.ok)
        self.assertEqual('Rafael successfully added.', reponse.message)

        self.assertTrue('Rafael' in app.players)
示例#8
0
    def test_add_player_duplicated(self):
        app = App()
        
        app.add_player('Rafael')
        reponse = app.add_player('Rafael')

        self.assertFalse(reponse.ok)
        self.assertEqual(
            'Rafael already in the players list.', reponse.message)
示例#9
0
    def run(self):
        running = True

        while running:
            app = App(self.args)
            app.init(self.ai_controllers)
            self.ai_controllers = app.ai_controllers
            should_exit = app.run()
            running = not should_exit
示例#10
0
    def test_list_three_players(self):
        app = App()

        app.add_player('Rafael')
        app.add_player('Simão')
        app.add_player('Rodrigo')

        response = app.list_players()

        self.assertTrue(response.ok)
        self.assertEqual(3, len(response.data['players']))
示例#11
0
def main():
	
	# First we created a application object for pyqt
	app = QApplication(sys.argv)

	# Then we apply Flatipie style sheet and modern window style for creating modern-looking interfaces.
	# Please note that this is important for creating flatipie style app.
	apply_palette(app)
	window = ModernWindow(App())

	# Next is we show the window then execute the app.
	window.show()
	sys.exit(app.exec_())
示例#12
0
def main() -> int:
    start = now()
    parser = argparse.ArgumentParser(description='Display subtitles from file')
    parser.add_argument('file', type=str, help='file path')

    options = parser.parse_args()
    subs = Subs(options.file)
    try:
        subs.process()
    except SubsFileNotFound:
        return 1

    app = App(start, subs)
    return app.run()
示例#13
0
def app(browser):
    yield App(browser)
示例#14
0
    """

    if app.args.show == "true":
        print("\r Trying %s..." % password, end="")

    return True if validator.main(password,
                                  app.args.command) == app.args.code else False


# Configurações do App.
description = "|Brute Force| by Jean Loui Bernard Silva de Jesus"
data_dir = "data"
key_to_stop = "q"

# Cria uma instância de App e obtém os argumentos passados na linha de comando.
app = App(try_password, err_callback, data_dir, description, key_to_stop)

# Mostra as informações que o usuário passou como argumento.
print("\n INFO:")
print(" -----------------------------------")
print(" Command:", app.args.command)
print(" Expected Exit Code:", app.args.code)
print(" Show:", app.args.show)
print(" Length:", app.args.min, "-", app.args.max)
print(" -----------------------------------")

print('\n Press "q" to finish.')

if app.args.show != "true": print(" Running...")

try:
def main():
    app = App()
    app.run()
示例#16
0
def run():
  e = Engine(WIDTH, HEIGHT)
  app = App(WIDTH, HEIGHT, 'Test Engine', 30, e)
  app.run()
示例#17
0
def open_application(context):
    context.app = App()
示例#18
0
from src.app import App

if __name__ == "__main__":
    main_app_window = App(900, 684)
    main_app_window()
示例#19
0
from src.app import App

import sys

App().start()
示例#20
0
def main():
    app = App()
    app.run(creative_mode=False)
示例#21
0
from src.app import App
import sys

if __name__ == "__main__" and "win" in sys.platform:
    App().run()
示例#22
0
from src.app import App
import pygame

if __name__ == '__main__':
    pygame.init()
    pygame.font.init()

    info_obj = pygame.display.Info()
    size = (info_obj.current_w, info_obj.current_h)
    screen = pygame.display.set_mode(size, pygame.FULLSCREEN)

    app = App(60, size, screen)
    app.run()
示例#23
0
from src.app import App

if __name__ == '__main__':
    App()

示例#24
0
import json

from bson import ObjectId
from flask import request
from flask_cors import CORS
from werkzeug.exceptions import abort

from src.app import App

# app = Flask(__name__)
# CORS(app)

app = App()
CORS(app.flask)


# run the application that does database manipulation
def route():
    return app.flask


@app.flask.route("/api/v1/company", methods=["POST"])
def create_company():
    if not request.json or 'name' not in request.json:
        abort(400)
    # company = Company(**request.json)
    # print(company)
    # company = {
    #     'type': request.json['type'],
    #     'name': request.json['name'],
    #     'address': request.json['address'],
 def test_run(self):
     result = None
     self.assertEqual(App().run(), result)
示例#26
0
def test_answer():
    assert App().hello_world() == "Hello World!!!!!"
示例#27
0
""" 
@package main
@author andresgonzalezfornell

Main module to run the application.
"""

from lib.appJar.appjar import gui
from src.app import App

gui = gui()
gui.setImageLocation("res")
gui.setIcon("airplane.gif")
app = App(gui)
示例#28
0
from src.app import App

print(App().hello_world())
示例#29
0
    def init_app(self):
        app = App()
        app.do_routine()

        if env.HAS_ROUTINE:
            app.start_routine()
示例#30
0
def main() -> None:
    app = QApplication([])
    window = App()
    window.show()
    app.exec_()