示例#1
0
 def get_positions(self):
     view = View()
     positions = Position.select_many_where("WHERE accounts_pk = ?",
                                            (self.pk, ))
     for position in positions:
         view.positions(self, position)
     return positions
示例#2
0
    def __init__(self):
        self._app = QtWidgets.QApplication(sys.argv)
        self._model = Model()
        self._view = View()

        self.add_thread = AddThread()
        self.timer_thread = TimerThread()
        self.init()
示例#3
0
    def __init__(self, loop):
        self.__loop = loop
        self.__dao = None

        self.__updater = Updater(
            config.telegram.token,
            defaults=Defaults(parse_mode=ParseMode.MARKDOWN))
        self.__view = View(self.__updater, self.__handler)

        self.__modal = Modal(config.meross, config.solaredge, config.sun)
        self.__loop.run_until_complete(self.__modal.async_init())
示例#4
0
    def __init__(self):
        self.__root = Tk()
        self.__root.protocol('WM_DELETE_WINDOW', self._on_closing_window)

        self.__view = View(self.__root)
        self.__view.filepath_button.config(
            command=lambda: self._get_directory(self.__view.string))
        self.__view.paste_button.config(
            command=lambda: self._paste(self.__view.url_entry))
        self.__view.download_button.config(command=self._start)

        # Variables
        self.__thread = None

        threading.Thread(target=self._check_update).start()
        self.__root.mainloop()
from app.account import Account
from app.view import View
from app.util import get_price
from app.util import top_traded
import time

view = View()


def run():
    welcome_homepage()


def welcome_homepage():
    while True:
        selection = view.welcome_screen()
        if selection not in ['1', '2', '3']:
            view.improper_selection()
            continue

        if selection == '1':
            username, balance, password, confirm_password = view.get_username(
            ), view.add_balance(), view.get_password(), view.confirm_password(
            )

            if password != confirm_password:
                view.improper_password()
                continue
            if not balance.isdigit() or int(balance) < 0:
                view.improper_balance()
                continue
示例#6
0
            current = DefaultInteract()
            if view.interaction is not None and view.interaction.open():
                current = view.interaction
            else:
                time.sleep(2)


if __name__ == "__main__":

    DefaultInteract.SIMULATION = False

    device = Device(data.actuators_8())

    # Initialising view with networks, interactions and mouse tracking
    view = View(device,
                networks=data.all_networks(),
                interacts=data.all_interactions(),
                mouse_tracking=False,
                default_network='default',
                default_interact='default')

    # Setting tracking and interacting threadq
    tracker_thrd = threading.Thread(target=tracker, args=(device, ))
    interaction_thrd = threading.Thread(target=interact, args=(view, ))

    # Starting threads
    tracker_thrd.start()
    interaction_thrd.start()

    view.loop()  # runs the view, forever
示例#7
0
 def __init__(self):
     self.model = Model()
     self.view = View()
示例#8
0
 def __init__(self):
     self.views = View(cherrypy.Application.currentDir)
示例#9
0
 def __init__(self):
     self._app = QtWidgets.QApplication(sys.argv)
     # self._model = Model()
     self._view = View()