Пример #1
0
    def show_init(time_args, sound_args):
        """ prints the 'time' values that are saved in the init files.
        """
        file = in_app_path("../config/fm.init")
        config = ConfigParser()
        config.read(file)

        print("Default Values:")
        print(
            View.getColor("green") + "   Focus Time: " +
            str(time_args["focus_time"]))
        print(
            View.getColor("orange") + "   Short Break: " +
            str(time_args["short_break"]))
        print(
            View.getColor("red") + "   Long Break: " +
            str(time_args["long_break"]))
        print(
            View.getColor("blue") + "   Rounds: " +
            str(time_args["num_rounds"]))
        print(
            View.getColor("purple") + "   Sound: " + str(sound_args["sound"]))
        print(
            View.getColor("pink") + "   Sound File: " +
            str(sound_args["path"]))
        print(View.getColor("reset"))
Пример #2
0
    def save_init(time_args, sound_args):
        """ save the new values as the default values
        """
        file = in_app_path("../config/fm.init")
        config = ConfigParser()
        config.read(file)

        for section in list(config['time']):
            config.set('time', section, str(time_args[section]))

        for section in list(config['sound']):
            config.set('sound', section, str(sound_args[section]))

        with open(file, 'w') as configfile:
            config.write(configfile)
Пример #3
0
    def load_init():
        """ return the a object array with the lenght os the default values
        """
        file = in_app_path("../config/fm.init")
        config = ConfigParser()
        config.read(file)

        time_args = {}
        sound_args = {}

        for section in list(config['time']):
            time_args[section] = int(config['time'][section])

        for section in list(config['sound']):
            sound_args[section] = str(config['sound'][section])

        if sound_args['sound']:
            SOUND = bool(sound_args['sound'])

        return time_args, sound_args
Пример #4
0
 def ring_bell(cls):
     playsound(in_app_path("Ring01.wav"))
Пример #5
0
 def ring_bell(cls, PATH):
     playsound(in_app_path(PATH))