当前位置: 首页>>代码示例>>Python>>正文


Python Score.save方法代码示例

本文整理汇总了Python中score.Score.save方法的典型用法代码示例。如果您正苦于以下问题:Python Score.save方法的具体用法?Python Score.save怎么用?Python Score.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在score.Score的用法示例。


在下文中一共展示了Score.save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_result_set

# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import save [as 别名]
    def create_result_set(self, reading_system, testsuite, user):
        from result import Result
        from score import Score, AccessibilityScore
        from testsuite_app import helper_functions
        last_updated = helper_functions.generate_timestamp()
        result_set = ResultSet(reading_system = reading_system, testsuite=testsuite, last_updated = last_updated, user = user)
        result_set.save()   
        print "Creating result set"
        # create empty results for each test
        tests = testsuite.get_tests()
        for test in tests:
            result = Result(result_set = result_set, test = test)
            result.save()

        # create empty scores for each category
        categories = testsuite.get_categories()
        for cat in categories:
            if testsuite.testsuite_type == common.TESTSUITE_TYPE_DEFAULT:
                score = Score(category = cat, result_set = result_set)
                score.save()
            else:
                score = AccessibilityScore(category = cat, result_set = result_set)
                score.save()

        if testsuite.testsuite_type == common.TESTSUITE_TYPE_DEFAULT:
            overall_score = Score(category = None, result_set = result_set)
            overall_score.save()
        else:
            overall_score = AccessibilityScore(category = None, result_set = result_set)
            overall_score.save()

        result_set.visibility = reading_system.visibility

        return result_set
开发者ID:e10,项目名称:epubtestweb,代码行数:36,代码来源:result_set.py

示例2: create_evaluation

# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import save [as 别名]
    def create_evaluation(self, reading_system):
        "Create and return a new evaluation, along with an initialized set of result objects."
        from test import Test
        from score import Score
        from result import Result
        from category import Category
        from testsuite import TestSuite

        testsuite = TestSuite.objects.get_most_recent_testsuite()
        print "Creating evaluation for testsuite {0}".format(testsuite.version_date)
        tests = Test.objects.filter(testsuite = testsuite)

        evaluation = self.create(
            testsuite = testsuite,
            last_updated = generate_timestamp(),
            percent_complete = 0.00,
            reading_system = reading_system
        )
        evaluation.save()
        
        total_score = Score(category = None, evaluation = evaluation)
        total_score.save()

        # create results for this evaluation
        for t in tests:
            result = Result(test = t, evaluation = evaluation, result = RESULT_NOT_ANSWERED)
            result.save()

        # update the score once results have been created
        total_score.update(evaluation.get_all_results())

        # create category score entries for this evaluation
        categories = Category.objects.filter(testsuite = evaluation.testsuite)
        for cat in categories:
            score = Score(
                category = cat,
                evaluation = evaluation
            )
            score.update(evaluation.get_category_results(cat))
            score.save()

        return evaluation
开发者ID:j-a-vizcaino,项目名称:epubtestweb,代码行数:44,代码来源:evaluation.py

示例3:

# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import save [as 别名]
                        #####Slide-Sound########
                        sounds.play_slide_sound()                       
                        grid.fill_random()                        
                        if grid.area.all() and not gameover:#grid full and not yet gameover
                            if not grid.check_merge():
                                move_timeout = timer + 3 #3 seconds gameover
                                ####Lose Sound####
                                sounds.play_lose_sound()                              
                                gameover = True
                else:
                    if e.key == P.K_m:
                        show_moves = not show_moves                           
                        continue                                    
            elif e.type == P.KEYDOWN and gameover:
                if move_timeout <= timer and e.key == P.K_RIGHT:
                    score.save()
                    new_Round()

        
                    
        #####LOGICBLOCK#####
        EM.dispatch("game_logic_start", grid)

        #####RENDERBLOCK#####
        
        fizzles.render(D)
        EM.dispatch("game_frame_start", D)
        delta = grid.area != grid.last #elementwise check for matrix
        for x,y in posses:
            pos = centers[(x,y)]
            val = grid.area[x, y]
开发者ID:Marco-Meyer,项目名称:TINF13AIBI-Kinect,代码行数:33,代码来源:2048.py


注:本文中的score.Score.save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。