コード例 #1
0
ファイル: game.py プロジェクト: EuanCockburn/ifind
def main():

    ##read_config()
    
    splash_screen()
    show_pause()
    show_instructions()
    show_pause()
コード例 #2
0
ファイル: game.py プロジェクト: pombredanne/ifind
def main():

    ##read_config()

    splash_screen()
    show_pause()
    show_instructions()
    show_pause()
コード例 #3
0
ファイル: game.py プロジェクト: Loptr250/ifind
def process_document(ti, dj):
    """(topic,document) -> None
    """
    state = 1
    outcome = 'x'
    FMT = "%H:%M:%S,%f"
    #((datetime.strptime(vals[1],self.FMT)-datetime.strptime(self.last_event_time,self.FMT)) )
    last_time = datetime.now()
    # record time to look at snippet
    log_action(el, 0,ti,dj,'s',0.0)
    show_snippet_screen(ti,dj)
    while outcome == 'x':
        
        outcome = filter_input(state)
        # record time examining snippet
        if outcome =='x':
            show_pause('Command not found - try again!')
            log_action(el, 0,ti,dj,outcome,0.0)
    diff = (datetime.now() - last_time).total_seconds()
    last_time = datetime.now()
    
    log_action(el, 0,ti,dj,outcome,diff)

    if outcome == 'v':
        # record time of document viewed --
        state = 2
        outcome = 'x'
        show_document_screen(ti,dj)

        while outcome == 'x':
            outcome = filter_input(state)
            if outcome =='x':
                show_pause('Command not found - try again!')
                log_action(el, 1, ti,dj,outcome,0.0)
                
        diff = (datetime.now() - last_time).total_seconds()
        last_time = datetime.now()    
        log_action(el, 1,ti,dj,outcome,diff)
コード例 #4
0
def process_document(ti, dj):
    """(topic,document) -> None
    """
    state = 1
    outcome = 'x'
    FMT = "%H:%M:%S,%f"
    #((datetime.strptime(vals[1],self.FMT)-datetime.strptime(self.last_event_time,self.FMT)) )
    last_time = datetime.now()
    # record time to look at snippet
    log_action(el, 0, ti, dj, 's', 0.0)
    show_snippet_screen(ti, dj)
    while outcome == 'x':

        outcome = filter_input(state)
        # record time examining snippet
        if outcome == 'x':
            show_pause('Command not found - try again!')
            log_action(el, 0, ti, dj, outcome, 0.0)
    diff = (datetime.now() - last_time).total_seconds()
    last_time = datetime.now()

    log_action(el, 0, ti, dj, outcome, diff)

    if outcome == 'v':
        # record time of document viewed --
        state = 2
        outcome = 'x'
        show_document_screen(ti, dj)

        while outcome == 'x':
            outcome = filter_input(state)
            if outcome == 'x':
                show_pause('Command not found - try again!')
                log_action(el, 1, ti, dj, outcome, 0.0)

        diff = (datetime.now() - last_time).total_seconds()
        last_time = datetime.now()
        log_action(el, 1, ti, dj, outcome, diff)
コード例 #5
0
ファイル: game.py プロジェクト: Loptr250/ifind
def main():
    
    sys.stdout.write("\x1b[8;{rows};{cols}t".format(rows=100, cols=100))
    splash_screen()
    show_pause()
    show_instructions()
    show_pause()
    
    tc = TestCollection.objects.all()
    for coll in tc:
        t = Topic.objects.filter(testcollection=coll)
        for ti in t:
            d = Document.objects.filter(topic=ti)
            i = 0
            n = len(d)
            set_progress_doc(i,n)
            show_topic_screen(ti)
            show_pause()
            for dj in d:
                i += 1
                set_progress_doc(i)
                process_document(ti,dj)
            show_break_screen('Topic Completed.')
            show_pause()
コード例 #6
0
ファイル: game-old.py プロジェクト: Loptr250/ifind
def main():
    
    
    splash_screen()
    show_pause()
    show_instructions()
    show_pause()
    
    tc = TestCollection.objects.all()
    # print tc
    t = Topic.objects.filter(testcollection=tc)
    for ti in t:
        d = Document.objects.filter(topic=ti)
        i = 0
        n = len(d)
        set_progress_doc(i,n)
        show_topic_screen(ti)
        show_pause()
        for dj in d:
            i += 1
            set_progress_doc(i)
            process_document(ti,dj)
        show_break_screen('Topic Completed.')
        show_pause()
コード例 #7
0
def main():

    sys.stdout.write("\x1b[8;{rows};{cols}t".format(rows=100, cols=100))
    splash_screen()
    show_pause()
    show_instructions()
    show_pause()

    tc = TestCollection.objects.all()
    for coll in tc:
        t = Topic.objects.filter(testcollection=coll)
        for ti in t:
            d = Document.objects.filter(topic=ti)
            i = 0
            n = len(d)
            set_progress_doc(i, n)
            show_topic_screen(ti)
            show_pause()
            for dj in d:
                i += 1
                set_progress_doc(i)
                process_document(ti, dj)
            show_break_screen('Topic Completed.')
            show_pause()