Exemplo n.º 1
0
class BootStrapperWidget(QWidget):
    def __init__(self, parent, suite, name='RunnerWidget'):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        cfg = self.app.umlcfg
        basefile = make_base_filesystem(suite,
                                        '%s.base' % suite,
                                        cfg=cfg,
                                        size=300,
                                        mkfs='mke2fs')
        self.bootstrapper = UmlBootstrapper(suite, basefile, cfg=self.cfg)
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText('Bootstrapping suite %s' % suite)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)

    def update_progress(self):
        #retval = self.proc.poll()
        #print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Exemplo n.º 2
0
class RunnerWidget(QWidget):
    def __init__(self, parent, umlmachines, name='RunnerWidget'):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.umlmachines = umlmachines
        self.proc = self.umlmachines.run_machine()
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText('Running Umlmachine %s' %
                               self.umlmachines.current)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)

    def update_progress(self):
        #retval = self.proc.poll()
        #print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Exemplo n.º 3
0
class RunnerWidget(QWidget):
    def __init__(self, parent, umlmachines, name='RunnerWidget'):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.umlmachines = umlmachines
        self.proc = self.umlmachines.run_machine()
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText('Running Umlmachine %s' % self.umlmachines.current)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)
        
    def update_progress(self):
        #retval = self.proc.poll()
        #print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Exemplo n.º 4
0
class BootStrapperWidget(QWidget):
    def __init__(self, parent, suite, name="RunnerWidget"):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        cfg = self.app.umlcfg
        basefile = make_base_filesystem(suite, "%s.base" % suite, cfg=cfg, size=300, mkfs="mke2fs")
        self.bootstrapper = UmlBootstrapper(suite, basefile, cfg=self.cfg)
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText("Bootstrapping suite %s" % suite)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL("timeout()"), self.update_progress)
        self.timer.startTimer(1000)

    def update_progress(self):
        # retval = self.proc.poll()
        # print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Exemplo n.º 5
0
class InstallerWidget(QWidget):
    def __init__(self, parent, umlmachines, name='InstallerWidget'):
        QWidget.__init__(self, parent, name)
        self.resize(600, 600)
        self.app = get_application_pointer()
        self.conn = self.app.conn
        self.umlmachines = umlmachines
        self.machine = self.umlmachines.current
        self.current_machine_process = 'start'
        self.current_profile = None
        self.current_trait = None
        self.traitlist = []
        self.curenv = CurrentEnvironment(self.conn, self.machine)
        self.curenv['current_profile'] = 'None'
        self.curenv['current_trait'] = 'None'
        self.curenv['current_machine_process'] = self.current_machine_process
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)
        self.grid = QGridLayout(self, 4, 1, 5, 7)
        self.main_label = QLabel(self)
        self.main_label.setText(self._msg())
        self.grid.addWidget(self.main_label, 0, 0)
        self.profile_progress_lbl = QLabel(self)
        self.grid.addWidget(self.profile_progress_lbl, 1, 0)
        self.profile_progress = KProgress(self)
        self.grid.addWidget(self.profile_progress, 2, 0)
        self.logview = LogBrowser(self, '/tmp/uml-installer.log')
        self.grid.addWidget(self.logview, 3, 0)
        #self.console_view = StdOutBrowser(self)
        #self.console_view = KTextBrowser(self)
        #self.grid.addWidget(self.console_view, 4, 0)
        self.console_text = ''

    def _msg(self):
        return 'Installing uml machine %s - %s' % (
            self.machine, self.current_machine_process)

    def update_console_text(self):
        if self.umlmachines.run_process is not None:
            stdout = self.umlmachines.run_process.stdout
            stdoutfd = stdout.fileno()
            ready = select.select([stdoutfd], [], [])
            while stdoutfd in ready[0]:
                line = stdout.readline()
                if line:
                    self.console_text += line
                ready = select.select([stdoutfd], [], [])
            stdout = self.umlmachines.run_process.stdout
            line = stdout.readline()
            if line:
                self.console_text += line
            self.console_view.setText(self.console_text)

    def update_progress(self):
        #self.update_console_text()
        process = self.curenv['current_machine_process']
        #print 'update_progress', process
        if process != self.current_machine_process:
            self.current_machine_process = process
            self.main_label.setText(self._msg())
        if self.current_profile is None:
            profile = self.curenv['current_profile']
            if profile != 'None':
                self.current_profile = profile
                print 'profile set to', profile
                traitlist = self.curenv['traitlist']
                tl = [t.strip() for t in traitlist.split(',')]
                self.traitlist = tl
                self.profile_progress.setTotalSteps(len(self.traitlist))
        else:
            trait = self.curenv['current_trait']
            if trait != 'None':
                trait_process = self.curenv['current_trait_process']
                profile = self.current_profile
                msg = 'Installing profile %s, trait %s, process %s' % (
                    profile, trait, trait_process)
                self.profile_progress_lbl.setText(msg)
                self.profile_progress.setProgress(
                    self.traitlist.index(trait) + 1)
                self.app.processEvents()
Exemplo n.º 6
0
class InstallerWidget(QWidget):
    def __init__(self, parent, umlmachines, name="InstallerWidget"):
        QWidget.__init__(self, parent, name)
        self.resize(600, 600)
        self.app = get_application_pointer()
        self.conn = self.app.conn
        self.umlmachines = umlmachines
        self.machine = self.umlmachines.current
        self.current_machine_process = "start"
        self.current_profile = None
        self.current_trait = None
        self.traitlist = []
        self.curenv = CurrentEnvironment(self.conn, self.machine)
        self.curenv["current_profile"] = "None"
        self.curenv["current_trait"] = "None"
        self.curenv["current_machine_process"] = self.current_machine_process
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL("timeout()"), self.update_progress)
        self.timer.startTimer(1000)
        self.grid = QGridLayout(self, 4, 1, 5, 7)
        self.main_label = QLabel(self)
        self.main_label.setText(self._msg())
        self.grid.addWidget(self.main_label, 0, 0)
        self.profile_progress_lbl = QLabel(self)
        self.grid.addWidget(self.profile_progress_lbl, 1, 0)
        self.profile_progress = KProgress(self)
        self.grid.addWidget(self.profile_progress, 2, 0)
        self.logview = LogBrowser(self, "/tmp/uml-installer.log")
        self.grid.addWidget(self.logview, 3, 0)
        # self.console_view = StdOutBrowser(self)
        # self.console_view = KTextBrowser(self)
        # self.grid.addWidget(self.console_view, 4, 0)
        self.console_text = ""

    def _msg(self):
        return "Installing uml machine %s - %s" % (self.machine, self.current_machine_process)

    def update_console_text(self):
        if self.umlmachines.run_process is not None:
            stdout = self.umlmachines.run_process.stdout
            stdoutfd = stdout.fileno()
            ready = select.select([stdoutfd], [], [])
            while stdoutfd in ready[0]:
                line = stdout.readline()
                if line:
                    self.console_text += line
                ready = select.select([stdoutfd], [], [])
            stdout = self.umlmachines.run_process.stdout
            line = stdout.readline()
            if line:
                self.console_text += line
            self.console_view.setText(self.console_text)

    def update_progress(self):
        # self.update_console_text()
        process = self.curenv["current_machine_process"]
        # print 'update_progress', process
        if process != self.current_machine_process:
            self.current_machine_process = process
            self.main_label.setText(self._msg())
        if self.current_profile is None:
            profile = self.curenv["current_profile"]
            if profile != "None":
                self.current_profile = profile
                print "profile set to", profile
                traitlist = self.curenv["traitlist"]
                tl = [t.strip() for t in traitlist.split(",")]
                self.traitlist = tl
                self.profile_progress.setTotalSteps(len(self.traitlist))
        else:
            trait = self.curenv["current_trait"]
            if trait != "None":
                trait_process = self.curenv["current_trait_process"]
                profile = self.current_profile
                msg = "Installing profile %s, trait %s, process %s" % (profile, trait, trait_process)
                self.profile_progress_lbl.setText(msg)
                self.profile_progress.setProgress(self.traitlist.index(trait) + 1)
                self.app.processEvents()