Beispiel #1
0
    def on_play(self):
        self._init_soya()
        self._create_models()
        self._create_camera_and_light()

        # this method will run until stopped from another thread
        self.rhomb.stopping = False
        self._stopped = False
        self._run_soya_mainloop()

        soya.quit()
        print "Stopped soya's main loop."
        self._stopped = True
Beispiel #2
0
 def on_play(self):
     self._init_soya()
     self._create_models()
     self._create_camera_and_light()
     
     # this method will run until stopped from another thread
     self.rhomb.stopping = False
     self._stopped = False
     self._run_soya_mainloop()
     
     soya.quit()
     print "Stopped soya's main loop."
     self._stopped = True
Beispiel #3
0
    def save(self, args=None):
        # Sucking values out of the pudding labels, wich is crap:
        toggle_map = [_('off'), _('on')]
        on_off_mapping = {toggle_map[0]: 'off', toggle_map[1]: 'on'}
        x, y = self.options_menu_screen.toggle_list[0].label.split('x')
        fs = on_off_mapping[self.options_menu_screen.toggle_list[1].label]
        fps = on_off_mapping[self.options_menu_screen.toggle_list[2].label]
        pil = on_off_mapping[self.options_menu_screen.toggle_list[3].label]

        sp = self.options_menu_sound.toggle_list[0].label
        si = self.options_menu_sound.toggle_list[1].label
        spr = on_off_mapping[self.options_menu_sound.toggle_list[2].label]

        tn = self.options_menu_theme.toggle_list[0].label

        locale = self.options_menu_misc.toggle_list[0].label
        octave = on_off_mapping[self.options_menu_misc.toggle_list[1].label]
        helper = on_off_mapping[self.options_menu_misc.toggle_list[2].label]
        allowed_difference = self.options_menu_misc.toggle_list[3].label


        self.config['screen'] = {
            'resolution_x' : x,
            'resolution_y' : y,
            'fullscreen' : fs,
            'fps_label' : fps,
            'pil' : pil
        }
        self.config['sound'] = {
            'player' : sp,
            'input' : si,
            'preview' : spr,
        }
        self.config['theme'] = {
            'name' : tn
        }
        self.config['misc'] = {
            'locale' : locale,
            'octave' : octave,
            'helper' : helper,
            'allowed_difference' : allowed_difference
        }
        self.config.write()

        if args == 'quit':
            soya.quit()
            self.core._start()
Beispiel #4
0
    def save(self, args=None):
        # Sucking values out of the pudding labels, wich is crap:
        toggle_map = [_('off'), _('on')]
        on_off_mapping = {toggle_map[0]: 'off', toggle_map[1]: 'on'}
        x, y = self.options_menu_screen.toggle_list[0].label.split('x')
        fs = on_off_mapping[self.options_menu_screen.toggle_list[1].label]
        fps = on_off_mapping[self.options_menu_screen.toggle_list[2].label]
        pil = on_off_mapping[self.options_menu_screen.toggle_list[3].label]

        sp = self.options_menu_sound.toggle_list[0].label
        si = self.options_menu_sound.toggle_list[1].label
        spr = on_off_mapping[self.options_menu_sound.toggle_list[2].label]

        tn = self.options_menu_theme.toggle_list[0].label

        locale = self.options_menu_misc.toggle_list[0].label
        octave = on_off_mapping[self.options_menu_misc.toggle_list[1].label]
        helper = on_off_mapping[self.options_menu_misc.toggle_list[2].label]
        allowed_difference = self.options_menu_misc.toggle_list[3].label

        self.config['screen'] = {
            'resolution_x': x,
            'resolution_y': y,
            'fullscreen': fs,
            'fps_label': fps,
            'pil': pil
        }
        self.config['sound'] = {
            'player': sp,
            'input': si,
            'preview': spr,
        }
        self.config['theme'] = {'name': tn}
        self.config['misc'] = {
            'locale': locale,
            'octave': octave,
            'helper': helper,
            'allowed_difference': allowed_difference
        }
        self.config.write()

        if args == 'quit':
            soya.quit()
            self.core._start()
Beispiel #5
0
	def tearDown(self):
		soya.quit()
Beispiel #6
0
	def setUp(self):
		soya.quit()
		self._old_stdout = sys.stdout
		self.stdout = sys.stdout = StringIO()
		self._old_stderr = sys.stderr
		self.stderr = sys.stderr = StringIO()
Beispiel #7
0
	def tearDown(self):
		soya.quit()
		sys.stdout = self._old_stdout
		sys.stderr = self._old_stderr
Beispiel #8
0
 def save(self, args=None):
     args[0].save()
     self.config.write()
     if args[1] == 'quit':
         soya.quit()
         restart_program()