Exemple #1
0
def main():
    print("This program comes with ABSOLUTELY NO WARRANTY")
    print(
        "This is free software, and you are welcome to redistribute it under the terms of the GNU GPL:"
    )
    print("    https://www.gnu.org/licenses/gpl-3.0.en.html")

    app = App()
    while True:
        try:
            app.mainloop()
            break
        except UnicodeDecodeError:
            pass
Exemple #2
0
def main():
    if len(argv) < 3:
        ErrorMessage.print("insufficient arguments given, requires input and"
                           "output file names")
        return

    form_file = argv[1]
    dump_file = argv[2]

    if not isfile(form_file):
        ErrorMessage.print("file {} does not exist".format(form_file))
        return

    form = parse_ql(form_file)

    symboltable = {}
    check_form(form, symboltable)

    layout_file = qls_filename(form_file)
    if isfile(layout_file):
        layout = parse_qls(layout_file)
        check_layout(layout, symboltable)
    else:
        layout = None
        WarningMessage.print("qls filename \"{}\" does not "
                             "exist".format(layout_file))

    App(form,
        layout=layout,
        on_exit=lambda app: export(dump_file, app.environment)).start()
Exemple #3
0
def run():
	urllib3.disable_warnings()

	print(r'                        ,;:;;,')
	print(r'                       ;;;;;')
	print(r'               .=\',    ;:;;:,')
	print(r'              /_\', "=. \';:;:;')
	print(r'              @=:__,  \,;:;:\'')
	print(r'                _(\.=  ;:;;\'')
	print(r'               `"_(  _/="`')
	print(r'                `"\'')

	nut.initTitles()
	nut.initFiles()

	app = QApplication(sys.argv)
	app.setWindowIcon(QIcon('images/logo.jpg'))
	ex = App()

	threads = []
	threads.append(threading.Thread(target=initThread, args=[ex]))
	threads.append(threading.Thread(target=usbThread, args=[]))
	threads.append(threading.Thread(target=nutThread, args=[]))

	for t in threads:
		t.start()

	sys.exit(app.exec_())

	print('fin')
Exemple #4
0
    def setUp(self):
        self.app = QApplication(sys.argv)
        self.form = App()
        logger = logging.getLogger()
        logger.level = logging.DEBUG

        self.paths_before_test = Config.paths.scan
        self.threads_before_test = Config.threads
        self.compression_level_before_test = Config.compression.level
        self.users_before_test = Users.users
Exemple #5
0
def execute() -> int:
    # https://www.reddit.com/r/learnpython/comments/4kjie3/how_to_include_gui_images_with_pyinstaller/d3gjmom
    def resource_path(relative_path: str) -> str:
        if hasattr(sys, '_MEIPASS'):
            return os.path.join(getattr(sys, '_MEIPASS'), relative_path)
        return os.path.join(os.path.abspath('.'), relative_path)

    application: QApplication = QApplication(sys.argv)

    languages: Set[str] = set(
        QLocale().uiLanguages() +
        [QLocale().bcp47Name(), QLocale().name()])
    language: str
    qt_translator: QTranslator = QTranslator()
    for language in languages:
        if qt_translator.load(
                'qt_' + language,
                QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath)):
            application.installTranslator(qt_translator)
            break
    qtbase_translator: QTranslator = QTranslator()
    for language in languages:
        if qtbase_translator.load(
                'qtbase_' + language,
                QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath)):
            application.installTranslator(qtbase_translator)
            break
    my_translator: QTranslator = QTranslator()
    if my_translator.load(QLocale.system().name(),
                          resource_path('translations')):
        application.installTranslator(my_translator)

    import re
    from pyqtgraph import functions as fn

    fn.SI_PREFIXES = QApplication.translate(
        'si prefixes', 'y,z,a,f,p,n,µ,m, ,k,M,G,T,P,E,Z,Y').split(',')
    fn.SI_PREFIXES_ASCII = fn.SI_PREFIXES
    fn.SI_PREFIX_EXPONENTS.update(
        dict([(s, (i - 8) * 3) for i, s in enumerate(fn.SI_PREFIXES)]))
    if QApplication.translate('si prefix alternative micro', 'u'):
        fn.SI_PREFIX_EXPONENTS[QApplication.translate(
            'si prefix alternative micro', 'u')] = -6
    fn.FLOAT_REGEX = re.compile(
        r'(?P<number>[+-]?((((\d+(\.\d*)?)|(\d*\.\d+))([eE][+-]?\d+)?)'
        r'|(nan|NaN|NAN|inf|Inf|INF)))\s*'
        r'((?P<siPrefix>[u(' + '|'.join(fn.SI_PREFIXES) +
        r')]?)(?P<suffix>\w.*))?$')
    fn.INT_REGEX = re.compile(r'(?P<number>[+-]?\d+)\s*'
                              r'(?P<siPrefix>[u(' + '|'.join(fn.SI_PREFIXES) +
                              r')]?)(?P<suffix>.*)$')

    window: App = App()
    window.show()
    return application.exec()
Exemple #6
0
def main():
    # Queue used for cross-thread communication. Only put (key, value) tuples in there.
    app_queue = queue.PriorityQueue()

    # Read user settings
    read_user_config()

    # Set the current host IP
    Config.HOST = get_current_ip_address()

    # Init Server
    server = Server(queue=app_queue)

    # Start server in different thread
    x = threading.Thread(target=server.start, args=(), daemon=True)
    x.start()

    # Start server discovery via UDP socket in different thread
    udp_t = threading.Thread(target=discovery.start, args=(), daemon=True)
    udp_t.start()

    # Start the GUI
    app = App(queue=app_queue)
    app.main_loop()
    def __init__(self, parent):

        self.main_tile = None
        self.note_tile = None

        self.gui = None
        self.pcf8563 = None
        self.log = logging.getLogger("mainbar")
        self.log.setLevel(logging.DEBUG)

        self.mainbar_style = lv.style_t()
        self.mainbar_style.init()
        self.mainbar_style.set_radius(lv.obj.PART.MAIN, 0)
        self.mainbar_style.set_bg_color(lv.obj.PART.MAIN, lv_colors.GRAY)
        self.mainbar_style.set_bg_opa(lv.obj.PART.MAIN, lv.OPA._0)

        self.mainbar_style.set_border_width(lv.obj.PART.MAIN, 0)
        self.mainbar_style.set_text_color(lv.obj.PART.MAIN, lv_colors.WHITE)
        self.mainbar_style.set_image_recolor(lv.obj.PART.MAIN, lv_colors.WHITE)

        self.mainbar_switch_style = lv.style_t()
        self.mainbar_switch_style.init()
        self.mainbar_switch_style.set_bg_color(lv.STATE.CHECKED,
                                               lv_colors.GREEN)

        self.mainbar_slider_style = lv.style_t()
        self.mainbar_slider_style.init()
        self.mainbar_slider_style.set_bg_color(lv.STATE.DEFAULT,
                                               lv_colors.GREEN)

        self.mainbar_button_style = lv.style_t()
        self.mainbar_button_style.init()
        self.mainbar_button_style.set_radius(lv.STATE.DEFAULT, 3)
        self.mainbar_button_style.set_border_color(lv.STATE.DEFAULT,
                                                   lv_colors.WHITE)
        self.mainbar_button_style.set_border_opa(lv.STATE.DEFAULT, lv.OPA._70)
        self.mainbar_button_style.set_border_width(lv.STATE.DEFAULT, 2)

        self.mainbar = lv.tileview(parent, None)
        self.mainbar.set_edge_flash(False)
        self.mainbar.add_style(lv.obj.PART.MAIN, self.mainbar_style)
        lv.page.set_scrollbar_mode(lv.page.__cast__(self.mainbar),
                                   lv.SCROLLBAR_MODE.OFF)

        self.exit_icon_dsc = self.get_image_dsc('exit_32px')
        self.setup_icon_dsc = self.get_image_dsc('setup_32px')
        self.app = App(self)
import tkinter as tk

from gui.app import App

main = App(tk.Tk())
main.mainloop()
Exemple #9
0
def start_merkatos(entered_password):
    if platform.system().lower() == "darwin":

        def mainloop():
            while True:
                try:
                    root.update_idletasks()
                    root.update()
                    time.sleep(1)
                except UnicodeDecodeError:
                    print("Caught Scroll Error")

    else:

        def mainloop():
            while True:
                try:
                    root.update_idletasks()
                    root.update()
                except UnicodeDecodeError:
                    print("Caught Scroll Error")

    parser = argparse.ArgumentParser()
    parser.add_argument('-b',
                        '--blockOnError',
                        action='store_true',
                        help="DEBUGGING ONLY: blocks all bots on error")
    parser.add_argument('-p',
                        '--password',
                        default="",
                        help="password for decrypting db")
    parser.add_argument(
        '-d',
        '--delay',
        type=int,
        default=10000,
        help="delay in milliseconds between bot updates. Default 10000.")

    args = parser.parse_args()
    if not args.password:
        password = entered_password
    else:
        password = args.password

    root = tk.Tk()

    root.title("merkato (pre-release)")
    mystyle = ttk.Style()
    mystyle.theme_use('clam')  # ('clam', 'alt', 'default', 'classic')
    mystyle.configure("app.TLabel",
                      foreground="white",
                      background="black",
                      font=('Liberation Mono', '10', 'normal'))  # "#4C4C4C")
    mystyle.configure("unlocked.TLabel",
                      foreground="light green",
                      background="black",
                      font=('Liberation Mono', '12', 'normal'))  # "#4C4C4C")
    mystyle.configure("smaller.TLabel",
                      foreground="white",
                      background="black",
                      font=('Liberation Mono', '10', 'normal'))  # "#4C4C4C")
    mystyle.configure("heading.TLabel",
                      foreground="white",
                      background="black",
                      font=('Liberation Mono', '36', 'normal'))  # "#4C4C4C")
    mystyle.configure("app.TFrame", foreground="gray55",
                      background="black")  # "#4C4C4C",)
    mystyle.configure("app.TButton",
                      foreground="gray55",
                      background="#D15101",
                      activeforeground="#F2681C")  # F2681C
    mystyle.configure("app.TCheckbutton",
                      foreground="gray55",
                      background="black")  # "#4C4C4C")
    mystyle.configure("app.TCombobox",
                      background="#F2681C",
                      selectbackground="#D15101")  # postoffset = (0,0,500,0))
    mystyle.configure("app.TEntry", foreground="black", background="gray55")
    mystyle.configure("pass.TEntry",
                      foreground="gray55",
                      background="gray55",
                      insertofftime=5000)
    root.option_add("*TCombobox*Listbox*selectBackground", "#D15101")

    # ------------------------------
    if db.no_merkatos_table_exists():
        db.create_merkatos_table()

    if db.no_exchanges_table_exists():
        db.create_exchanges_table()

    test = konfig.encrypt_keys(
        dict(exchange="test",
             public_api_key='abc',
             private_api_key='123',
             limit_only=True), password)
    db.insert_exchange(**test)
    merkatos = db.get_all_merkatos()
    complete_merkato_configs = generate_complete_merkato_configs(merkatos)

    # ------------------------------
    app = App(master=root,
              block_on_error=args.blockOnError,
              password=password,
              delay=args.delay,
              side=tk.RIGHT)

    for persisted in complete_merkato_configs:
        # pprint(persisted)
        konfig.decrypt_keys(config=persisted['configuration'],
                            password=password)
        bot = Bot(root, app(), app, persist=persisted)
        app.add_screen(bot,
                       "null",
                       textvariable=bot.title_var,
                       bg="gray75",
                       fg="black",
                       selectcolor="lightblue")

    for i in range(1):
        bot = Bot(
            root,
            app(),
            app,
        )
        app.add_screen(bot,
                       "null",
                       textvariable=bot.title_var,
                       bg="gray75",
                       fg="black",
                       selectcolor="lightblue")

    root.after(1000, lambda: app.update_frames(initialize=True))
    root.after(100, app.finish_new_button())

    mainloop()
Exemple #10
0
def main():
    root = tk.Tk()
    app = App(root)
    root.title('Calculator')
    # root.iconbitmap('calculator.ico')
    root.mainloop()
def main():
    """Creates and runs the torrent client app"""

    app = App()
    app.mainloop()
Exemple #12
0
from gui.app import App
import os
import json

import logging

# Logging
logger = logging.getLogger("kburns-slideshow")
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(
    os.path.dirname(os.path.realpath(__file__)) + '/kburns-slideshow-gui.log')
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s | %(levelname)s | %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)

if __name__ == "__main__":
    app = App("kbvs")
    app.mainloop()
def main():
    # var for the loop while
    run = True
    # instance database "import file database.py"
    db = database.database
    # methode drop_db() => drop of the database
    db.drop_db()
    # methode create_db() => creation of the database
    db.create_db()
    # var for stoked the number of the limite
    # and size of the products per categories
    nb = 0
    # loop for each categories used for iterating over a sequence "dictionnary"
    for row in categories:
        # methode for insert to the db, the datas from api
        data_from_api = Api(categories[row]).get_data_api()
        nb += data_from_api
        size.append(data_from_api)
        length.append(nb)
    # instance class App
    app = App()
    # loop for run the app
    while run:
        # a loop, hes creats a list with all categories
        for row in categories:
            print(row, categories[row])
        # a loop, if choice is not between 1 and 6
        nb_not_allowed = True
        while nb_not_allowed:
            # if you press another number or letter
            try:
                choice_caterogie = int(
                    input("Enter a number between 1 and 6: "))
                choice_categories = categories[choice_caterogie]
                nb_not_allowed = False

            except KeyError:
                print("please enter a between 1 and 6, ", end='')
                print("you introduced a wrong number")
                pass

            except ValueError:
                print("please enter a number between 1 and 6")

        for row in categories:
            # condiction for enter in the category
            if choice_categories == categories[row]:
                app.display_choice_of_products(
                                                row,
                                                length[row-1],
                                                length[row],
                                                size[row-1]
                                            )
        # condition for exit or continue
        if app.run_app is False:

            # if you want quit or if you want choice anather category
            stc_one = "[Q/AC] If you want quit type Q, "
            stc_two = "or if you want choice another category type AC "
            choice_for_exit_or_choice = input("{}{}".format(stc_one, stc_two))
            if choice_for_exit_or_choice == "Q":
                run = False

            if choice_for_exit_or_choice == "AC":
                app.re_init()
Exemple #14
0
 def setUp(self):
     self.app = QApplication(sys.argv)
     self.form = App()
Exemple #15
0
import pygame
import crayons

if __name__ == '__main__':

    pygame.font.init()

    pygame.init()

    print(crayons.green('Initialized PyGame'))

    from gui.app import App

    app = App()

    app.start()
Exemple #16
0
from tkinter import *
from gui.app import App

if __name__ == '__main__':
    root = Tk()
    root.geometry("500x600")
    gui_app = App(root)
    root.mainloop()
def main():
    root = Tk()
    app = App(parent=root)
    root.mainloop()
import wx

from gui.app import App
from gui.main_frame import MainFrame

if __name__ == '__main__':
    app = App()
    frame = MainFrame(None, wx.ID_ANY, "Hello World!")
    app.SetTopWindow(frame)
    frame.Show()
    app.MainLoop()
Exemple #19
0
import sys
from PyQt5.QtWidgets import QApplication
from gui.app import App

if __name__ == '__main__':
    app = QApplication(sys.argv)
    widget = App()
    sys.exit(app.exec_())
Exemple #20
0
def main():
    app = App(tk.Tk(), "CCTV Analyser")
Exemple #21
0
import sys
import logging as log

from gui.app import App

if __name__ == "__main__":
    log.basicConfig(filename="log/dev.txt", level=log.DEBUG)
    app = App()
    app.mainloop()