Exemple #1
0
 def _setup_code(self, change=None):  # pylint: disable=unused-argument
     """Setup an AiiDA code."""
     with self._setup_code_out:
         clear_output()
         if self.label is None:
             print("You did not specify code label")
             return
         if not self.exec_path:
             print("You did not specify absolute path to the executable")
             return
         if self.exists():
             print("Code {}@{} already exists".format(
                 self.label, self.computer.name))
             return
         code = Code(remote_computer_exec=(self.computer, self.exec_path))
         code.label = self.label
         code.description = self.description
         code.set_input_plugin_name(self.plugin)
         code.set_prepend_text(self.prepend_text)
         code.set_append_text(self.append_text)
         code.store()
         code.reveal()
         full_string = "{}@{}".format(self.label, self.computer.name)
         print(
             check_output(['verdi', 'code', 'show',
                           full_string]).decode('utf-8'))
Exemple #2
0
 def _setup_code(self, _=None):
     """Setup an AiiDA code."""
     with self._setup_code_out:
         clear_output()
         if self.label is None:
             print("You did not specify code label.")
             return
         if not self.remote_abs_path:
             print("You did not specify absolute path to the executable.")
             return
         if not self.inp_computer.selected_computer:
             print(
                 "Please specify a computer that is configured in your AiiDA profile."
             )
             return False
         if not self.input_plugin:
             print(
                 "Please specify an input plugin that is installed in your AiiDA environment."
             )
             return False
         if self.exists():
             print(
                 f"Code {self.label}@{self.inp_computer.selected_computer.label} already exists."
             )
             return
         code = Code(remote_computer_exec=(
             self.inp_computer.selected_computer,
             self.remote_abs_path,
         ))
         code.label = self.label
         code.description = self.description
         code.set_input_plugin_name(self.input_plugin)
         code.set_prepend_text(self.prepend_text)
         code.set_append_text(self.append_text)
         code.store()
         code.reveal()
         full_string = f"{self.label}@{self.inp_computer.selected_computer.label}"
         print(
             check_output(["verdi", "code", "show",
                           full_string]).decode("utf-8"))