Esempio n. 1
0
 def click_create(self):
     name = self.name.get()
     if name not in self.app.core.custom_nodes:
         image_file = Path(self.image_file).stem
         node_draw = NodeDraw.from_custom(name, image_file,
                                          set(self.services))
         self.app.core.custom_nodes[name] = node_draw
         self.nodes_list.listbox.insert(tk.END, name)
         self.reset_values()
Esempio n. 2
0
 def read_config(self) -> None:
     # read distributed servers
     for server in self.app.guiconfig.servers:
         self.servers[server.name] = server
     # read custom nodes
     for custom_node in self.app.guiconfig.nodes:
         node_draw = NodeDraw.from_custom(custom_node)
         self.custom_nodes[custom_node.name] = node_draw
     # read observers
     for observer in self.app.guiconfig.observers:
         self.custom_observers[observer.name] = observer
Esempio n. 3
0
 def click_create(self) -> None:
     name = self.name.get()
     if name not in self.app.core.custom_nodes:
         image_file = Path(self.image_file).stem
         custom_node = CustomNode(name, image_file, list(self.services))
         node_draw = NodeDraw.from_custom(custom_node)
         logging.info(
             "created new custom node (%s), image file (%s), services: (%s)",
             name,
             image_file,
             self.services,
         )
         self.app.core.custom_nodes[name] = node_draw
         self.nodes_list.listbox.insert(tk.END, name)
         self.reset_values()
Esempio n. 4
0
    def read_config(self):
        # read distributed server
        for config in self.app.guiconfig.get("servers", []):
            server = CoreServer(config["name"], config["address"], config["port"])
            self.servers[server.name] = server

        # read custom nodes
        for config in self.app.guiconfig.get("nodes", []):
            name = config["name"]
            image_file = config["image"]
            services = set(config["services"])
            node_draw = NodeDraw.from_custom(name, image_file, services)
            self.custom_nodes[name] = node_draw

        # read observers
        for config in self.app.guiconfig.get("observers", []):
            observer = Observer(config["name"], config["cmd"])
            self.custom_observers[observer.name] = observer