Exemplo n.º 1
0
    def __init__(self):
        super().__init__()

        self.winfo_toplevel().title("Calculadora")
        self.resizable(0, 0)
        self.mainFrame = MainFrame(self)
        self.mainFrame.grid(row=0, column=0, padx=10, pady=10, sticky='NSEW')
Exemplo n.º 2
0
    def OnInit(self):
        self.SetAppName(self._application_name)
        self.SetVendorName(self._vendor_name)

        if hasattr(sys, "frozen"):
            directory = os.path.dirname(medipy.__file__)
            os.environ["MEDIPY_PLUGINS_PATH"] = "{0}{1}{2}".format(
                directory, os.pathsep, os.environ.get("MEDIPY_PLUGINS_PATH",
                                                      ""))

        if self.options.ensure_value("menu_file", None) is not None:
            menu = menu_builder.from_file.build_menu(self.options.menu_file)
        else:
            menu = []
            for directory in medipy.__path__[1:]:
                menu.extend(
                    menu_builder.from_api.build_menu(directory, directory))

        self.frame = MainFrame(menu,
                               None,
                               title=self._application_name,
                               size=(1000, 800))
        self.frame.Show()
        self.frame.Bind(wx.EVT_CLOSE, self.OnMainFrameClose)
        self.SetTopWindow(self.frame)

        return True
Exemplo n.º 3
0
def main():
    request = Request()
    client = Client()
    app = MainFrame(client, request)
    while True:
        try:
            app.update()
            header = client.receive_message(HEADER_LENGTH)
            if not len(header):
                print('Connection closed by the server')
                sys.exit()
            msg_length = int(header.decode('utf-8').strip())
            msg = client.receive_message(msg_length).decode('utf-8')
            print("    RESPONSE: " + msg)
            app.make_update(msg)
        except IOError as e:
            if e.errno != errno.EAGAIN and e.errno != errno.EWOULDBLOCK:
                print('Reading error: {}'.format(str(e)))
                sys.exit()
            continue
        except tk.TclError as e:
            print("Bye!")
            sys.exit()
        except Exception as e:
            print('Reading error: '.format(str(e)))
            sys.exit()
 def OnInit(self):
     wx.InitAllImageHandlers()
     mainFrame = MainFrame(None, "")
     self.SetTopWindow(mainFrame)
     mainFrame.Maximize(True)
     mainFrame.Show()
     return 1
Exemplo n.º 5
0
 def update(self, res=None, *args):
     if res is "landing":
         LandingFrame(self, LANDING_SIZE)
     if res is "settings":
         setting_frame = SettingFrame(self, SETTING_SIZE)
         if self.settings is not None:
             setting_frame.load(self.settings)
     elif res is "configs":
         main_frame = MainFrame(self, MAIN_SIZE)
         if self.configs is not None:
             main_frame.load(self.configs)
     elif res is "proceed":
         CreateFrame(self, CREATE_SIZE, self.settings, self.configs)
     else:
         self.root.quit()
Exemplo n.º 6
0
    def __init__(self):
        super().__init__()

        self.winfo_toplevel().title("Registro")
        self.resizable(0, 0)

        self.dataFrame = DataFrame(self, lambda: self.showFrame('register'))
        self.dataFrame.grid(row=0, column=0, sticky='NSEW')

        self.mainFrame = MainFrame(self, lambda: self.showFrame('data'))
        self.mainFrame.grid(row=0, column=0, sticky='NSEW')

        self.frames = dict()
        self.frames['register'] = self.mainFrame
        self.frames['data'] = self.dataFrame
Exemplo n.º 7
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     self.mainFrame = MainFrame(None, -1, "")
     self.SetTopWindow(self.mainFrame)
     self.mainFrame.Show()
     return 1
Exemplo n.º 8
0
# Startup settings
config = configparser.ConfigParser()
config.read('settings.ini')

LANG = config['App settings']['lang']
FPS = int(config['App settings']['fps'])
TRAY_POSITION = config['App settings']['tray_position']

HOTKEY_HELP = config['Hotkey settings']['hotkey_help']
HOTKEY_SCAN = config['Hotkey settings']['hotkey_scan']
HOTKEY_EXIT = config['Hotkey settings']['hotkey_exit']

# Init app
app = App()
main_frame = MainFrame(LANG, FPS)
tray_frame = TrayFrame(TRAY_POSITION, HOTKEY_HELP, HOTKEY_SCAN, HOTKEY_EXIT)

# Turn scan
add_hotkey(HOTKEY_SCAN, lambda: main_frame.turn_thread())
add_hotkey(HOTKEY_SCAN, lambda: tray_frame.turn_active())

# Turn help
add_hotkey(HOTKEY_HELP, lambda: tray_frame.turn_help())

# Debug hotkey for view hash
add_hotkey('F3', lambda: main_frame.note_item())

# Close app
add_hotkey(HOTKEY_EXIT, lambda: main_frame.Close())
add_hotkey(HOTKEY_EXIT, lambda: tray_frame.Close())
Exemplo n.º 9
0
#!/usr/bin/python3

import tkinter
import traceback, sys
from main_frame import MainFrame
from utility import Logger
#from data_store import DataStore
#from configuration import Configuration

if __name__ == "__main__":

    try:
        logger = Logger(__name__, Logger.DEBUG)
        logger.debug(sys._getframe().f_code.co_name)

        top = tkinter.Tk()
        app = MainFrame(top)
        top.wm_title("Shop Timer")

        logger.debug("start main loop")
        top.mainloop()
        logger.debug("end main loop")

    except Exception as e:
        traceback.print_exception(*sys.exc_info())

Exemplo n.º 10
0
#!/usr/bin/env python3

import wx

from main_frame import MainFrame

if __name__ == "__main__":
    app = wx.App(False)
    frame = MainFrame()
    app.MainLoop()
Exemplo n.º 11
0
def main():
    mycompany = company.Company()

    mycompany.set_company_name('Татнефть')
    mycompany.set_ticker('TATN')
    mycompany.set_financials_excel('tatneft.XLSX')

    mycompany.load_financials_from_file()

    mycompany.save_company_to_file('tatneft.json')

    mycompany.load_company_from_file('tatneft.json')
    modelgen = model_generator.ModelGenerator()
    modelgen.set_financials(mycompany.get_financials())

    model = modelgen.build_linear_regression_model('Price')
    years = [i for i in range(2021, 2026)]
    fin = mycompany.get_financials()
    fin = fin.drop(["Price"], axis=1)
    modelgen.predict(model, fin, years)

    # root = Tk()
    # app = MainFrame(root)
    # root.mainloop()


if __name__ == "__main__":
    # execute only if run as a script
    app = MainFrame()
    app.mainloop()
Exemplo n.º 12
0
try:
    import win32gui
    import logging
    import sys
    from utils import tk_utils
    from main_frame import MainFrame

    if win32gui.FindWindow(None, 'MF run counter'):
        resp = tk_utils.mbox(
            msg=
            'It seems like you already have an instance of MF Run Counter open.\n'
            'Opening another instance will make the app unstable (If this is a false positive, just ignore it)\n\n'
            'Do you wish to continue anyway?',
            title='WARNING')
        if not resp:
            sys.exit(0)

    MainFrame()
except Exception as e:
    logging.exception(e)
    raise e
Exemplo n.º 13
0
from wx import App
from main_frame import MainFrame
import keyboard

# Options
hash_lang = 'RU'  # Available choices: 'EN', 'RU'

# App initialization
app = App()
main_frame = MainFrame(hash_lang)

# Listener
keyboard.add_hotkey('F1', lambda: main_frame.prev_item())
keyboard.add_hotkey('F2', lambda: main_frame.next_item())
keyboard.add_hotkey('F3', lambda: main_frame.search_first_no_hash_item())
keyboard.add_hotkey('F4', lambda: main_frame.search_last_no_hash_item())

keyboard.add_hotkey('F5', lambda: keyboard.write(main_frame.item_name()))
keyboard.add_hotkey('F6', lambda: main_frame.set_hash_to_item())
keyboard.add_hotkey('F7', lambda: main_frame.set_no_hash_to_item())
keyboard.add_hotkey('F8', lambda: main_frame.save())

app.MainLoop()
Exemplo n.º 14
0
    def exit_fullscreen(self, event=None):
        self.fullscreen_state = False
        self.attributes("-fullscreen", self.fullscreen_state)


root = Root()

padx = pady = 10

MANIM_DIR = get_manim_directory()

main_frame = MainFrame(
    root,
    text="Manim Rendering GUI",
    add_kwargs=dict(
        padx=padx,
        pady=pady,
        fill=tk.BOTH,
        expand=1,
    ),
)
edit_default_frame = EditDefaultFrame(
    root,
    main_frame,
    text="Manim GUI default configurations",
    add_kwargs=dict(
        padx=padx,
        pady=pady,
        fill=tk.BOTH,
        expand=1,
    ),
)