Esempio n. 1
0
 def costumes(self, scratch):
     projectName = scratch.name
     costumes = dict()
     costumes['Stage'] = set()
     index = 0
     for background in scratch.stage.backgrounds:
         costumes['Stage'].add(KelpPlugin.save_png(projectName, background, index, 'Stage'))
         index += 1
     for sprite in scratch.sprites:
         index = 0
         costumes[sprite.name] = set()
         for costume in sprite.costumes:
             costumes[sprite.name].add(KelpPlugin.save_png(projectName, costume, index, sprite.name))
             index += 1
     self.costumes = costumes
Esempio n. 2
0
    def analyze(self, scratch):
        if not getattr(scratch, 'kelp_prepared', False):
            KelpPlugin.tag_reachable_scripts(scratch)

        seq = dict()
        # store the screen
        seq['screen'] = KelpPlugin.save_png(scratch.name, scratch.thumbnail,
                                            'screen')

        #store the values for the variables level and points, if they exist
        level = False
        points = False

        for name, var in scratch.variables.items():
            if name == 'level' or name == 'Level':
                level = True
                seq[name] = var.value
            elif name == 'points' or name == 'Points':
                points = True
                seq[name] = var.value

        # If they don't exist, store them with the value of -1
        if level == False:
            seq['level'] = '-1'
        if points == False:
            seq['points'] = '-1'

        # show the display
        self.SequenceDisplay(seq)
Esempio n. 3
0
    def analyze(self, scratch):
        if not getattr(scratch, 'kelp_prepared', False):
            KelpPlugin.tag_reachable_scripts(scratch)

        seq = dict()
        # store the screen
        seq['screen'] = KelpPlugin.save_png(scratch.name, scratch.thumbnail, 'screen');

        #store the values for the variables level and points, if they exist
        level = False
        points = False

        for name, var in scratch.variables.items():
            if name == 'level' or name == 'Level':
                level = True
                seq[name] = var.value
            elif name == 'points' or name == 'Points':
                points = True
                seq[name] = var.value

        # If they don't exist, store them with the value of -1
        if level == False:
            seq['level'] = '-1'
        if points == False:
            seq['points'] = '-1'

        # show the display
        self.SequenceDisplay(seq)