|
260 | 260 | " \"--int-arg <int_arg:int?> \"\n", |
261 | 261 | " \"--tuple-arg <tuple_arg:int,str> \"\n", |
262 | 262 | " ),\n", |
263 | | - " inputs={\"recursive\": shell.arg(\n", |
264 | | - " help=(\n", |
265 | | - " \"If source_file designates a directory, cp copies the directory and \"\n", |
266 | | - " \"the entire subtree connected at that point.\"\n", |
| 263 | + " inputs={\n", |
| 264 | + " \"recursive\": shell.arg(\n", |
| 265 | + " help=(\n", |
| 266 | + " \"If source_file designates a directory, cp copies the directory and \"\n", |
| 267 | + " \"the entire subtree connected at that point.\"\n", |
| 268 | + " )\n", |
267 | 269 | " )\n", |
268 | | - " )},\n", |
| 270 | + " },\n", |
269 | 271 | " outputs={\n", |
270 | 272 | " \"out_dir\": shell.outarg(position=-2),\n", |
271 | 273 | " \"out_file\": shell.outarg(position=-1),\n", |
|
297 | 299 | "from pathlib import Path\n", |
298 | 300 | "from fileformats.generic import File\n", |
299 | 301 | "\n", |
300 | | - "# Arguments to the callable function can be one of \n", |
| 302 | + "\n", |
| 303 | + "# Arguments to the callable function can be one of\n", |
301 | 304 | "def get_file_size(out_file: Path) -> int:\n", |
302 | 305 | " \"\"\"Calculate the file size\"\"\"\n", |
303 | 306 | " result = os.stat(out_file)\n", |
|
356 | 359 | "from pydra.utils.typing import MultiInputObj\n", |
357 | 360 | "from fileformats.generic import FsObject, Directory\n", |
358 | 361 | "\n", |
| 362 | + "\n", |
359 | 363 | "@shell.define\n", |
360 | 364 | "class Cp(ShellDef[\"Cp.Outputs\"]):\n", |
361 | 365 | "\n", |
|
369 | 373 | "\n", |
370 | 374 | " @shell.outputs\n", |
371 | 375 | " class Outputs(ShellOutputs):\n", |
372 | | - " out_dir: Directory = shell.outarg(path_template=\"{out_dir}\")\n" |
| 376 | + " out_dir: Directory = shell.outarg(path_template=\"{out_dir}\")" |
373 | 377 | ] |
374 | 378 | }, |
375 | 379 | { |
|
396 | 400 | " \"in_file\": shell.arg(type=File, help=\"output file\", argstr=\"\", position=-2)\n", |
397 | 401 | " },\n", |
398 | 402 | " outputs={\n", |
399 | | - " \"out_file\": shell.outarg(\n", |
400 | | - " type=File, help=\"output file\", argstr=\"\", position=-1\n", |
401 | | - " ),\n", |
| 403 | + " \"out_file\": shell.outarg(type=File, help=\"output file\", argstr=\"\", position=-1),\n", |
402 | 404 | " \"out_file_size\": {\n", |
403 | 405 | " \"type\": int,\n", |
404 | 406 | " \"help\": \"size of the output directory\",\n", |
405 | 407 | " \"callable\": get_file_size,\n", |
406 | | - " }\n", |
| 408 | + " },\n", |
407 | 409 | " },\n", |
408 | 410 | ")\n", |
409 | 411 | "\n", |
410 | 412 | "\n", |
411 | 413 | "print(f\"ACommand input fields: {list_fields(ACommand)}\")\n", |
412 | | - "print(f\"ACommand input fields: {list_fields(ACommand.Outputs)}\")\n" |
| 414 | + "print(f\"ACommand input fields: {list_fields(ACommand.Outputs)}\")" |
413 | 415 | ] |
414 | 416 | }, |
415 | 417 | { |
|
0 commit comments