Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command arguments as a list is not needed #174

Closed
wigging opened this issue Jun 7, 2024 · 0 comments · Fixed by #178
Closed

Command arguments as a list is not needed #174

wigging opened this issue Jun 7, 2024 · 0 comments · Fixed by #178

Comments

@wigging
Copy link
Collaborator

wigging commented Jun 7, 2024

The shell activity in the ImageMagick example is defined as shown here:

activity = ShellActivity(
    name="ImageMagick",
    files=[
        f"local://{curr_dir}/../tests/campaigns/imagesequence/{i:02d}.jpg"
        for i in range(1, 11)
    ],
    command="convert",
    arguments=[
        "-delay",
        "20",
        "-loop",
        "0",
        f"{curr_dir}/../tests/campaigns/imagesequence/*.jpg",
        "a.gif",
    ],
    logger=logger,
)

Instead of passing a list for the arguments, a string can be split into a list of items such as:

arguments=f"-delay 20 -loop 0 {curr_dir}/../tests/campaigns/imagesequence/*.jpg a.gif".split(" ")

So the arguments parameter could actually be made to require a string instead of a list (see below). This would make it easier for the user so they don't have to manually provide individual argument items. If a list is required within the activity class, then the string can be split into a list.

arguments=f"-delay 20 -loop 0 {curr_dir}/../tests/campaigns/imagesequence/*.jpg a.gif"
@wigging wigging changed the title Activity arguments as a list is not needed Command arguments as a list is not needed Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant