Ejemplo n.º 1
0
def run():
    '''
    Creates the Presenter and connects it to the config and pico_log models,
    the view interface and the interactor
    '''
    presenter.Presenter(channels.Channels(), view.MeTvFrame(),
                        interactor.Interactor())
Ejemplo n.º 2
0
    def __init__(self, view, data_model, colour_list):
        self.view = view

        self.data_model = data_model

        self.presenter = presenter.Presenter(self.view.getOptionView(), colour_list)
        self.plot_presenter = plot_presenter.PlotPresenter(self.view.getPlotView())
        # connect statements
        self.view.getOptionView().plotSignal.connect(self.updatePlot)
Ejemplo n.º 3
0
    def setUp(self):
        self.view = mock.create_autospec(view.View)

        # mock view
        self.view.doSomethingSignal = mock.Mock()
        self.view.btn_click = mock.Mock()
        self.view.getValue = mock.Mock(return_value=3.14)

        self.presenter = presenter.Presenter(self.view)
Ejemplo n.º 4
0
    def __init__(self, parent=None):
        super(Demo, self).__init__(parent)

        self.window = QtWidgets.QMainWindow()
        my_view = View.View(self)
        self.my_presenter = presenter.Presenter(my_view)
        # set the view for the main window

        self.setCentralWidget(my_view)
        self.setWindowTitle("view tutorial")
Ejemplo n.º 5
0
    def __init__(self, parent=None):
        """Initialize the components of the main window."""
        super(SimpleGui, self).__init__(parent)

        # * I. Define MVP of Login
        self.model = model.Greeting()
        self.view = view.View()
        self.presenter = presenter.Presenter(self.view, self.model)
        
        self.view.show()
Ejemplo n.º 6
0
def main():

    myappid = u'mrozowski.tictactoe.1.0'
    ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
    """Creating MVP"""
    _view = view.View()
    _presenter = presenter.Presenter(_view)
    _view.set_presenter(_presenter)

    _presenter.show()
Ejemplo n.º 7
0
def main():
    """These 2 lines make my custom icon appears also on the task bar. I set this icon in presenter file in show()"""
    myappid = u'mrozowski.tasktimer.1.0'
    ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
    """Creating MVP"""
    _view = view.View()
    _presenter = presenter.Presenter(_view)
    _view.set_presenter(_presenter)

    _presenter.show()
Ejemplo n.º 8
0
    def setUp(self):
        self.view = mock.create_autospec(view.View)

        # mock view
        self.view.plotSignal = mock.Mock()
        self.view.getColour = mock.Mock(return_value="black")
        self.view.getGridLines = mock.Mock(return_value=True)
        self.view.getFreq = mock.Mock(return_value=3.14)
        self.view.getPhase = mock.Mock(return_value=0.56)
        self.view.buttonPressed = mock.Mock()
        self.view.setTableRow = mock.Mock()
        self.view.addWidgetToTable = mock.Mock()
        self.view.addITemToTable = mock.Mock()

        self.presenter = presenter.Presenter(self.view)
Ejemplo n.º 9
0
    pandasLib = False
    #If pandas activated
    if arguments['--pandas']:
        #we set the variable to True
        pandasLib = True

    #Finally we instantiate our object Model using the defined or not filename
    try:
        with open(choosenFile) as _:
            pass
    except Exception:
        print("The specified file or default file: %s cannot be opened" %
              choosenFile)
        sys.exit(-1)
    model = mdl.Model(choosenFile, pandasLib)

    #If the script was launched using arguments we do not start the GUI and only use the Model object
    if arguments['<doc_uuid>'] and arguments['<user_uuid>'] and arguments[
            '<task_id>']:
        model.extractData(arguments['<doc_uuid>'], arguments['<user_uuid>'],
                          int(arguments['<task_id>']))
        model.draw()
    #Otherwise, no arguments given, we use the GUI
    else:
        #We create the two missing parts of the MVP to get the GUI
        app = vw.View(None)
        app.title('Coursework 2 - Data Analysis of a Document Tracker')
        cont = pstr.Presenter(model, app)
        #We call the infinite loop to display the GUI and use it
        app.mainloop()
Ejemplo n.º 10
0
    dataBaseFile.close()
else:
    cinemas_columns = ("id", "name", "address")
    cinemas_columns_types = (int, str, str)
    cinemas_table = {
        "COLUMNS": cinemas_columns,
        "COLUMNS_TYPES": cinemas_columns_types,
        "CONTENT": list()
    }
    sessions_columns = ("id", "name", "time", "cinema_id")
    sessions_columns_types = (int, str, Time, int)
    sessions_table = {
        "COLUMNS": sessions_columns,
        "COLUMNS_TYPES": sessions_columns_types,
        "CONTENT": list()
    }
    dataBase = {"cinemas": cinemas_table, "sessions": sessions_table}

presenter = presenter.Presenter()
presenter.model = dataBase

app = application.Application()

app.presenter = presenter

app.run()

dataBaseFile = open(FILE_NAME, 'wb')
pickle.dump(dataBase, dataBaseFile)
dataBaseFile.close()
Ejemplo n.º 11
0
import use_cases
import presenter

if __name__ == "__main__":
    view = presenter.ConsoleView()
    presenter = presenter.Presenter(view=view)
    random_gen = use_cases.RandomGenerator()
    play_simon = use_cases.Play(i_presenter=presenter,
                                i_number_generator=random_gen)
    play_simon.run()