@@ -112,6 +112,14 @@ def exe_args(self, value: t.Union[str, t.Sequence[str], None]) -> None:
112112 """
113113 self ._exe_args = self ._build_exe_args (value )
114114
115+ def add_exe_args (self , args : t .Union [str , t .List [str ], None ]) -> None :
116+ """Add executable arguments to executable
117+
118+ :param args: executable arguments
119+ """
120+ args = self ._build_exe_args (args )
121+ self ._exe_args .extend (args )
122+
115123 @property
116124 def files (self ) -> t .Optional [EntityFiles ]:
117125 """Return files to be copied, symlinked, and/or configured prior to
@@ -178,13 +186,12 @@ def key_prefixing_enabled(self, value: bool) -> None:
178186 """
179187 self .key_prefixing_enabled = copy .deepcopy (value )
180188
181- def add_exe_args (self , args : t .Union [str , t . List [ str ], None ]) -> None :
182- """Add executable arguments to executable
189+ def as_executable_sequence (self ) -> t .Sequence [str ] :
190+ """Converts the executable and its arguments into a sequence of program arguments.
183191
184- :param args: executable arguments
192+ :return: a sequence of strings representing the executable and its arguments
185193 """
186- args = self ._build_exe_args (args )
187- self ._exe_args .extend (args )
194+ return [self .exe , * self .exe_args ]
188195
189196 def attach_generator_files (
190197 self ,
@@ -242,27 +249,6 @@ def attached_files_table(self) -> str:
242249 return "No file attached to this application."
243250 return str (self .files )
244251
245- def print_attached_files (self ) -> None :
246- """Print a table of the attached files on std out"""
247- print (self .attached_files_table )
248-
249- def __str__ (self ) -> str : # pragma: no cover
250- exe_args_str = "\n " .join (self .exe_args )
251- entities_str = "\n " .join (str (entity ) for entity in self .incoming_entities )
252- return textwrap .dedent (f"""\
253- Name: { self .name }
254- Type: { self .type }
255- Executable:
256- { self .exe }
257- Executable Arguments:
258- { exe_args_str }
259- Entity Files: { self .files }
260- File Parameters: { self .file_parameters }
261- Incoming Entities:
262- { entities_str }
263- Key Prefixing Enabled: { self .key_prefixing_enabled }
264- """ )
265-
266252 @staticmethod
267253 def _build_exe_args (exe_args : t .Union [str , t .Sequence [str ], None ]) -> t .List [str ]:
268254 """Check and convert exe_args input to a desired collection format
@@ -286,3 +272,24 @@ def _build_exe_args(exe_args: t.Union[str, t.Sequence[str], None]) -> t.List[str
286272 return exe_args .split ()
287273
288274 return exe_args
275+
276+ def print_attached_files (self ) -> None :
277+ """Print a table of the attached files on std out"""
278+ print (self .attached_files_table )
279+
280+ def __str__ (self ) -> str : # pragma: no cover
281+ exe_args_str = "\n " .join (self .exe_args )
282+ entities_str = "\n " .join (str (entity ) for entity in self .incoming_entities )
283+ return textwrap .dedent (f"""\
284+ Name: { self .name }
285+ Type: { self .type }
286+ Executable:
287+ { self .exe }
288+ Executable Arguments:
289+ { exe_args_str }
290+ Entity Files: { self .files }
291+ File Parameters: { self .file_parameters }
292+ Incoming Entities:
293+ { entities_str }
294+ Key Prefixing Enabled: { self .key_prefixing_enabled }
295+ """ )
0 commit comments