Ejemplo n.º 1
0
 def on_button_defaut_time_between_sequences_clicked(
         self, widget, data=None):
     adjustmentTimeBetweenSequence = self.builder.get_object(
         "adjustmentTimeBetweenSequence")
     exercice = Exercise()
     adjustmentTimeBetweenSequence.set_value(
         exercice.get_time_between_sequence())
Ejemplo n.º 2
0
 def on_button_defaut_maximum_sequence_time_clicked(self,
                                                    widget,
                                                    data=None):
     adjustmentMaximumSequenceTime = self.builder.get_object(
         "adjustmentMaximumSequenceTime")
     exercice = Exercise()
     adjustmentMaximumSequenceTime.set_value(
         exercice.get_max_sequence_length())
Ejemplo n.º 3
0
def load_exercise(path):
    """Load a perroquet exercise."""
    exercise = Exercise()
    logger = logging.Logger("load_exercise")
    logger.setLevel(defaultLoggingLevel)
    logger.addHandler(defaultLoggingHandler)

    dom = parse(path)
    if len(dom.getElementsByTagName("version")) > 0:
        version = get_text(dom.getElementsByTagName("version")[0].childNodes)

        if version >= "1.1.0":
            load_v1_1_0(exercise, dom, path)
        elif version >= "1.0.0":
            raise NotImplementedError
            load_v1_0_0(exercise, dom, path)
        else:
            logger.error("Unknown file version: " + version)
            exercise = None
    else:
        logger.error("Invalid perroquet file")
        exercise = None

    dom.unlink()

    return exercise
 def on_button_defaut_time_after_sequence_clicked(self, widget, data=None):
     adjustmentTimeAfterSequence = self.builder.get_object("adjustmentTimeAfterSequence")
     exercice = Exercise()
     adjustmentTimeAfterSequence.set_value(exercice.get_play_margin_after())
 def on_button_defaut_maximum_sequence_time_clicked(self, widget, data=None):
     adjustmentMaximumSequenceTime = self.builder.get_object("adjustmentMaximumSequenceTime")
     exercice = Exercise()
     adjustmentMaximumSequenceTime.set_value(exercice.get_max_sequence_length())
 def on_button_defaut_time_between_sequences_clicked(self, widget, data=None):
     adjustmentTimeBetweenSequence = self.builder.get_object("adjustmentTimeBetweenSequence")
     exercice = Exercise()
     adjustmentTimeBetweenSequence.set_value(exercice.get_time_between_sequence())
Ejemplo n.º 7
0
 def on_button_defaut_time_after_sequence_clicked(self, widget, data=None):
     adjustmentTimeAfterSequence = self.builder.get_object(
         "adjustmentTimeAfterSequence")
     exercice = Exercise()
     adjustmentTimeAfterSequence.set_value(exercice.get_play_margin_after())