コード例 #1
0
ファイル: monitors.py プロジェクト: jbrezmorf/flow123d
class ProgressMonitor(ThreadMonitor):
    """
    Class ProgressMonitor monitors pypy process while it is running
    and reports progress
    """
    def __init__(self, pypy):
        super(ProgressMonitor, self).__init__(pypy)
        # set priority so that output is right after is finished and overrides
        # previous progress bar line
        self.pypy.on_process_complete.set_priority(self.on_complete, 5)
        self.timer = ProgressTime('Running | elapsed time {}')

    @ensure_active
    def on_update(self, pypy=None):
        if pypy.executor.broken:
            return

        self.timer.update()

    @ensure_active
    def on_complete(self, pypy=None):
        if pypy.executor.broken:
            return

        self.timer.format = 'Done    | elapsed time {}'
        self.timer.stop()
コード例 #2
0
class ProgressMonitor(ThreadMonitor):
    """
    Class ProgressMonitor monitors pypy process while it is running
    and reports progress
    """
    def __init__(self, pypy):
        super(ProgressMonitor, self).__init__(pypy)
        # set priority so that output is right after is finished and overrides
        # previous progress bar line
        self.pypy.on_process_complete.set_priority(self.on_complete, 5)
        self.timer = ProgressTime('Running | elapsed time {}')

    @ensure_active
    def on_update(self, pypy=None):
        if pypy.executor.broken:
            return

        self.timer.update()

    @ensure_active
    def on_complete(self, pypy=None):
        if pypy.executor.broken:
            return

        self.timer.format = 'Done    | elapsed time {}'
        self.timer.stop()
コード例 #3
0
class ProgressMonitor(ThreadMonitor):
    def __init__(self, pypy):
        super(ProgressMonitor, self).__init__(pypy)
        self.timer = ProgressTime('Running | elapsed time {}')
        # increase priority
        self.pypy.on_process_complete.set_priority(self.on_complete, 5)

    @ensure_active
    def on_update(self, pypy=None):
        self.timer.update()

    @ensure_active
    def on_complete(self, pypy=None):
        self.timer.format = 'Done    | elapsed time {}'
        self.timer.stop()
コード例 #4
0
ファイル: monitors.py プロジェクト: jbrezmorf/flow123d
 def __init__(self, pypy):
     super(ProgressMonitor, self).__init__(pypy)
     # set priority so that output is right after is finished and overrides
     # previous progress bar line
     self.pypy.on_process_complete.set_priority(self.on_complete, 5)
     self.timer = ProgressTime('Running | elapsed time {}')
コード例 #5
0
 def __init__(self, pypy):
     super(ProgressMonitor, self).__init__(pypy)
     # set priority so that output is right after is finished and overrides
     # previous progress bar line
     self.pypy.on_process_complete.set_priority(self.on_complete, 5)
     self.timer = ProgressTime('Running | elapsed time {}')
コード例 #6
0
 def __init__(self, pypy):
     super(ProgressMonitor, self).__init__(pypy)
     self.timer = ProgressTime('Running | elapsed time {}')
     # increase priority
     self.pypy.on_process_complete.set_priority(self.on_complete, 5)