コード例 #1
0
ファイル: guilogger.py プロジェクト: anilkunwar/OOF2
def loadLog(menuitem, filename, checkpoints):
    if gtklogger.replaying():
        raise ooferror.ErrUserError(
            "Multiple GUI logs cannot be replayed simultaneously!")
    debug.fmsg("Loading gui script", filename)
    menuitem.root().setOption('post_hook', menucheckpoint)
    dblevel = 0
    if debug.debug():
        dblevel = 3
    #dblevel = 4
    global _replaying
    _replaying = True

    # When replaying, we have to make sure that progress bars *always*
    # appear, so we set the delay time to 0.  If the delay time is
    # non-zero, then a script recorded on a slow machine would insert
    # a checkpoint for opening the activity viewer window, but a
    # faster machine might never open the window, and would wait
    # forever for the checkpoint when replaying the script.
    progressbar_delay.set_delay(None, 0)

    gtklogger.replay(
        filename,
        beginCB=activityViewer.openActivityViewer,
        finishCB=logFinished,
        debugLevel=dblevel,
        threaded=thread_enable.query(),
        exceptHook=loggererror,
        checkpoints=checkpoints)
コード例 #2
0
def loadLog(menuitem, filename, checkpoints):
    if gtklogger.replaying():
        raise ooferror.ErrUserError(
            "Multiple GUI logs cannot be replayed simultaneously!")
    debug.fmsg("Loading gui script", filename)
    menuitem.root().setOption('post_hook', menucheckpoint)
    dblevel = 0
    if debug.debug():
        dblevel = 3
    #dblevel = 4
    global _replaying
    _replaying = True

    # When replaying, we have to make sure that progress bars *always*
    # appear, so we set the delay time to 0.  If the delay time is
    # non-zero, then a script recorded on a slow machine would insert
    # a checkpoint for opening the activity viewer window, but a
    # faster machine might never open the window, and would wait
    # forever for the checkpoint when replaying the script.
    progressbar_delay.set_delay(None, 0)

    gtklogger.replay(filename,
                     beginCB=activityViewer.openActivityViewer,
                     finishCB=logFinished,
                     debugLevel=dblevel,
                     threaded=thread_enable.query(),
                     exceptHook=loggererror,
                     checkpoints=checkpoints)
コード例 #3
0
def rerecordLog(menuitem, filename, checkpoints, use_gui):
    if gtklogger.replaying():
        raise ooferror.ErrUserError(
            "Multiple GUI logs cannot be replayed simultaneously!")
    menuitem.root().setOption('post_hook', menucheckpoint)
    dblevel = 0
    if debug.debug():
        dblevel = 3
    #dblevel = 4
    global _replaying, _recording
    _replaying = True
    _recording = True
    progressbar_delay.set_delay(None, 0)

    # Find a suitable new name for the backup copy of the old log
    # file.  Just append ".bak", but if that file already exists,
    # append ".bakX", where X is an integer.
    if not os.path.exists(filename + '.bak'):
        backupname = filename + '.bak'
    else:
        backupname = None
        count = 2
        while not backupname:
            trialname = "%s.bak%d" % (filename, count)
            if not os.path.exists(trialname):
                backupname = trialname
            count += 1
    os.system('cp ' + filename + ' ' + backupname)
    debug.fmsg("Loading gui script", backupname)

    gtklogger.replay(
        backupname,
        beginCB=activityViewer.openActivityViewer,
        finishCB=logFinished,
        debugLevel=dblevel,
        threaded=thread_enable.query(),
        exceptHook=loggererror,
        rerecord=filename,
        checkpoints=checkpoints,
        logger_comments=use_gui
    )  #Passing the logger_comments parameter to show the loggergui
コード例 #4
0
ファイル: guilogger.py プロジェクト: anilkunwar/OOF2
def rerecordLog(menuitem, filename, checkpoints, use_gui):
    if gtklogger.replaying():
        raise ooferror.ErrUserError(
            "Multiple GUI logs cannot be replayed simultaneously!")
    menuitem.root().setOption('post_hook', menucheckpoint)
    dblevel = 0
    if debug.debug():
        dblevel = 3
    #dblevel = 4
    global _replaying, _recording
    _replaying = True
    _recording = True
    progressbar_delay.set_delay(None, 0)

    # Find a suitable new name for the backup copy of the old log
    # file.  Just append ".bak", but if that file already exists,
    # append ".bakX", where X is an integer.
    if not os.path.exists(filename + '.bak'):
        backupname = filename + '.bak'
    else:
        backupname = None
        count = 2
        while not backupname:
            trialname = "%s.bak%d" % (filename, count)
            if not os.path.exists(trialname):
                backupname = trialname
            count += 1
    os.system('cp '+filename+' '+backupname)
    debug.fmsg("Loading gui script", backupname)

    gtklogger.replay(
        backupname,
        beginCB=activityViewer.openActivityViewer,
        finishCB=logFinished,
        debugLevel=dblevel,
        threaded=thread_enable.query(),
        exceptHook=loggererror,
        rerecord=filename,
        checkpoints=checkpoints,
        logger_comments=use_gui) #Passing the logger_comments parameter to show the loggergui