Ejemplo n.º 1
0
    def __init__(self):
        """ Set up some information like, set up the interfaces """
        import locale

        language = None
        loc = locale.getdefaultlocale()
        if loc:
            for el in loc:
                if str(el).upper().startswith("FR"):
                    language = "fr"
                    break

        if language is not None:
            set_translator_locale(language)

        self.root = Tk()
        StudentRunner.TK_ROOT = self.root
        self.root.title("MrPython")

        self.mode = "full"
        self.main_view = MainView(self)
        self.editor_list = self.main_view.editor_widget.py_notebook
        self.icon_widget = self.main_view.icon_widget
        self.status_bar = self.main_view.status_bar
        self.console = self.main_view.console
        self.change_mode()
        self.apply_bindings()
        self.root.protocol('WM_DELETE_WINDOW', self.close_all_event)
Ejemplo n.º 2
0
    def __init__(self):
        """ Set up some information like, set up the interfaces """
        import locale

        language = None
        try:  # Work around a possible Python3.7 bug on MacOS
            loc = locale.getdefaultlocale()
            if loc:
                for el in loc:
                    if str(el).upper().startswith("FR"):
                        language = "fr"
                        break
        except ValueError:
            pass  # language is still None

        if language is not None:
            set_translator_locale(language)

        self.root = Tk()

        self.root.geometry('768x612')
        self.root.title("MrPython")

        self.mode = "full"
        self.main_view = MainView(self)
        self.editor_list = self.main_view.editor_widget.py_notebook
        self.icon_widget = self.main_view.icon_widget
        self.status_bar = self.main_view.status_bar
        self.console = self.main_view.console
        self.change_mode()
        self.apply_bindings()
        self.root.protocol('WM_DELETE_WINDOW', self.close_all_event)

        self.running_interpreter_proxy = None
        self.running_interpreter_callback = None
Ejemplo n.º 3
0
    def __init__(self):
        """ Set up some information like, set up the interfaces """
        import locale

        language = None
        try: # Work around a possible Python3.7 bug on MacOS
            loc = locale.getdefaultlocale()
            if loc:
                for el in loc:
                    if str(el).upper().startswith("FR"):
                        language = "fr"
                        break
        except ValueError:
            pass # language is still None
                    
        if language is not None:
            set_translator_locale(language)

        self.root = Tk()
        
        self.root.title("MrPython")

        self.mode = "full"
        self.main_view = MainView(self)
        self.editor_list = self.main_view.editor_widget.py_notebook
        self.icon_widget = self.main_view.icon_widget
        self.status_bar = self.main_view.status_bar
        self.console = self.main_view.console
        self.change_mode()
        self.apply_bindings()
        self.root.protocol('WM_DELETE_WINDOW', self.close_all_event)

        self.running_interpreter_proxy = None
        self.running_interpreter_callback = None
Ejemplo n.º 4
0
    def __init__(self):
        """ Set up some information like, set up the interfaces """
        import locale

        language = None
        try:  # Work around a possible Python3.7 bug on MacOS
            loc = locale.getdefaultlocale()
            if loc:
                for el in loc:
                    if str(el).upper().startswith("FR"):
                        language = "fr"
                        break
        except ValueError:
            pass  # language is still None

        if language is not None:
            set_translator_locale(language)

        self.root = Tk()

        self.root.geometry('768x612')
        self.root.title("MrPython")

        self.mode = "full"
        self.main_view = MainView(self)
        self.editor_list = self.main_view.editor_widget.py_notebook
        self.icon_widget = self.main_view.icon_widget
        self.status_bar = self.main_view.status_bar
        self.console = self.main_view.console
        self.change_mode()
        self.apply_bindings()
        self.root.protocol('WM_DELETE_WINDOW', self.close_all_event)

        self.running_interpreter_proxy = None
        self.running_interpreter_callback = None

        # message box to accept tracing or not on first launch by this user
        if tracing.user_first_session():
            user_enabled_tracing = tkMessageBox.askyesno(
                title="Suivi pédagogique",
                message=
                "Acceptez-vous que des traces de vos actions dans MrPython " +
                "soient collectées par le LIP6 ?\n" +
                "Ces traces seront anonymisées et uniquement utilisées dans un but d'amélioration pédagogique "
                + "de MrPython.",
                default=tkMessageBox.YES,
                parent=self.root)
        else:
            user_enabled_tracing = tracing.check_tracing_is_enabled()
        tracing.initialize_tracing(user_enabled_tracing)
        self.icon_widget.switch_icon_tracing(user_enabled_tracing)

        self.root.after(1000, self.check_user_state)
        self.root.after(5000, self.update_active_timestamp)
        self.state = "idle"  # 3 states: idle, interacting or typing