Example #1
0
        def eventCallback(self, *args, **kwargs):

            if args[3] == 'config' and args[4] == 'load':
                if args[5] == 'defaults':
                    self.app.config.add_setting('Screenshots',
                                                'screenshot_dir',
                                                'screenshots',
                                                alias='Screenshot Folder',
                                                type=3)
                    self.app.config.add_setting('Screenshots',
                                                'screenshot_format',
                                                'JPEG',
                                                alias='Screenshot Format',
                                                type=1,
                                                options=['PNG'])
                    self.app.config.add_setting('Keybindings',
                                                'screenshot_key',
                                                'SLASH',
                                                alias='Screenshot',
                                                type=1,
                                                options=PYGAME_KEYS)

            if args[3] == 'press' and args[5] == 'user' and args[
                    4] == self.screenshot_key:
                filename = os.path.join(
                    self.app.config['Screenshots']['screenshot_dir'],
                    "%s.jpg" % getDateTimeStamp())
                pygame.image.save(self.app.screen, filename)
Example #2
0
 def on_start(self):
     if director.settings['player'] == 'Human' and director.settings['mode'] == 'Experiment':
         self.parent.switch_to(2)
     else:
         filebase = "WilliamsSearch_%s" % (getDateTimeStamp())
         director.settings['filebase'] = filebase
         director.scene.dispatch_event('start_task')
Example #3
0
 def on_start(self):
     si = {}
     si['first_name'] = ''.join(self.items['firstname']._value).strip()
     si['last_name'] = ''.join(self.items['lastname']._value).strip()
     si['rin'] = ''.join(self.items['rin']._value)
     si['encrypted_rin'], si['cipher'] = rin2id(si['rin'])
     si['timestamp'] = getDateTimeStamp()
     director.settings['si'] = si
     filebase = "WilliamsSearch_%s_%s" % (si['timestamp'], si['encrypted_rin'][:8])
     director.settings['filebase'] = filebase
     writeHistoryFile("data/%s.history" % filebase, si)
     director.scene.dispatch_event('start_task')
Example #4
0
 def on_start(self):
     filebase = "WhackAMole_%s" % (getDateTimeStamp())
     director.settings['filebase'] = filebase
     director.scene.dispatch_event('start_task')
Example #5
0
 def eventCallback(self, *args, **kwargs):
     
     if args[3] == 'config' and args[4] == 'load':
         if args[5] == 'defaults':
             self.app.config.add_setting('Screenshots', 'screenshot_dir', 'screenshots', alias='Screenshot Folder', type=3)
             self.app.config.add_setting('Screenshots', 'screenshot_format', 'JPEG', alias='Screenshot Format', type=1, options=['PNG'])
             self.app.config.add_setting('Keybindings', 'screenshot_key', 'SLASH', alias='Screenshot', type=1, options=PYGAME_KEYS)
     
     if args[3] == 'press' and args[5] == 'user' and args[4] == self.screenshot_key:
         filename = os.path.join(self.app.config['Screenshots']['screenshot_dir'], "%s.jpg" % getDateTimeStamp())
         pygame.image.save(self.app.screen, filename)