예제 #1
0
파일: workbench.py 프로젝트: byache/thonny
    def _init_configuration(self):
        self._configuration_manager = try_load_configuration(
            CONFIGURATION_FILE_NAME)
        self._configuration_pages = {}

        self.set_default("general.single_instance", SINGLE_INSTANCE_DEFAULT)
        self.set_default("general.expert_mode", False)
        self.set_default("debug_mode", False)
예제 #2
0
def _should_delegate():
    from thonny import workbench
    from thonny.config import try_load_configuration
    configuration_manager = try_load_configuration(workbench.CONFIGURATION_FILE_NAME)
    # Setting the default
    configuration_manager.add_option("general.single_instance", workbench.SINGLE_INSTANCE_DEFAULT)
    # getting the value (may use the default or return saved value)
    return configuration_manager.get_option("general.single_instance")
예제 #3
0
def _should_delegate():
    if not os.path.exists(get_ipc_file_path()):
        # no previous instance
        return

    from thonny.config import try_load_configuration

    configuration_manager = try_load_configuration(CONFIGURATION_FILE)
    configuration_manager.set_default("general.single_instance", SINGLE_INSTANCE_DEFAULT)
    return configuration_manager.get_option("general.single_instance")
예제 #4
0
 def __init__(self, master):
     TextFrame.__init__(
         self,
         master,
         text_class=rst_utils.RstText,
         vertical_scrollbar_style=scrollbar_style("Vertical"),
         horizontal_scrollbar_style=scrollbar_style("Horizontal"),
         horizontal_scrollbar_class=ui_utils.AutoScrollbar,
         borderwidth=0,
         wrap="word",
         relief="flat",
         padx=20,
         pady=0,
         read_only=True,
     )
     # retrieve the directory of the preferred language
     # for help's .rst files ; this directory is ./ by default
     self.languageDir = "."
     self._configuration_manager = try_load_configuration(
         CONFIGURATION_FILE_NAME)
     self.languageDir = self._configuration_manager.get_option(
         "general.language", ".")
     self.load_rst_file("index.rst")